> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# nika:chart

> Usage, declared contract and source links for this Nika builtin.

export const Ecosystem = () => <CardGroup cols={3}>
    <Card title="Documentation" icon="book" href="/introduction">
      Guides, reference contracts and working examples.
    </Card>
    <Card title="Nika Lab" icon="diagram-project" href="https://github.com/supernovae-st/nika-lab">
      Internal workspace and graph projections of the spec, documentation and code.
    </Card>
    <Card title="Language spec" icon="file-contract" href="https://github.com/supernovae-st/nika-spec">
      the nine-key envelope, Apache-2.0. The contract these docs explain.
    </Card>
    <Card title="Engine source" icon="gem" href="https://github.com/supernovae-st/nika">
      Rust, AGPL-3.0-or-later. Every commit public.
    </Card>
    <Card title="TypeScript SDK" icon="code" href="/sdk/overview">
      Use one typed lifecycle locally or against authenticated nika serve HTTP.
    </Card>
    <Card title="Editor extension" icon="puzzle-piece" href="https://marketplace.visualstudio.com/items?itemName=supernovae.nika-lang">
      VS Code · Cursor · Windsurf: check-as-you-type, DAG view, trace replay.
    </Card>
    <Card title="Homebrew tap" icon="beer-mug-empty" href="https://github.com/supernovae-st/homebrew-tap">
      `brew install supernovae-st/tap/nika` for the latest tagged CLI release.
    </Card>
    <Card title="SuperNovae" icon="star" href="https://supernovae.studio">
      The Paris studio crafting Nika. 🦋
    </Card>
  </CardGroup>;

[Builtins catalog](/reference/builtins) / `nika:chart`

<CardGroup cols={2}>
  <Card title="Media" icon="layer-group">Tool family from the canonical registry.</Card>
  <Card title="invoke" icon="code" href="/reference/language/words/invoke">Call this builtin through the invoke verb.</Card>
</CardGroup>

## Read this contract

This reference preserves the specification at the revision linked below. Source examples are **fragments**: their surrounding tasks, inputs and permissions are not supplied here. Consult [engine status](/reference/status) and `nika catalog --tools --json` for the installed implementation; a registry declaration is not a runtime qualification.

## Usage and behavior

```yaml illustration theme={"system"}
invoke:
  tool: "nika:chart"
  args:
    data: "${{ steps.metrics.output }}"   # rows · array of flat objects (strings + numbers) · or { path: <json file> }
    semantics: { period: timestamp, cost: usd, provider: category }
    chart:
      type: line                          # bar | line | area_band | scatter | heatmap (closed)
      x: period                           # field names · y_lo/y_hi = area_band bounds · y2 = actual overlay
      y: cost                             # color = series split (heatmap: the value field)
      title: "Cost over time"
    out: report/cost-over-time.svg        # .svg REQUIRED — SVG is the attestation surface
    compile_to: vega_lite                 # optional · also writes the .vl.json sibling
```

Pure compute + ONE permit-gated write (`out:` rides `permits.fs.write` ·
a `data.path` source rides `permits.fs.read`). No network, no clock, no
keys — identical `(spec, data)` produce **byte-identical SVG** on every
platform, re-runs are idempotent (hash-equal artifacts are never
rewritten), and `outputs:` carries the receipts: `path · sha256 ·
data_sha256 · width · height · bytes · wrote · warnings`.

The semantic map drives presentation (`usd` money grain · `duration_ms`
humanized · `tokens` k/M · `delta` ⇒ diverging palette anchored at 0 ·
`percent` · `timestamp` · `count` · `category` — closed set). Encoding
honesty is built in: bars always anchor zero · **predictions are dashed,
observations solid** (area\_band) · decimation (LTTB) keeps extremes and
warns — the DATA hash still covers every row.

Errors are `NIKA-BUILTIN-CHART-001..008` (001 empty data · 002 unknown
field · 003 non-finite · 004 invalid spec/closed-enum · 005 domain
collapsed · 006 type mismatch · 007 too many points · 008 I/O).

## Related concepts

<CardGroup cols={2}>
  <Card title="Arguments" icon="sliders" href="/reference/language/words/args">Pass the values required by the tool contract.</Card>
  <Card title="Permissions" icon="shield" href="/concepts/security">Understand authority before granting effects.</Card>
  <Card title="Errors and recovery" icon="rotate" href="/reference/error-codes">Read diagnostics and choose a recovery policy.</Card>
  <Card title="Workflow templates" icon="file-code" href="/guides/templates">Put the fragment inside a complete workflow.</Card>
</CardGroup>

## Contract provenance

[Read the pinned specification](https://github.com/supernovae-st/nika-spec/blob/f8c5df2127c7867b2e51a2cd5712fa9d8461e73e/stdlib/builtins-v0.1.md#L497) · [Canonical registry](https://github.com/supernovae-st/nika-spec/blob/f8c5df2127c7867b2e51a2cd5712fa9d8461e73e/canon/builtins.yaml).

Tool identity: `nika:chart`. Specification revision: `f8c5df2127c7`.
The Lab language identity is `language:tool:chart`; the registry view is `ecosystem:tool/nika:chart`. They refer to this contract without merging their graph identities.

<Ecosystem />
