EditorPanel.Root, under the chart’s <GraphProvider>:
defaultExpandedSection identifies it by title. Without that prop, all start closed. Scope CSS to [data-graphy-editor-panel], also exported as PANEL_ROOT_ATTRIBUTE.
The panel works in any renderer mode, including 'readonly'. Set mode="edit" to also enable editing directly on the chart.
Ready-made panels
Two assembled panels accept the same props asEditorPanel.Root:
ElementsPanel: title, subtitle, caption, source and text size.AxesPanel: anAxisSectionfor each ofxandy.
Pick your sections
Sections read the chart from their panel and hide when inapplicable. A fixed list therefore adapts to chart type changes. No props are required except where noted. TextTitleSection,SubtitleSection,CaptionSection— text and visibility. Hiding preserves the text.SourceSection— the source’s name and URL.TextSizeSection— a multiplier for all chart text.
AppearanceSection— frame corner radius and highlight dimming style.AxisSection(requiresaxis="x"oraxis="y") — visibility, title, ticks, label mode, position, direction, scale and domain bounds. Combo charts also offer a y-axis count. Hidden for circular axes and radial axes without a continuous scale.GridSection— a visibility switch per direction, with one shared style and thickness.LegendSection(positions?) — placement, alignment and style.positionslimits choices while retaining the current position.
GraphTypeSection— chart type picker.ComboSection— grouped bars, stacked bars or lines for an existing combo chart.MappingSection— which column feeds each aesthetic.GraphOptionsSection(layerId?) — data labels, percentages, stack totals and band labels. Defaults to the first layer.NumberFormatSection— abbreviation and decimal places for every number in the chart.HeadlineSection— headline metric, comparison, position and size.
BarSection— bar thickness and corner rounding.LineSection— thickness, curve, point visibility, size and shape, fill and missing values. Only with a line or area layer.PointSection— size and shape of standalone points. A line’s companion points useLineSection.PolarSection— inner radius and start angle. Only on a polar chart.
GoalSection— goal line with a visibility toggle. Hidden on polar charts.TrendsAndAveragesSection— trend and average lines. Hidden on polar charts.CalloutsSection— text, arrow, box and difference callouts. Difference callouts require cartesian coordinates.
OverridableSectionProps:
title: heading and identity within the panel. Use distinct titles;defaultExpandedSectionmatches this value.layout:'collapsible'(default),'fixed'(always expanded) or'inline'(control beside the heading).GoalSectionis always collapsible and has nolayoutprop.preview: summary beside a closed section’s heading.MappingSectionhas no default preview.
Outside the provider
To render a panel outside the chart’s provider, pass aGraphHandle. A callback ref stores the handle in state and mounts the panel when it is ready:
handle takes precedence over the surrounding provider. Change it to edit another chart. A section throws if its panel has neither a handle nor a provider.
Your own section
Build a custom section withSection and three hooks:
usePanelGraph()returns the panel’s chart handle.useHandleScene(graph)subscribes to that chart’s scene.useControls()returns the panel’s controls, including your replacements.
{ transient: true } and call graph.commands.commit on onCommit so each drag creates one undo step:
Sectionacceptstitle,layout,preview,onOpenChangeand an optional headeraccessory. Clicking the accessory does not toggle the section.Rowlabels a control, with an optionaliconand a'grid'(side by side) or'stack'layout.EditorPanel.Controls.Liststacks rows;EditorPanel.Controls.Gridplaces controls in two columns.Separatordivides groups of rows.
ToggledSection adds a header switch, as used by GoalSection. It accepts title, checked, onToggle, disabled and preview. Switching on opens it; switching off closes it; opening a feature that is off turns it on. To control expansion programmatically, usePanelExpansion() provides expandSection(title) and collapseAllSections().
Controls
Sections use a shared registry of controls:ToggleGroup, Switch, Slider, RadioGrid, Button, TextField, NumberField, Select, ColorSwatches, CustomColor and FileInput. Replace any control with a component accepting its exported props type, such as SliderControlProps. The built-in controls are also exported.
Use controls to replace controls in one panel:
ControlRegistryProvider to replace controls across panels and edit menus. A panel’s controls prop takes precedence; omitted controls inherit from the surrounding provider or the defaults.
controls object can be inline.
Look and language
The panel inherits the surroundingGraphProvider’s color scheme. With only a handle, it defaults to light. Override this with ThemeProvider, or pass darkTheme or lightTheme as className; all three are exported from @graphysdk/react.
Six CSS custom properties control colors and spacing: --graphy-editor-accent, --graphy-editor-surface, --graphy-editor-text, --graphy-editor-border, --graphy-editor-padding-x and --graphy-editor-padding-y. Set them on :root for all panels and menus, or scope them to a panel:
formattingLocale, falling back to its parsing locale. Wrap the panel in EditorIntlProvider to override the locale or translate phrases:
Panel or menu
Use the edit menu for quick changes to selected elements, and the panel for the full settings range. For example, the menu offers three bar widths; the panel offers a slider. The panel also covers combo chart types, data mapping, number formats, headlines, goals, trends and averages, callouts, text size, frame appearance and source text. Titles, subtitles and captions can be edited inline or in panel fields; the menu toggles their visibility. Both interfaces share one undo history.Related
- Commands & history — the commands sections dispatch, transient runs and
commit() - Custom menus — the edit menu’s rows, controls and translation
- Provider & renderer —
handleRef,colorScheme,formattingLocale

