Skip to main content
Start with @graphysdk/react. One package builds the spec and renders the chart. The “Made with Graphy” mark is on by default.

1. Install the package

What the install expects from your project:
  • React 19 — react@^19.0.0 is a peer of the package.
  • Nothing else for a read-only chart — the editing surface’s rich-text editor is an optional peer, so a chart you only paint pulls in no @tiptap/* package. See Editing.
  • moduleResolution: "bundler" (or node16 / nodenext) in your tsconfig.json — the packages ship an exports map, which moduleResolution: "node" skips.
  • A bundler that processes CSS imports from node_modules — Vite, Next.js and webpack with css-loader all do. There is no stylesheet to import: each entry point imports its own CSS file.
  • A client component — the components use the DOM. In the Next.js app router, put 'use client' at the top of the file that renders them.

2. Render your first chart

A chart needs three things: your data, a spec that says how to draw it, and the React components that paint it. All come from @graphysdk/react.
GraphRenderer fills its parent, so the parent needs a height. A container with no height paints nothing and logs ZERO_SIZE_CONTAINER once. Build the spec once or memoize it: a new spec object recompiles the chart.

3. Customize the chart

The chart’s chrome — titles, axes, legend, layout — lives in config. Pipe a config(...) item onto the spec:

4. Restyle it

Paint — colors, stroke widths, corner rounding, fonts — lives in a stylesheet on the spec. Pipe a styles(...) item in the same way. Redefining a built-in token restyles every default that reads it; a style.* entry targets one thing:
The stylesheet sits on the spec, so it serializes and travels with the chart. See Styling for every target and the cascade that resolves them.

5. Color scheme and locale

GraphProvider accepts a colorScheme ('light' or 'dark', defaulting to 'light') and a formattingLocale ('en-GB', 'en-US', 'pt-PT' or 'ar') for number, date and currency formatting:
The provider’s other props:
  • theme — a theme that sits under the spec’s own styles and config. A theme’s colorScheme overrides the prop.
  • plugins — custom geoms, stats and transforms. See Extending.
  • onError, onWarnings — called with a compile’s errors or warnings. Both also go to the console, and a failed compile shows its errors in place of the chart.
  • onSpecChange, handleRef — for editing and driving the chart from outside the tree. See Provider and renderer.
theme and plugins are read once at mount; change the React key to swap them. data, spec and colorScheme recompile on every change. GraphRenderer has props of its own:
  • sizing — how the chart takes space. responsive (the default) fills its container; fixed takes a width and height; keepAspectRatio scales to the container width from intrinsicWidth and intrinsicHeight, or either one plus an aspectRatio.
  • onResize — called with the container size whenever it changes, in every sizing mode.
  • animation — true by default. false turns off the intro and the data transitions. An object { intro, transitions, maxAnimatedGeoms } tunes each; intro takes enabled, trigger ('mount' or 'inView'), durationScale, stagger and staggerOrder. A reduced-motion preference turns animation off regardless, as does a chart with more than maxAnimatedGeoms geoms (default 1500).
  • showTooltips — true by default. false hides the tooltip whatever config.tooltip says.
  • mode — 'readonly' (the default), 'editable' or 'point-and-edit'. The editing modes need EditableGraphRenderer from @graphysdk/react/editable.
  • slots — per-region component overrides. See Slots.

Editing

@graphysdk/react/editable exports EditableGraphRenderer. It mounts inside the GraphProvider from the main entry and adds a rich-text editor over the chart’s title, caption and text annotations. The editor is built on TipTap v3. Those packages are optional peers, so a read-only install skips them. Add them yourself when you import this entry:

Using the engine and renderer separately

@graphysdk/react-renderer exports the same GraphProvider and GraphRenderer with the mark off by default. @graphysdk/viz-engine holds the builders and the compiler, with no React. Import them directly when you want the mark off or you are not in React:
A spec that sets config.content.brandMark.enabled keeps that setting in every package.

Next steps