Use this page to set up flint-chart locally, run the common checks, and find the right extension path when you need to add a new capability.
- Node 18+ (see
packages/flint-js/.nvmrc; runnvm useif you use nvm) - npm 9+ (workspaces)
git clone https://github.com/microsoft/flint-chart
cd flint-chart
npm install # root workspace: packages/flint-js, packages/flint-mcp, siteRun these from the repository root:
| Command | What it does |
|---|---|
npm run typecheck |
Build/typecheck packages/flint-js and typecheck packages/flint-mcp |
npm run test |
Vitest in packages/flint-js and packages/flint-mcp |
npm run build |
Build packages/flint-js and packages/flint-mcp |
npm run site |
Demo site at http://localhost:5274/ |
npm run site:build |
Production build → site/dist/ |
npm run build:mcp |
Build MCP server workspace |
The demo site aliases flint-chart to packages/flint-js/src through Vite, so library edits hot-reload in the gallery and editor without rebuilding dist/.
flint-chart/
├── packages/
│ ├── flint-js/ npm package `flint-chart`
│ │ ├── src/core/ semantics, layout, types
│ │ ├── src/vegalite/ Vega-Lite backend
│ │ ├── src/echarts/ ECharts backend
│ │ ├── src/chartjs/ Chart.js backend
│ │ └── src/test-data/ gallery fixtures
│ ├── flint-py/ Python port preview (PyPI package planned later)
│ └── flint-mcp/ npm package `flint-chart-mcp`
├── site/ landing, gallery, editor, docs browser
├── docs/ architecture + site documentation sources
├── agent-skills/ AI agent skill (SKILL.md)
└── shared/test-data/ JSON fixtures (JS + Python)
- Phase 0 — semantic resolution (
packages/flint-js/src/core/resolve-semantics.ts) - Phase 1 — layout (
packages/flint-js/src/core/compute-layout.ts) - Phase 2 — instantiation (per-backend
assemble.ts+ templates)
For the full flow, see Architecture.
Start with the guide that matches the surface you want to extend:
- Extending chart templates - add a new chart type to an existing backend.
- Extending semantic types - teach Flint a new field meaning that changes formatting, aggregation, scale, or color behavior.
- Extending backends - add a new rendering target that consumes the shared compiler output.
- Smoke tests:
packages/flint-js/tests/smoke.test.ts - Visual coverage: Gallery, driven by
TEST_GENERATORSin test-data - Shared fixtures:
shared/test-data/, consumed by JS and Python tests