graphy-editor
Installation
SKILL.md
Graphy editor
Start with a working chart: a GraphProvider with spec and data, as shown in the graphy-charts skill.
How editing works
- Menus, panel controls, and application code dispatch
Commandobjects from@graphysdk/react/editable. They share one undo history and oneonSpecChangecallback. - Use
EditableGraphRendererfrom@graphysdk/react/editableto enable editing. Itsmodeprop controls the available interactions.GraphRendererhas no editing layer, regardless ofmode. GraphProvider.onSpecChangereturns the editedSpecas plain JSON after each completed edit. Save it and pass it back asspecto restore the chart. Edits do not change the data. The spec does not include the theme, so also passthemewhen restoring.- The edit menu offers quick edits. The panel supports more settings, and commands support more still. For changes commands do not support, build a new spec with the authoring API.
Minimal editable chart
import { useRef, useState } from 'react';
import { GraphProvider, useGraphHistoryShortcuts, type Data, type GraphHandle, type Spec } from '@graphysdk/react';
import { EditableGraphRenderer } from '@graphysdk/react/editable';