Feature Library

Quiet SVG charts

0.34 CPU ms
A still of the Quiet SVG charts demo
Still
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

0.34 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.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed0.341.02
apple · Apple A19 Proin a browser tab · 16 November 2026not timed1.223.24
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed0.682.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

  1. Dashboards and reports
  2. KPI cards
  3. Finance and P&L views
  4. Before-and-after comparisons
  5. Progress against target
  6. A marker that travels a line to now
  7. Admin panels

Pitfalls, in brief

  1. 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.
  2. 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.
  3. 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.
  4. Import charts.base.css before charts.css: the base keeps strokes from filling black and the hover columns invisible.
  5. 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
  1. inspect() makes the chart focusable (tabindex 0) and owns the arrow keys while it has focus: one tab stop per chart, not per column.
  2. Values reach the SVG as text through esc(); a label you build into the markup yourself (a tooltip) needs escaping too.
  3. Pass motion: 0 to reveal() under prefers-reduced-motion: the marks are then simply there.
  4. 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.
  5. 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).
  6. 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.

svgchartstuftesparklinesrange framewaterfallslope graphbullet graphsmall multiplesoffset-pathaccessibilityno dependencies

Near it in the frame