onSpecChange callback.
EditableGraphRenderer
ReplaceGraphRenderer with EditableGraphRenderer to add menus, selection outlines and inline text editors. It accepts the same props, plus editMenus and palettePresets. Setting mode="edit" on a plain GraphRenderer does not enable editing.
The editor has a separate entry so read-only charts do not load it. Import GraphProvider and builders from @graphysdk/react; import EditableGraphRenderer and command classes from @graphysdk/react/editable.
Modes
mode controls chart interaction and defaults to 'readonly'.
This section covers
'edit' mode. It replaces the usual hover styling with selection outlines and temporarily hides annotations. Switching back restores them. See Annotations for annotation configuration and commands.
Install
/editable entry also requires these TipTap v3 packages for inline text editing:
A chart with an edit toggle
Keepmode in state and toggle it from a button. This example also keeps edits in React state and uses handleRef to enable undo and redo shortcuts:
mode preserves the chart and its undo history, but clears the selection and closes the menu. A user can change a color, click Done and still undo it.
Passing the exact value from onSpecChange back as spec preserves history. An independently created spec starts a new history. To keep edits after a reload, see Saving the chart.
In this section
Selecting
Select chart elements, narrow a selection and use the keyboard.
The edit menu
Controls available for each chart element.
Commands & history
Dispatch edits, group live changes, undo, redo and save.
Custom menus
Replace or extend a target’s menu with
editMenus, reusing Graphy’s rows.Editor panel
Build a settings panel from ready-made sections.
Without a bundler
Add editing to a plain HTML page with a CDN bundle.
Related
- Provider & renderer —
onSpecChange,handleRef, themodeprop - Commands & history — the path every edit takes
- Serializable spec — the spec
onSpecChangehands you, and how to store it

