Skip to content

feat(highcharts): add Highcharts rendering backend - #140

Open
Sam (learningsam20) wants to merge 1 commit into
microsoft:mainfrom
learningsam20:feat/highcharts-backend
Open

Sam (learningsam20) wants to merge 1 commit into
microsoft:mainfrom
learningsam20:feat/highcharts-backend

Conversation

@learningsam20

@learningsam20 Sam (learningsam20) commented Oct 13, 2026 •

Copy link
Copy Markdown

Closes #141

What

Adds a highcharts backend to flint-js. The same Flint input compiles to a Highcharts option via assembleHighcharts(input) (also exported from the new flint-chart/highcharts subpath). validateChart accepts highcharts, and both the MCP server and the site editor render it. Follows docs/adding-a-backend.md; guide: docs/reference-highcharts.md.

Why

Flint already targets Vega-Lite, ECharts, Chart.js, Plotly, Excel, and Image-Charts. Highcharts is a widely deployed charting library with a mature, serializable option object, so it is a natural additional compile target for hosts that already ship Highcharts. This lets the same Flint semantic input drive a Highcharts render without a new authoring model.

Design / scope

  • Pure and offline. assembleHighcharts builds a plain option object; no network, no crypto, no new runtime dependencies. Highcharts stays a peer dependency and is externalized by the build, the same way the other backends treat their renderers.
  • Reuses the real pipeline. It runs the same Phase 0 semantic resolution and banded-axis overflow filtering as the other backends, then instantiates native Highcharts series.
  • Native series types and axes. Column/bar (column), line, area, pie/doughnut, scatter, histogram, radar (polar), heatmap, waterfall, and sunburst; datetime axes and per-panel faceting (_facet) are honoured.
  • Interactive. A Highcharts interactive renderer is registered, so interaction_spec presets mount: click-highlight dims by series (clicked series stays at full opacity, all others dim), plus the shared legend/navigation presets, using the same admission and warning reporting as the other backends.
  • Partial coverage by design. Templates without a faithful mapping are not emitted; the reference lists exactly what is ported.

Chart types (13)

Scatter, Bar, Grouped Bar, Stacked Bar, Histogram, Line, Area, Pie, Doughnut, Sunburst, Radar, Heatmap, Waterfall.

What changed

  • packages/flint-js/src/highcharts/**: assemble.ts, instantiate-spec.ts, colormap.ts, index.ts, interactive.ts, and templates/ (bar, line, scatter, pie, radar, histogram, heatmap, waterfall, sunburst, utils).
  • packages/flint-js: barrel + package.json exports (./highcharts) + optional peer dependency; tsup external; validate/index.ts registers the backend; interactive/ dispatch; test-data/highcharts-tests.ts; tests.
  • packages/flint-mcp: render/highcharts.ts (renders via the Highcharts CDN), render registry, tools/list.ts, tools/schemas.ts, bundled skill asset.
  • site: HighchartsView.tsx, InteractiveHighchartsView.tsx, supported-backends registry, docs catalog, editor.
  • docs: generated reference-highcharts.md plus README/DEVELOPMENT/overview/architecture/api-reference/adding-* and the agent skill; scripts/gen-chart-reference.ts extended.
  • CHANGELOG.md: added the Highcharts backend entry.

Verification

  • npm run typecheck — clean (flint-js + flint-mcp, including site types).
  • npm run lint — 0 errors (existing warnings only).
  • npm run test — 1679 passed (flint-js, including the 23 new tests/highcharts-backend.test.ts cases and new tests/smoke.test.ts assertions) and 86 passed (flint-mcp).
  • npm run site:build — passes; Highcharts renders in the site gallery and editor.

Acceptance checklist (docs/adding-a-backend.md §6)

  • Bar, line, area, and scatter templates render correctly on standard gallery matrices
  • tests/smoke.test.ts passes for the new assembler
  • npm run typecheck and npm run test pass at repo root
  • At least one dedicated test-data generator exercises backend-specific options (src/test-data/highcharts-tests.ts, registered in TEST_GENERATORS)

Semver

Minor. Adds a backend, a new subpath (flint-chart/highcharts), an MCP render target, and an optional peer dependency. No breaking changes.

Notes

  • Highcharts is pinned to 13.1.1 in site and flint-mcp, and the flint-js peer range is widened to ^11.0.0 || ^12.0.0 || ^13.0.0.
  • flint-mcp does not bundle Highcharts; the MCP renderer loads it from the Highcharts CDN (code.highcharts.com), so the package keeps its dependency footprint.
  • The site build sets NODE_OPTIONS=--max-old-space-size=8192 for vite build. Bundling the full site (now including Highcharts) exceeded Node's ~4 GB default heap during chunk rendering; CI's npm run site:build inherits the setting.

Add assembleHighcharts() as a fifth rendering backend alongside Vega-Lite,
ECharts, Chart.js, and Plotly. The backend reuses the shared core
pipeline (resolveChannelSemantics, computeLayout, filterOverflow) and
diverges only at Phase 2 template instantiation.

13 chart templates: Bar, Grouped Bar, Stacked Bar, Line, Area, Scatter,
Pie, Doughnut, Histogram, Radar, Heatmap, Waterfall, Sunburst.

- highcharts/ assembler, layout application, palette selection
- validateChart integration for the highcharts backend
- MCP render path via headless Chrome (puppeteer-core)
- Site HighchartsView + backend picker entry
- Test-data generators registered in TEST_GENERATORS
- Generated reference doc (docs/reference-highcharts.md)
- Docs: README, DEVELOPMENT, api-reference, adding-a-backend,
  adding-a-chart-template, test_plan, agent skill
@learningsam20

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a support for Highcharts rendering backend

1 participant