Skip to main content
GraphProvider is the root component that wraps your graphs and provides configuration, theming and state management.

Basic usage

Props

children
React.ReactNode
Components to render within the provider. Typically includes Graph and optionally editor components.
config
GraphConfig
The graph configuration object. See GraphConfig schema for all available options.
onChange
function
Callback invoked when the graph configuration changes (typically from editor interactions).Signature: (changedValues: Partial<GraphConfig>, currentValues: GraphConfig) => void
  • changedValues - Only the properties that changed
  • currentValues - The complete updated configuration
theme
GraphTheme
Custom theme for the graph. See GraphTheme reference for all available properties. Defaults to graphyLightTheme if not provided.
fontList
FontList
Array of custom fonts available for use in graphs. Each font definition includes an id, label and fontFamily. See Fonts for usage details.
customPalettes
CustomPaletteCatalog
Array of custom color palettes available for graphs. Each palette includes an id, name and array of colors. See Custom color palettes for usage details.
uiLocale
Locale
Locale for UI text (editor labels, buttons, etc.). Accepts 'en-GB' or 'en-US'. Defaults to 'en-US'.
formattingLocale
Locale
Locale for formatting numbers and dates in the UI. Accepts 'en-GB' or 'en-US'. Defaults to 'en-US'.
This is different from data._metadata.parsingLocale, which controls how data is parsed. This prop controls how values are displayed in the editor UI.
canvasColorToVariableName
CanvasColorToVariableName
Advanced: Maps canvas color IDs to CSS variable names for custom styling.
i18nOverrides
object
Advanced: Override specific translation strings in the UI. Use this to customize text labels in the editor.Type: Partial<Record<TranslationKey, OverridePhrase<TranslationKey>>>

Complete example

Type definitions