Skip to main content
Graph is the component that renders the chart. It must be used inside a GraphProvider.

Basic usage

Props

All props are optional.

Mode

mode
'readonly' | 'editor' | 'static'
Shortcut prop for setting sensible defaults for the interactivity and behavior of the graph for common use cases.
When no mode is provided, the graph behaves like readonly by default.

Sizing

sizing
GraphSizing
Controls how the graph responds to its container size. - mode: 'fixed' - graph has a fixed width and height (default) - mode: 'responsive' - graph automatically resizes to fit its parent container - mode: 'keepAspectRatio'
  • graph scales to fit container while maintaining aspect ratio (requires either intrinsic dimensions or aspect ratio)

Error handling

onError
function
Callback invoked when the graph encounters an error. Useful for logging or analytics.Signature: (info: { error: Error, errorInfo: React.ErrorInfo }) => void
errorFallback
React.ComponentType<{ error: Error }>
Component to render when the graph encounters an error. Receives the error as a prop.

Callbacks

onResize
function
Callback invoked when the chart container is resized.Signature: (entries: ResizeObserverEntry[]) => void

Custom rendering

hasBorder
boolean
default:"true"
If false, no border will be shown around the graph (this overrides the border styling set in the GraphConfig).
Custom content to display in the chart footer area.
renderTitle
function
Custom render function for the chart title area.Signature: (props: { isEditable: boolean, titleDocument: JSONContent, onChange: (newTitle: JSONContent) => void }) => React.ReactNode
ref
React.Ref<HTMLDivElement>
Ref to the graph container element.

Advanced props

These props allow fine-grained control over individual behaviors. In most cases, you should use the mode prop instead.
Precedence order: explicit props → modeGraphConfig settings → defaults. For example, showTooltips={false} will override both the mode setting and appearance.showTooltips in your config.
isEditable
boolean
default:"false"
Whether the graph is editable. Changes are handled by the GraphProvider.onChange handler.
showTooltips
boolean
default:"true"
Whether to show tooltips on hover. Overrides the appearance.showTooltips setting in GraphConfig.
showHoverEffects
boolean
default:"true"
Whether to show hover effects (line markers, bar highlighting, etc.).
animateTransitions
boolean
default:"true"
Whether to animate the graph on initial render and when data changes. Overrides the appearance.animateTransitions setting in GraphConfig.
isExplorable
boolean
default:"true"
Whether to allow transient, in-memory interactions for exploring the data. These interactions do not modify the GraphConfig. Currently supports: - Legend toggling — click legend items to temporarily hide/show series

Examples

Responsive dashboard chart

Exportable chart with fixed dimensions

Type definitions

Migrating from older versions

isInteractive prop (removed in 0.0.62)

The isInteractive prop has been replaced by the mode prop.

disableAnimation prop (removed in 0.0.62)

The disableAnimation prop has been replaced by the mode prop or animateTransitions.

isEditable prop

The isEditable prop is still supported but we recommend using mode instead for clarity.