The live demo starts when it’s in view.Hover or tap a column chart for its figures · Tab to one and use the arrow keys
A Tufte-style chart set as plain functions that return SVG.
What it costs a frame
CPU
0.34 ms
02468101216.7 ms
GPU
not used
CPU, median
0.34 ms
CPU, 95th pct
1.02 ms
Draw calls
0
Weight
Light
Measured 7 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured while the data cycles: every frame redraws one of the eleven panels (SVG strings and innerHTML, without the draw-in, which reads each stroke’s length once when a chart first appears), moving to the next data set after each full pass. Idle, the charts cost nothing a frame. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
not timed
1.22
3.24
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
not timed
0.68
2.17
Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.
What it needs
Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
What it’s for
Dashboards and reports
KPI cards
Finance and P&L views
Before-and-after comparisons
Progress against target
A marker that travels a line to now
Admin panels
Pitfalls, in brief
Each chart is drawn at a pixel size: redraw it when its box changes (a ResizeObserver), rather than scaling the SVG, or text and strokes stretch.
reveal() reads the strokes’ lengths, which forces a layout of the page: after redrawing several charts, reveal them together, and read every host’s size before writing any chart, or each one lays the page out again.
The marks take their colours from classes (pos, negb, negl, netl, inv, acc) styled in charts.css: a class of your own needs its own stroke or fill rule, or it draws in currentColor.
Import charts.base.css before charts.css: the base keeps strokes from filling black and the hover columns invisible.
frameChart keeps right px for the direct labels: on a narrow chart drop it to about 74, or long labels run off the edge.
6 more in brief
inspect() makes the chart focusable (tabindex 0) and owns the arrow keys while it has focus: one tab stop per chart, not per column.
Values reach the SVG as text through esc(); a label you build into the markup yourself (a tooltip) needs escaping too.
Pass motion: 0 to reveal() under prefers-reduced-motion: the marks are then simply there.
A traveller’s offset-path is in the SVG’s own pixels: it lands on the line only while the chart is drawn at its pixel size (as frameChart draws it), and its host must be positioned.
The traveller sits beside the SVG in the host, so replacing the host’s innerHTML removes it: call travel() again after each redraw (stop() the old one first, to end its animation).
A looping traveller never rests: it moves every frame for as long as it shows.
11 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.
Edward Tufte, The Visual Display of Quantitative Information and Beautiful Evidence: Range frames, sparklines, slope graphs, direct labels and the least ink that carries the data: the design ideas, no code.
Stephen Few, Bullet Graph Design Specification (2006): The bullet graph: qualitative bands, the measure as a bar, the target as a tick.
Paul Heckbert, “Nice Numbers for Graph Labels”, Graphics Gems (1990): niceTicks follows the idea of rounding the tick step to 1, 2 or 5 times a power of ten (here with 2.5 added); the code is the owner’s.
Instrument gauges in SVG (a tach with a red line on a nice scale, a speedometer with a best mark, a fuel gauge and an LED ring) whose needles chase their…