Quick start¶
This page draws a first chart from a CSV file, inspects the plan, commits it, and revises its presentation.
Before you start¶
- Charts is installed and configured, as Installation describes.
- The workspace has a small file. This page uses
data/revenue.csv:
Draw a chart¶
Charts recommends a typed recipe document for the 14 standard chart types. A line chart from two columns:
{
"document": {
"version": 1,
"chart": {
"kind": "recipe",
"recipe": "line",
"data": { "path": "data/revenue.csv" },
"bindings": { "x": "month", "y": "revenue_eur", "series": "region" },
"options": { "xType": "temporal", "aggregate": "sum", "yTitle": "Revenue (€)" }
},
"title": "Revenue by month and region"
},
"name": "revenue-by-region"
}
Pass that to tools.charts.plan_quick. The plan writes nothing. It answers a planId, the files the commit will write, and the changes it will make:
{ "planId": "…", "method": "quick", "output": { "files": { "svg": "outputs/charts/revenue-by-region-…/revenue-by-region.svg", "png": "…" } }, "changes": [] }
Then commit it with the plan's id:
Pass that to tools.charts.quick. A recipe call saves an editable <name>.chart.json beside the pictures, in a new folder under outputs/charts/. The result names the written files and the document's revision.
Inspect the result¶
The plan's output.files names every file the commit writes, and output.summary says what was drawn. For the full check without writing anything, call tools.charts.validate with the same input: it answers valid and, when a check fails, the issue, its JSON path and one next step.
The result also carries the figure tree, the requested and actual size, and the interactions each format carries. The PNG under outputs/charts/ is the file a person opens or shows inline.
Revise the presentation¶
A saved chart can change its theme, size, title, alt text or interactions without reading its data again. Pass the document's path, the revision the call returned, and a patch:
{
"documentPath": "outputs/charts/revenue-by-region-…/revenue-by-region.chart.json",
"expectedRevision": "sha256:…",
"patch": { "title": "Revenue by month and region, 2026", "appearance": { "theme": "dark" } }
}
Pass that to tools.charts.plan_update, inspect its files, then tools.charts.update with the plan id. A stale or edited revision is DOCUMENT_REVISION_MISMATCH before anything is drawn. A change of data or meaning is a new document, not an update.
Choose another shape¶
- Charts: every family in the catalogue, and any chart outside the 14 recipes.
- Chart documents: the full document schema, recipes and saved artifacts.
- Tables: publication tables with inline nanoplots.
- Diagrams: Mermaid and structured diagrams.
- Boards: cross-filtered dashboards.