Skip to main content
The builders you’ve met so far — createSpec, pipe, geom.*, scale.*, config — are convenience, not substance. Everything they produce is a plain, immutable object made only of objects, arrays, strings, numbers and booleans. A spec holds no functions, no class instances, no DOM references. That means it round-trips through JSON.stringify / JSON.parse unchanged: you can store a spec in a database, send it over the wire, generate it from another language, or write one by hand.

The builder is just sugar

pipe(...) and the geom.* / scale.* / config helpers just assemble and merge a plain object. This call:
produces exactly this object — and JSON.stringify(spec) gives you exactly this JSON (unset fields drop out):
You could paste that JSON into your source and feed it straight to the renderer with no builder in sight. What the builders add is types, defaults and guardrails — autocomplete for aesthetics and params, sensible fallbacks, and a compile-time check that the shape is valid.

Next

  • How a chart is built — the compile → render pipeline that consumes a spec
  • Data structure — the table a spec references by column name
  • Extending — custom geoms, stats and transforms, and the plugins they ship in