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:
JSON.stringify(spec) gives you exactly this JSON (unset fields drop out):
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
pluginsthey ship in

