Feature Library

Chart suggestions from a sheet

6.01 CPU ms
A still of the Chart suggestions from a sheet demo
Still
The live demo starts when it’s in view.Pick a sample, drop or paste a CSV · pick a suggestion · hover or arrow through the chart · Table shows its numbers

Hand it any table, pasted cells or a CSV, and it reads what each column holds (dates, money, percentages, durations, categories, IDs, free text, yes or no…

What it costs a frame

6.01 ms
GPU
not used
CPU, median
6.01 ms
CPU, 95th pct
12.4 ms
Draw calls
0
Weight
Heavy

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: With bench on, every frame reads the next sample sheet (parse, profile, rank) and draws its next suggestion: the whole pipeline, about 250 to 650 rows a sheet. 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 timed6.0112.4
apple · Apple A19 Proin a browser tab · 16 November 2026not timed7.5913.3
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed12.222.2

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. Import a spreadsheet and show it at once
  2. A "suggest a chart" button
  3. Dashboards built from whatever a person pastes
  4. Reports from CSV exports
  5. Reading a sheet’s columns before mapping them
  6. Picking a period for a time chart

Pitfalls, in brief

  1. A date like 3/4/2026 is read one way for the whole column: day first unless a cell shows otherwise (a second number over 12), so a US export with only early days reads as day first.
  2. readDate gives a week written without a year ("week 42") the current year: pass the year in the cell, or the profile changes with the calendar.
  3. Dates are UTC milliseconds throughout: format them with getUTC… (or the module’s periodLabels and dayWords), never local getters, or a day slips at midnight.
  4. Rows that repeat are combined by each column’s how: money and counts added up; percentages, durations, yes-or-no and levels (°C, scores, ratings) averaged.
  5. Learn from picks, not from browsing: if arrowing through the suggestions picks each one (a radio group), every chart passed on the way gets the extra weight.
5 more in brief
  1. The confidences are rules of thumb, not probabilities: compare suggestions with each other, and when ambiguous is set, offer both readings rather than picking for the person.
  2. Draw each chart at the size it is shown and redraw when that changes (a ResizeObserver): labels are fitted to pixels, so a scaled SVG stretches text and hairlines.
  3. Import sheet-chart.base.css before sheet-chart.css.
  4. Everything a person wrote (headers, cells, file names) reaches the SVG and the table through esc(): escape it too if you build markup of your own from a profile.
  5. Big sheets: profiling is linear in cells, but a time chart groups every row.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From SpaciousPro. Fully custom code.

Bruls, Huizing and van Wijk, “Squarified Treemaps” (2000): draw.ts squarify() lays rows along the shorter side while they make the worst aspect ratio better; the code is written for the library.

Paul Heckbert, “Nice Numbers for Graph Labels”, Graphics Gems (1990): niceTicks rounds the tick step to 1, 2, 2.5 or 5 times a power of ten: the idea, not his code.

WAI-ARIA Authoring Practices Guide (W3C): The radio group pattern for the samples and the period picker in the demo, the listbox pattern for the suggestions (selection does not follow focus: arrows move, Enter or Space picks); a chart as one Tab stop read with the arrow keys.

George Marsaglia, “Xorshift RNGs” (2003): The demo’s seeded generator for its invented sample sheets.

chartschart suggestionscsvpastecolumn profilingtype detectionunitsdatesaggregationtime seriesganttfunnelsvgaccessibilityenglish and swedishno dependencies

Near it in the frame