Skip to main content
Comic draws graphs as a panel of a printed comic: newsprint in a black frame, the flat colors of a four-color press under its dots, a black outline and a hard shadow for every shape, and a title in capitals.
Comic ships as its own package, @graphysdk/theme-comic, 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={comic}>. 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 panel and prints its bars flat, with no dots and no shadow:
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

Comic repaints only pies, donuts and points. Every other geom, and a geom from a package such as the dumbbell, keeps its own renderer and takes the theme’s colors, outline, shadow and type.

Fonts

fonts.css loads Bangers for the title and Comic Neue for the rest from Google Fonts. To host the fonts yourself, leave the import out and load families named Bangers and Comic Neue before the first graph is drawn.