Skip to main content
Chalkboard draws graphs as a teacher draws them on a classroom board: a green-gray board with the smears of a wiped duster in a wooden frame, shapes outlined and shaded in chalk, and handwriting throughout.
Chalkboard ships as its own package, @graphysdk/theme-chalkboard, still on 0.x. A minor release may change its look, so pin a caret range (^0.1.0) to take only patches. Tell us what works and what doesn’t on Discord.

Install

Its peer dependencies are @graphysdk/react and React 19. Pass the theme to createGraphyKit and import its fonts once:
Every graph drawn through kit.GraphProvider takes the theme. The spec is written as usual and names no theme:
Without a kit, pass the theme to the provider instead: <GraphProvider theme={chalkboard}>. The provider reads the theme once, when it mounts. To switch themes, remount the provider, for example with a React key.

What the theme decides

Changing the look of one graph

A spec’s own styles(), scales and config() sit above the theme. This graph keeps the board and draws its groups in white and yellow chalk only:
The theme is drawn for a graph about 600 pixels wide. style.graph({ textScale }) scales its type for a larger or smaller one.

With a geom package

Theme and plugins go to the same kit. A geom package built from the shared shapes, such as the dumbbell, draws its dots as chalk circles too, and takes the theme’s colors, type and axes.

Fonts

fonts.css loads Gochi Hand from Google Fonts. To host the font yourself, leave the import out and load a family named Gochi Hand before the first graph is drawn. The face has one weight.