GraphProvider is the root component that wraps your graphs and provides configuration, theming and state management.
Basic usage
Props
Components to render within the provider. Typically includes
Graph and optionally editor components.The graph configuration object. See GraphConfig schema for all available options.
Callback invoked when the graph configuration changes (typically from editor interactions).Signature:
(changedValues: Partial<GraphConfig>, currentValues: GraphConfig) => voidchangedValues- Only the properties that changedcurrentValues- The complete updated configuration
Custom theme for the graph. See GraphTheme reference for all available properties.Defaults to
graphyThemeLight if not provided.Array of custom fonts available for use in graphs. Each font definition includes an
id, label and fontFamily.See Fonts for usage details.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.Locale for UI text (editor labels, buttons, etc.). Accepts
'en-GB' or 'en-US'.Defaults to 'en-US'.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.Advanced: Maps canvas color IDs to CSS variable names for custom styling.
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
Related
- Graph - Chart rendering component
- EditorProvider - Editor state management