CASOON Open Source
Accessible charts, compiled at build time.
chartlet turns a small JSON specification into plain SVG or an HTML figure with caption, source and data table. No chart JavaScript, no hydration, no layout shift – and the same bytes on every build.
cargo install chartlet --version 0.1.0-alpha.3npm install @casoon/chartlet@alpha- bytes of chart JavaScript in the browser
- 0
- example charts, also the golden-file test inputs
- 10
- minimum contrast of every series colour on white
- 4.5:1
- series per chart, up to 100 categories
- 4
What it does
Accessible by default
Every chart carries a title and a description generated from the data, and the HTML output always includes the complete data as a table.
Deterministic
The same specification produces the same bytes, so charts can be reviewed, diffed and cached like any other build artifact.
Honest about problems
Invalid input is rejected with a code, a path and a fix. Shortened labels and omitted value labels are reported as warnings instead of happening silently.
Interaction without JavaScript
Series filters and pre-rendered zoom steps use native controls and CSS; every mark has a native tooltip.
Generated at build time
All examples →Source: Example data
Show chart data
| Category | Value |
|---|---|
| January | 1200 |
| February | 1460 |
| March | 1390 |
| April | Missing |
| May | 1810 |
| June | 2050 |
Every chart on this site is rendered by chartlet during the build, from the same specifications the test suite uses.
examples/monthly-trend.jsonQuickstart
From a specification to a finished chart. The full walkthrough lives in the documentation.
- Install the CLI, or the Astro package together with the CLI.
- Describe the chart in a small JSON specification.
- Render it with
chartlet renderor the<Chart>component.
{
"schemaVersion": 1,
"type": "bar",
"title": "Monthly revenue",
"data": [
{ "label": "January", "value": 120 },
{ "label": "February", "value": 180 },
{ "label": "March", "value": 150 }
]
}chartlet render spec.json --format html -o chart.html---
import Chart from '@casoon/chartlet/astro';
import revenue from '../data/monthly-revenue.json';
---
<Chart id="monthly-revenue" spec={revenue} />