Skip to main content
Click a bar, line, axis, legend, grid line or chart background to open its editing controls. Every change uses a command, supports undo and redo, and reaches the provider’s onSpecChange callback.

EditableGraphRenderer

Replace GraphRenderer 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

The /editable entry also requires these TipTap v3 packages for inline text editing:
No stylesheet import is needed. Each entry injects its own styles when it loads.

A chart with an edit toggle

Keep mode 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:
Switching 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.