Feature Library

Charts with light and motion (engine-free WebGPU)

0.99 CPU ms
A still of the Charts with light and motion (engine-free WebGPU) demo
Still
The live demo starts when it’s in view.Pick a place; turn the dial from calm to wild; in the gallery switch between the luminous and the plain finish; focus a chart and use the arrow keys

The HaTac engine’s chart boards, lifted whole, in its luminous finish: soft pastels on deep ink with the light coming from inside the data.

Thirty kinds (line, area, scatter, heatmap, bar, column, band, error bar, box plot, candlestick, histogram, network, Sankey, treemap, gauge, ring, and fourteen that write their own scales: waterfall, funnel, Pareto, bullet, lollipop, dumbbell, slope, waffle, combo, bubble, calendar, Gantt, timeline, KPI) drawn in raw WebGPU, one instanced draw per board, with pixel-coverage edges and 4× multisampling so every edge is crisp at any pixel ratio. A chart is a JSON recipe of soft values: style.preset 'luminous' gives columns that glow from their value edge, a short local halo, a ring where a reading moved, a crest of light running along a line, comets along every Sankey ribbon and embers off a gauge above a threshold, all on one calm-to-wild dial; the plain finish (lit, bevelled marks under a studio key) is one value away. New figures move every mark from where it was on a spring, with the velocity kept through an interruption; big boards are matched and packed in a worker. Arrow keys walk the marks, picking reads the GPU’s own ids, labels never overlap. Reduced motion keeps the glow and drops the rings, crests and comets. No three.js, no dependencies.

What it costs a frame

0.99 ms
GPU
not used
CPU, median
0.99 ms
CPU, 95th pct
1.50 ms
Draw calls
0
Weight
Moderate

Measured 28 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 158, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 0.95–1.03 ms). What ran: Alone: one luminous board (six named columns on the ink plate, local light, a ring where each reading moved, labels riding the value edges), new figures every 0.75 s so a transition and its rings are always running, 4x multisampled, no bloom or tone curve. CPU is the whole board including submissions; GPU time is not timed by the demo. Phones: tiers are being measured next.

How steadily it runs on RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference

Typical frame ?
16.87 ms
1% low ?
55 fps
Varies by ?
±0.49 ms
All metricsRTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference
p50p95p9916.02 ms18.13 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.87 ms
p95 ?
17.77 ms
p99 ?
18.02 ms
Slowest ?
18.43 ms
Mean ?
16.91 ms
Standard deviation ?
0.49 ms
1% low ?
55 fps
0.1% low ?
54 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 1.2 / 1.6 ms

Input

No input during this run.

Memory

JavaScript heap ?
34.4 → 36.5 MB
Growth ?
+2.10 MB

Browser

JavaScript a frame ?
1.07 ms
All tasks a frame ?
1.55 ms
Layout / style ?
0.00 / 0.00 ms
Main thread busy ?
9%

Garbage collection

Collections ?
7 (7 minor, 0 major)
Pauses ?
6.6 ms in all, longest 1.4

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
NothingNo other packages
With an agent
install("engine-charts")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it up

What it’s for

  1. An instrument wall or control-room screen: dials, rates and flows that glow where the value is and move with the data
  2. A dark dashboard in soft pastels on ink, where each change rings at the bar that moved and every mark springs to its new place
  3. A dashboard whose charts animate between figures instead of redrawing, in the app’s own colours (the plain finish)
  4. A live trace or rate that scrolls with phosphor fade, flaring where it spikes
  5. A Sankey of flows with comets running along each ribbon at its rate
  6. A gauge that smokes and throws embers above a threshold, or bars that shed sparks on a jump
  7. Charts with millions of samples (M4 or LTTB reduction) or a million points, drawn in a fraction of a millisecond
  8. A product or report page where one chart is the hero, calm or wild on one dial

Pitfalls, in brief

  1. The demo needs WebGPU: every board is instanced quads, storage buffers, compute-resolved gauges, particles and an integer pick target, which WebGL 2 cannot draw.
  2. Copy the module with its folders: engine/standalone, engine/contract, engine/modules/ and recipes/ import each other by relative path, and the motion worker loads beside its client by new URL(…, import.meta.url).
  3. style.preset 'luminous' fills only what the recipe leaves out, before validation: the seven pastels (or [colour] when colour is given), ink backdrop #0a0d16, plate #131826 with margin 0.1, text, track and sizePx.
  4. On the standalone host the luminous preset turns bloom, the tone curve and the vignette off (the marks bring their own light); options.post still wins.
  5. The luminous pigment blends against the plate’s colour: lay a board flush in a card by giving style.backdrop and the plate the card’s colour (the demo uses #131826 for both) and write the title in your page.
26 more in brief
  1. Only columns, bars and histograms get the luminous gradient and bright value edge; lines, areas, Sankey ribbons, gauges and dots get their own.
  2. Rings need style.luminous.rippleSeconds above zero (default 0; the bars showpiece uses 0.9).
  3. A line’s travelling crest is style.pulse; on Low the luminous board drops it.
  4. The standalone host fits the bare data domain: set your own window with board.setView(fitChartView(mark, view, aspect)), where aspect is the plot’s after the plate’s border (screenPlateFrame(width, height, plate, headingPx)), and set it again after chart.resize.
  5. The standalone host writes its words in canvas pixels, though text.size and text.readout are given in CSS pixels: at devicePixelRatio 2 a size of 12 prints at 6.
  6. A window you set stays: the board stops easing its bounds to new data.
  7. Lines and scatter dots take sizePx in CSS pixels, extruded after projection, so a dot stays round and a line keeps its width through zoom and resize; nodeWidth is for graph nodes.
  8. Change sparks launch in a cone: spread / speed is the tangent of its half-angle, at the same speed on every ray; zero spread fires them straight.
  9. The standalone host multisamples (4 colour and depth samples on High and Medium, 1 on Low; options.samples picks) and resolves before bloom.
  10. Change lamps are quiet by default (emitter-coloured, 0.16 of the flash, gone in 0.2 s, nothing cast on the plate) and focus outlines the selected mark.
  11. A KPI board takes one unit (style.text.unit) for every tile: put tiles with different units (money, a count, a share, days) on boards of their own.
  12. A palette’s first colour wins over colour: give a single-colour area or line its colour as palette: [colour] (the luminous preset does this when colour is set).
  13. A network given no layout state is laid out with 12 force steps, which leaves a small graph tangled.
  14. Draw only when needed: board.needsFrame() is true while marks move, rings live, crests run, particles live or a trace scrolls.
  15. Each standalone board makes its own targets, post pass and pipelines, and compiles them when created (a second or more for a new kind while the GPU is busy).
  16. The board makes the canvas focusable and appends an output element for the focused mark’s reading, styled inline (position fixed, dark).
  17. style.material, style.finish and plate.material need a baked material set (options.materials), which the copy does not include: without it the board throws “Chart needs material layer”.
  18. Effect presets come from your side: the luminous gauge’s embers need pastel-ember (and the plain furnace ember and rising-smoke) built with buildEffect(effectKind.parse(json)) and passed in effectResources.presets, or attaching throws.
  19. Keep an item’s part count fixed across data where you can (a zero-length stroke stays a quad): motion matches an item’s parts by order.
  20. Supply stable ids (seriesData[].ids, graph.nodeIds, graph.linkIds) when rows reorder, or a highlight, its ring and its velocity jump to another item.
  21. Submit each observation once (setData at its simulation time).
  22. Use one clock for the board and your pushes: an epoch timestamp on a seconds-since-start board puts a trace outside its window.
  23. Picking reads device pixels: convert pointer CSS pixels by devicePixelRatio, and prefer a small region around the pointer (a full-frame copy is about 16 MiB at 1080p).
  24. Plain finish: don’t glow a whole mark brightly (emission much above the lit colour over a large area blooms into a haze over the labels); keep core low and let rims and crests carry the light, and keep ribbon bodies darker than their sparks.
  25. Don’t blend complementary Sankey colours (blue into orange): the middle turns muddy grey.
  26. Kinds that write their own scale (waterfall to KPI) refuse needle, ticks and trace, and draw in a frame 1.6 wide and 1 high that keeps its shape: give their canvas about that shape.
31 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Hannes Andersson: The HaTac engine’s chart boards, looks, motion, effects and standalone host, their tests and measurements; the demo written for the library.

Sveinn Steinarsson: LTTB (Largest-Triangle-Three-Buckets) line reduction, “Downsampling Time Series for Visual Representation” (2013), implemented in the module’s math.

Uwe Jugel et al.: M4 line reduction (“M4: A Visualization-Oriented Time Series Data Aggregation”, VLDB 2014), implemented in the module’s math.

chartsdata visualisationraw webgpuwgslinstancedgpu chartsrecipesjsonluminouspastelglowripplechange ringscometscrestmultisamplingmsaacrisp edgeslineareascatterheatmapbarcolumn

Near it in the frame