Spec anatomy

The schema is https://chartkit.dev/schema/v1.json. validate() checks the schema and the data. render() does not validate. Unknown types return an error SVG and do not throw.

spec.json200 · valid

Open the playground to edit a spec with validate, repair, and export.

Required

version is "1". type names the chart. a11y.alt is one sentence. data is an array of rows, or { "columns": { "field": [] } } when the table is wide. It is not { "values": [] }.

Mark and metric

mark is an options object: curve, points, area, sampling, stack. It is not a string, and it is not mark.markers or mark.fill. Gauge, kpi, and progress-ring use metric for the number.

Repair

validate() checks the schema and the data. render() does not. Unknown types return an error SVG and do not throw. repair() applies the safe JSON Patch and does not mutate the input.