From tufte-vdqi
Renders publication-ready data graphics (SVG/HTML) following Tufte's principles: minimal ink, range-frame axes, direct labels, honest proportions. Use for designing or rebuilding charts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tufte-vdqi:tufte-chartThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Render an actual chart file. "Design / build / produce a chart" requests land
assets/tufte-css/LICENSEassets/tufte-css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eotassets/tufte-css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.svgassets/tufte-css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttfassets/tufte-css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woffassets/tufte-css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eotassets/tufte-css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svgassets/tufte-css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttfassets/tufte-css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woffassets/tufte-css/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eotassets/tufte-css/et-book/et-book-roman-line-figures/et-book-roman-line-figures.svgassets/tufte-css/et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttfassets/tufte-css/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woffassets/tufte-css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eotassets/tufte-css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svgassets/tufte-css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttfassets/tufte-css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woffassets/tufte-css/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eotassets/tufte-css/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.svgassets/tufte-css/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttfRender an actual chart file. "Design / build / produce a chart" requests land
here; to fix a cluttered or misleading chart, run tufte-critique first and
rebuild here honoring its remedy tags (B1–B7).
These bake in the principles from references/tufte-principles.md so the chart
never needs cleanup afterwards. Read that file for the full reasoning.
scripts/deflate.py with retrieved CPI) and label the
axis "real ".<script>, no event-handler attributes (onload= etc.),
no javascript: URLs, no <foreignObject>, no SMIL <animate>/<set>.
The four scripts below never emit these; if you hand-build SVG for one of
the "other genres", keep it inert too — wrap_html.py refuses to wrap
anything carrying active content.Before writing any code, check references/tufte-principles.md Part C and
choose Tufte's genre that fits the data shape. The toolkit ships a working
script for the four genres below; for the rest, build the SVG by hand
following Part C's recipe.
| Data shape | Tufte genre (Part C) | Script |
|---|---|---|
| 1 × N over time | C10 time-series | render_line_svg.py |
| K series indexed by a category | C5 small multiples | small_multiples.py |
| Distributions of K groups | C1 quartile plot | quartile_plot.py |
| Bivariate / scatter | C2 range frame (+ optional C3 dot-dash marginals) | range_frame.py |
| Categorical 1-value | C9 white-grid bar / C6 supertable | hand-build SVG |
| ≤20 numbers total | C6 supertable | hand-build HTML/SVG |
| Many variables, geographic | F (Minard / Snow / Cancer Atlas) | hand-build SVG |
If the data is ≤20 numbers, prefer a table (VDQI p.56) — say so to the user before rendering. If forced to graph, use C6 supertable, not pie/bar.
When the critique step flagged a "Multi-render trigger" (data shape with more than one correct Tufte answer), render both alternatives side-by-side in one output, then let the user pick. This is the discipline that prevents quiet defaulting to the obvious genre.
| Data shape | Render BOTH |
|---|---|
| 1 number / single ratio | (a) a one-sentence prose statement with the number inline, and (b) a tiny inline visual — a one-row proportion bar or a small two-color dot square |
| ≤20 numbers | (a) a C6 supertable (with optional table-graphic sparkline column), and (b) a single Tufte chart (C8 + C2 range-frame dot plot, or C9 white-grid bar) |
| Many series of one x | (a) a C5 small-multiples grid, and (b) an overplotted line/dot chart with direct end-labels |
| Distributions across groups | (a) a C1 quartile plot, and (b) a strip plot or histogram |
| Bivariate scatter | (a) a C2 range frame, and (b) the C3 dot-dash variant adding marginals |
For all other data shapes, render one canonical Tufte form (don't manufacture alternatives when one obviously dominates). When emitting both alternatives, state in one sentence why each exists and what to look at in each — the goal is letting the reader see the toolkit's range, not flooding them with near-duplicates.
python3 scripts/render_line_svg.py \
--data '[{"x":2000,"y":12.1},{"x":2023,"y":22.9}]' \
--title "Revenue (real 2023 USD, M)" --series "Revenue" --out chart.svg
(Pass --data-file path.json for larger data. For monetary series, deflate the
values before passing them in.)
Input is a flat list of records keyed by facet, x, and y:
python3 scripts/small_multiples.py \
--data '[{"facet":"NA","x":1,"y":1000},{"facet":"EU","x":1,"y":900}, ...]' \
--facet-key facet --x-key x --y-key y \
--title "Daily active users by region" --cols 3 --out chart.svg
Frames are sorted by total y (descending) unless --order "A,B,C" is passed.
All frames share scales; axis end-labels appear only on the first frame to
avoid repeating ink.
Input is a JSON object mapping group name to list of values:
python3 scripts/quartile_plot.py \
--data '{"Control":[2.3,2.5,...],"TreatmentA":[1.8,2.0,...]}' \
--title "Reaction time (s) by condition" --out chart.svg
The box is erased; what remains is a single vertical stroke per group spanning the full range, the IQR offset horizontally from it, and a median tick.
python3 scripts/range_frame.py \
--data '[{"x":1.2,"y":3.4},{"x":2.1,"y":4.5},...]' \
--title "Body mass vs. wing span" \
[--marginal-dash] --out chart.svg
--marginal-dash adds Tufte's dot-dash plot (VDQI p.133): marginal frequency
dashes along each axis framing the bivariate distribution.
Write the SVG/HTML directly, following Part C's recipe and the build checklist above. Keep it a single self-contained file. A minimal pattern: white canvas, thin dark data marks, range-frame axis lines with end labels, category/series text placed on the marks, no grid/box.
For a page that surrounds the chart with ET Book typography (and optional lede
text or caption), wrap the SVG with scripts/wrap_html.py. It uses the bundled
tufte-css (assets/tufte-css/, MIT-licensed) and copies the stylesheet and
fonts into a sibling tufte-assets/ directory the first time so the result
opens correctly in any browser with no network:
python3 scripts/wrap_html.py \
--svg chart.svg --out chart.html \
--title "Revenue, 2000–2023" \
--caption "Inflation-adjusted to 2023 USD using BLS CPI-U."
Use the SVG output when you need a portable single file (charts in a paper, a
slide deck, another site). Use the HTML wrapper when you want a self-contained,
browser-ready Tufte page (sharing a link, hosting a report). Pass --no-assets
if the page will be served from a site that already publishes tufte.css at
the expected path.
wrap_html inspects every SVG before inlining. If it exits with
ERROR[active-svg], the SVG carries script-bearing content (scripts, event
handlers, animation, external references) — produce inert SVG instead (see
the build checklist); the four bundled scripts always do.
Always save the file and tell the user its path. Where useful, follow up with
tufte-critique to confirm the result scores well.
A file that renders in a browser, carries no chartjunk, labels data directly, uses
honest proportions, and would itself pass a tufte-critique review.
tufte-critique — diagnose a chart and get the remedies to apply here.npx claudepluginhub gnurio/tufte-vdqi-plugin --plugin tufte-vdqiGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.