the standard library
nika:chart
Render a DETERMINISTIC chart artifact from rows + a semantic spec (bar | line | area_band | scatter | heatmap) — byte-identical SVG saved at `out`, sha256 in outputs (the trace-chain receipt) · optional Vega-Lite sibling via compile_to. Pure compute + one permit-gated write: no network, no clock, re-runs are idempotent. One of 28 builtins in the closed nika: namespace.
the media familyimages, audio, charts: assets, not blobs
- mediafamily4 tools
- 5argsdeclared contract
- 3requiredcheck teaches a miss
- craftedusage filecheck-green below
the contract
5 args · 3 requiredA missing required arg is a nika check finding before anything runs; the vocabulary below comes from the binary itself (nika catalog --tools --json), not from prose.
- data*
stringrows · array of flat objects (strings + numbers) · or { path: <json file> }- semantics
objectfield → usd | duration_ms | tokens | count | delta | percent | timestamp | category (drives formatting + palettes · delta ⇒ diverging anchored 0)- chart*
object{ type, x, y, y_lo?, y_hi? (area_band bounds), y2? (actual overlay), color? (series split · heatmap value), title?, width?, height? } — x/y/… are field names- out*
stringartifact path ending .svg (fs-permit gated · parents created · idempotent)- compile_to
stringvega_lite — also writes the .vl.json sibling next to the svg
in a real file
a complete workflownika: v1workflow: id: runs-per-month description: "rows in, one deterministic svg out — same bytes every run"permits: fs: write: ["./charts/runs.svg"] exec: false tools: ["nika:chart"]tasks: render: invoke: tool: "nika:chart" args: data: - { month: "jan", runs: 41 } - { month: "feb", runs: 57 } - { month: "mar", runs: 64 } chart: { type: bar, x: month, y: runs } out: "./charts/runs.svg"outputs: receipt: ${{ tasks.render.output }}a complete file, nika check green; the drift gate re-validates this copy against the schema on every test run. open it in the playground →
cross-references
ships in skeletons
no skeleton ships it; the crafted file above is the reference.
the check gates
the media family
4 toolsimages, audio, charts: assets, not blobs.
Machines read the same vocabulary at /tools/catalog.json; the contract lives in spec 06 · stdlib. Install and ask the binary itself: nika catalog --tools. Read the spec →