Features
- 24 chart types in v1:
lineareabarhistogramscatterbubblerangecandlestickohlcboxplotwaterfallheatmapcalendarpiedonutgaugeradialBarradarrosewaffletreemapfunnelprogressstat, plus combos throughlayers. - One flat options object: every option has a default, and
update()morphs between any two configurations, including a change of type. - Configurable tiles: a tile's size is how much of it the shape covers, so edges anti-alias. Tile size
(
cell),gapand corner radius (round) are options, and charts are responsive. - Live data:
push,patchand a scrollingwindow, with tiles springing into place at constant speed. - Fast: one shared WebGL2 context with a Canvas2D fallback, no cost once settled, and M4 decimation so a million points draw interactively. The JS bundle is about 38 KB gzipped.
- Interaction and accessibility built in: tooltips, crosshair, legend toggling, touch, keyboard navigation,
screen-reader summaries and data tables, and
prefers-reduced-motion. - Identical everywhere: the JS and Dart cores reproduce the same conformance fixtures tile for tile, and the Python widget runs the JS core.
Packages
| Package | Where | Install |
|---|---|---|
js/ |
npm craggy-charts: core, WebGL2 + Canvas2D renderers, React, <craggy-chart> |
npm install craggy-charts |
flutter/ |
pub.dev craggy_charts: Dart core and a drawRawAtlas painter (mobile, desktop, web) |
flutter pub add craggy_charts |
python/ |
PyPI craggy-charts: Jupyter widget (anywidget), static HTML, Streamlit |
pip install craggy-charts |
chart('#sales', { type: 'bar', data: sales, x: 'month', stack: true, format: 'currency' })CraggyChart(type: ChartType.bar, data: sales, x: 'month', stack: true, format: 'currency')cc.chart(sales_df, type="bar", x="month", stack=True, format="currency")Examples
The live dashboard above is one HTML file: download the repository, build the JS package and open the file in a browser.
| Example | Shows |
|---|---|
| HTML quickstart | A plain HTML page: one <script> tag and one chart, no build step. |
| Live dashboard | Stats, a gauge, live data with push(), morphing with update(), and events. |
| Web component | <craggy-chart> with options as HTML attributes. |
| Terminal | The headless core in Node, printed to the terminal. |
| Jupyter notebook | Widgets, events back into Python, live data and HTML export. |
| Static report | Three charts in one self-contained HTML file. |
| Streamlit app | Charts with Streamlit controls. |
| Flutter app | A gallery of every type, a live chart and a theme toggle. |
The HTML examples open straight from disk once the JS package is built (cd js && npm install && npm run build).
More detail is in examples/README.md.
Layout
spec/: the options schema and design tokens. These are the single source of truth.spec/generate.mjswrites the TypeScript, Dart and Python definitions anddocs/options.md.conformance/: fixtures and the expected tile field for each one. The JS and Dart cores must both reproduce every field (±1 per channel) and every label.docs/index.html: live gallery of every type, with interaction demos. Serve the repository root and open/docs/index.html.examples/: small runnable examples: a script-tag quickstart, a live dashboard, the web component, the headless core in a terminal, a Jupyter notebook, a static report and a Streamlit app.- The images in this README are rendered at 4K by
npm run galleryinjs/.
Tests
cd js && npm install && npm run build && npm test && npx playwright test
cd flutter && flutter test
cd python && node build.mjs && uv run pytestMIT licence.