dist/index.browser.mjs— the read-only renderer and the builders.dist/editable.browser.mjs— the same, plus the editor and the commands.
The import map
Point@graphysdk/react at the editable bundle and React at jsDelivr’s ESM builds:
GraphProvider and EditableGraphRenderer from @graphysdk/react inside a <script type="module">. Unlike the npm setup, this uses no /editable subpath.
A page that edits
This page adds an Edit toggle, Undo and Redo buttons, and a Copy spec button. It usescreateElement to render React without JSX.
onSpecChange updates latestSpec after each committed edit, undo or redo. Copy spec serializes that value as JSON; pass the parsed JSON back as spec to restore the chart. Clipboard access requires HTTPS or localhost.
The ref keeps the latest spec without triggering a React render. Using state and passing the exact onSpecChange value back as spec also preserves history. See Saving the chart.
handleRef connects the buttons and keyboard shortcuts to the chart. The module-level spec and data stay stable across renders, so toggling edit mode does not recompile the chart.
Related
- Overview — modes, install and the bundled setup
- Commands & history —
handleRef, undo and redo, the shortcuts - Serializable spec — what
JSON.stringifyon a spec gives you

