Comparatron plan: carry the 2010/2020 Comparotron idea into DataHub stories
Comparatron plan
Summary. The Comparotron idea (2010 McCandless mock, 2020 Open Data Day cards) is right and still unbuilt: one or two numbers and nothing else, set beside each other so one of them changes meaning, shareable as a picture. Today's stack already gives the 2020 MVP for free: a comparatron is a blog short post built with the DataPressr story skill and dh publish -p blog, with its own URL, SVG, card and provenance; two exist in pilot 1. The plan is design-led: first draw the same finding (US aid against military spending) in four treatments, including the 2020 area circles, at phone and card size, with first-screen sketches for four or five candidate pairs, so Rufus chooses by eye; then revise the two existing pieces to that choice and fix only the checker defects the work exposes; then extract a minimal comparison spec from what the examples needed. No new DataHub content type now. One platform fix is worth proposing today: live blog posts emit no og:image, so no card we make appears on a shared link. A ten-piece checkpoint reviews, and does not pre-decide, any publication or backend step.
1. What the old designs were, and why the idea is good
2010, David McCandless for Where Does My Money Go (https://f.cloud.github.com/assets/180658/750549/198722d0-e4d0-11e2-8a57-998f68acfeaf.png). A two-pane page titled "Compare-o-Tron": left, "Choose from your palette", a cloud of grey bubbles with icons (a UK map, people, a house, a car, £ coins); right, "Compare!", two dotted rings holding two filled circles whose area is proportional, labelled HEALTH £82 and WATER £5, each with a conversion line under it (£3.04 per day, £0.60 per day), and a "Randomize" button. Three moves to keep: a palette of trusted numbers to pick from, area circles with the value printed, and the everyday conversion line.
2020, Open Data Day, "v0.2", hand-drawn (live: https://datahub.io/blog/comparotron-a-simple-way-to-visualize-and-share-comparisons/_r/-/comparotron-v0.2-march-2020-military-vs-aid.svg?preview=true and …/comparotron-v0.2-march-2020-coronavirus-vs-flu.svg?preview=true; the post's other two image URLs, under datahub.io/static/img/blog/ and a raw.githubusercontent.com/datahubio/blog/refs/heads/main./ path, return 404). US Spending on Military vs Aid (2019): serif title, italic subtitle, two dark-grey circles, $693b large and $32b small, area-proportional (diameter ratio about 4.5 for a value ratio of 22), labels under each, a source line under each circle, "Created in COMPAROTRON" and the Datopian mark at the foot. Coronavirus vs Flu Mortality Rates: a red 3.4% circle against a small grey 0.1%, the working under each ("3,491 deaths/102,472 cases = 3.4%"), then a block of caveats about ascertainment and age. The repo's data/demo.json is the intended data model: {id, label, value, currency}, two items, nothing more.
The idea (README, 2020): comparotron "is only about comparisons and limits you to just one or two numbers … this constraint is powerful, and fun, and lends itself to quick, creative story-telling"; two flows, create (a markdown file in git) and show (a static page). It is good because it attacks the hardest part of data communication, the abstraction of big numbers ("what does $3bn of aid really mean?"), with the one device readers retain, a ratio against something they already hold; because the constraint keeps the piece inside a three-second read; and because two numbers, one picture and a source is the most shareable unit we can make. The 2020 cards also show what the format gets wrong without rules: the 2019 pair sets Wikipedia's military budget against all US foreign assistance from foreignassistance.gov, which includes military aid (the scope mismatch rule 1 now names), and the flu card hides its honesty in 80 words under the picture. The 2026 spec answers both: one visible fairness line, and anything needing more is fixed or dropped.
2. Decisions
A. Form: short post now; a review at ten pieces
A comparatron is a 150–300-word blog short post in the existing package layout (README.md, SVGs, cards, <slug>-src/), published with dh publish -p blog. It already has a URL per comparison, an image, provenance and the review gate, and it sits on the derivation path (story → "compared with what" → comparatron → card 1) because it uses the same skill and template. datahub-next renders post bodies as MDX with no sanitiser (components/MDX.tsx; getMdxOptions in lib/markdown.ts), so the pilot's <picture> with mobile SVG works today.
At about ten pieces, a review checkpoint, not a promised step: does a browsable collection serve readers; is there an unmet embedding, authoring or maintenance need? Only then consider a compare publication (datahub.io/compare/<slug> via dh publish -p compare; the existing app/[publication]/[post] route serves it with no new code, but creation assigns an owner and checks the slug, republishing makes a second post rather than moving the URL, and the pilot READMEs hard-code /blog/ in their mobile-image URLs, so portability has to be designed), and after that a <Comparatron> MDX component or route, only against a concrete need. Alternatives rejected for now: a new content type first (repeats the 2012 lesson the 2020 README drew: build the skateboard, not the car); a component only (moves rendering out of the byte-pinned, reviewable SVG for no reader gain yet).
B. Data model: a minimal spec extracted from the examples
Each comparatron package will carry <slug>-src/compare.json, written by calculate.mjs and read by make-charts.mjs and story-check, but it is written after phase 2, from what the two examples needed. The 2020 {id, label, value, currency} becomes items[] with, per item: key, label, short, value, unit, kind (flow, stock, share, rate), basis, scope, period {label, start, end, calendar}, role (the temporal role: flow over period, level at start, change over window, stock at date), its own denominator ({text, value?, source?}), and source {name, url, file, retrieved, licence {id, commercial}}. Top level: relation (one sentence saying what is being compared and why the pair is legitimate, which the README's fairness line is rendered from), derived (ratio {num, den, value, text}, time_equivalent, per_person), sensitivity (§D), visual {form, accent}. For cross-country per-head pairs the rule is a consistent population source, not one shared denominator.
Mechanical checks validate arithmetic (ratio and derived lines recompute from values), presence (every item has role, denominator, source.licence; relation and sensitivity.verdict exist) and flag licence.commercial: false; substantive comparability stays with review. The energy piece is the first fixture: item 1 role: level at start, denominator "the all-items basket, September 2025"; item 2 role: change over window, denominator "the all-items 12-month change, 3.7%"; relation: "energy's share of the same CPI-U index, of its basket at the start of the window and of its rise over it, by the BLS contribution method". That is the honest description the current two-row table could not carry, and the reason compare-scope had to be satisfied by making two cells equal. The aid piece is the second fixture: same role both sides, period.calendar differing with a note. The markdown table stays and is generated from the file.
C. Visual forms: four treatments of one finding, chosen by eye
Circles are first-class again: they are the signature of the idea. Phase 1 draws the aid finding four ways at 390 px and 1080×1350 and Rufus chooses:
- Two bars from zero on one baseline (the pilot's form): the gap on one scale, both values in the bar labels.
- Proportional-area circles in the 2020 style, redrawn in the house type and palette: area encodes value, both values printed inside or beside, one foot strip instead of per-side sources.
- 1-against-N grid of squares: one accent square against N grey, with visible labels and both absolutes on the image (a grid without them is an ambiguous screenshot; alt text cannot repair that).
- Time strip: the derived line "the military spends a year of aid in about 11 days" as a 12-month strip with 11 days filled; a candidate card 2, not a replacement for the pair.
Derived lines stay in prose whatever the form: time equivalence whenever both items are annual flows; the 2010 per-person or per-day line when the reader's question is "what do I bear", shown beside the total when they point different ways (rule 2). No ratio cut-offs and no perception claims: the sketches decide, and the 40-word card budget stays as it is; a card that busts it first loses repeated numbers and labels.
D. Making method: extend skills/story
Inside the story skill, because the gates (review, story-check, NOTES/REVIEW records) are shared and most comparatrons arise as a story spin-off (SKILL.md step 4b). After phase 2, add skills/story/references/comparatron.md (anatomy, the spec, the procedures below, the chosen visual forms) and point formats.md at it. Steps, in place of the outline:
- Pair-finding. From one number, list six to eight yardsticks a reader already holds (the same thing elsewhere, before, the budget it sits in, per person or per day, a thing of the same kind people overrate), each with source, scope, basis, period, licence, and a blind guess with an 80% interval from two models (pilot-1's
run-guesses.sh). Rank the fair ones by model gap × stakes, treating the gap as a lead, not audience evidence; Rufus's guess form is the human measure. - Fairness gate, checklist 1–7 of
formats.md, with a bounded sensitivity check in place of a loose reverse test: name the plausible alternative framing most likely to change the finding (for aid: all US foreign assistance against Department of Defense outlays, both FY2025; for energy: gasoline alone; for China/US: consumption-based rather than territorial emissions), compute it from named sources, and record whether the headline stays true and useful. "Not in our data, not quoted" is no longer a pass. Any numeric threshold is a screening heuristic, never the verdict. - Build:
calculate.mjs→compare.jsonandstatistics.json;make-charts.mjsrenders chart, table and cards from it. - Checks:
story-checkwithcompare-scopereadingcompare.json(table fallback), plus only the defects the examples demonstrated: a period note that lets calendar labels differ (fnlto file), fnl.1 (social.sourcefor cards built viachart({social})), fnl.4 (link-card title overflow). fnl.2, 3 and 5 wait for the sketches to show they matter. - Review: the existing editorial review plus the comparatron question ("which comparison would you defend to a sceptic and still repeat?"); the reviewer recomputes the sensitivity alternative from the named sources.
E. Platform work: one verified fix now, the rest as findings
Verified 20 Nov: curl of https://datahub.io/blog/us-inflation-components and of the 2020 Comparotron post returns og:title, og:description, twitter:card=summary_large_image, and no og:image or twitter:image. Source: app/[publication]/[post]/layout.tsx generateMetadata has the images lines commented out, and because Next replaces a parent's openGraph object, the publication and root defaults do not reach posts. So every story and card we have shipped is shared as a text card.
Proposal PR on datahub-next, branch fix/post-og-image: fetch the post's frontmatter metadata for the image independently (the layout's blob fetch runs only when the post lacks a description, line 40), resolve the image to an absolute raw URL (including custom domains), set openGraph.images and twitter.images, fall back to the publication image then the root thumbnail, and test the fallbacks. Decide deliberately whether the social card doubles as the page hero: frontmatter image already sets the story header in app/[publication]/[post]/[[...slug]]/page.tsx (line 94), so a 1200×630 link card would also appear at the top of the post unless a second field is introduced. Not merged by us; opened as a proposal with a before/after.
Other findings that shape the plan: dh publish (cli/cmd/publish.go, runPublish) creates the post once and does not update title or description on re-publish; it uploads every file in the directory except dotfiles and .datahubignore matches; frontmatter is read by the separate Cloudflare worker; the embed route /<pub>/<post>/v/<index> exists only for datapackage posts. No-backend path today: <picture> SVGs and <img> cards in the post, the two-row table in markdown, image: set to the link card once the OG fix lands, links to compare.json and calculate.mjs under "How this was made".
F. Comparethe and the old repo
Comparethe (comparethe.co, Flowershow, CC0, last commit 2 Nov 2026) is a wiki of product comparisons; unrelated beyond the word. Recommend removing the note on factory-but.3.3 that it is "the comparatron format's starting point" and leaving 3.3 as its own P2 question. datopian/comparotron is archived as reference: the 2020 README, demo.json and the two SVGs carry the design intent; nothing else in it is needed.
G. Examples: two kept, a third chosen by sketch
- US aid vs military, 2025 (keep, rework). Compelling because it is the documented misperception (KFF, December 2014: Americans put aid at 26% of the budget; it is about 1%) and news: the ratio went from 15 in 2024 to 33 in 2025 (14–22 across 2018–2024) because aid halved while military spending fell 5%. Rework: compute the sensitivity alternative (ForeignAssistance.gov all US foreign assistance against OMB table 3.2 DoD outlays, both FY2025); prefer the public-domain US fiscal-year pair (OMB function 050 national-defence outlays against ForeignAssistance.gov economic assistance) as the headline if FY2025 data is complete, which also removes the fiscal-against-calendar footnote; SIPRI workbook out of the package (§H); hero treatment per Rufus's phase 1 choice.
- Energy: 6.4% of the US basket, 36% of its inflation (keep). Compelling because it answers the autumn's question, "why is inflation back", in one pair; the largest model-gap score among the comparatron candidates, with the caveat that the question supplied the weight and the answer sat inside Sonnet's interval, so the human gap is unmeasured. Becomes the spec's first fixture (§B); refresh when the November CPI lands in December.
- Third, chosen from first-screen sketches in phase 1: (a) China vs US fossil CO2, 2025 (Global Carbon Budget 2026, CC BY 4.0, data in
releases/china-co2-peak): "China emits 2.5 times as much as the US in total; Americans emit about 65% more per person", the two directions on one image, methods noting that 2025 values are the GCB's latest-year estimates; topical for COP31, model gap only 0.13. (b) Heat vs tornadoes, US 1997–2025, 2.5 times as many deaths (NWS), gap 0.31, public safety; already DataPressr's example card, so it would need a new treatment to earn a post. (c) An everyday-scale pair, proposed: US foreign aid per American, about $85 a year or 23 cents a day in 2025 (ODA ÷ Census population), against one everyday household spend per person from the BLS Consumer Expenditure Survey for the same year (public domain; candidate category chosen in the sketch, the fairness line being "both per person, same year, both annual outlays"). This is the 2010 "£0.60 per day" move applied to the aid number, and the sketch decides whether it reads as tangible or as a gotcha.
Rejected: US vs Germany ODA 2025 (too close to call before the final OECD figures in December; a January pair-finding candidate).
H. SIPRI licence
SIPRI's terms allow non-commercial use with the attribution "Information from the Stockholm International Peace Research Institute (SIPRI), URL", say journalistic and blog uses need no permission unless more than 10% of a dataset is reproduced, and also say that commercial entities' use "as part of ratings, research or statistical content" can count as commercial, assessed case by case; promotional cards sit closest to that line. Being free and unpaywalled does not settle it. Recommend: (1) prefer the public-domain US pair for the aid headline (G1), with SIPRI, if used at all, as an attributed cross-country sentence that is itself inside the same question; (2) if SIPRI figures stay in the piece or on a card, obtain clarification from SIPRI through its contact form covering both the editorial and the promotional use before publishing (human bead); (3) regardless, remove SIPRI-Milex-data-1949-2025_v1.2.xlsx from package/us-aid-vs-military-2025-src/ (it is tracked there now; dh publish would upload the entire database, a plain breach of the 10% limit) and keep its hash in PROVENANCE.md; (4) licence.commercial in compare.json so a non-commercial source is visible at build time. Keep all of this out of reader-facing prose.
3. Phased plan, design-led (for Beads under factory-but.9)
| Phase | What | Repo and branch | Who | Depends on | Done-check |
|---|---|---|---|---|---|
| 1 | Sketches. The aid finding in four treatments (bars, 2020-style area circles, grid, time strip) at 390 px and 1080×1350, house type and palette; first-screen sketches (title, mark, fairness line) for aid, energy, China/US, heat/tornadoes and the everyday pair; one contact sheet | factory, projects/story-formats/sketches/ | Opus subagent with the dataviz skill; main thread assembles the sheet | none | Contact sheet with every treatment at both sizes; Rufus's choice of hero treatment and of the third example recorded in the bead |
| 2 | Revise the two pieces to the chosen treatment: aid with the sensitivity alternative computed and the public-domain FY pair evaluated as headline, SIPRI workbook out; energy with item-level roles and denominators stated; re-review (Opus editor, Codex). Fix alongside only the demonstrated checker defects: period note in compare-scope, fnl.1, fnl.4 | factory pilot-1/*; DataPressr branch comparatron (never main) | Opus subagent builds; Codex reviews | 1 | Both packages story-check PASS with different period labels and a note; REVIEW.md round 3 APPROVED; no SIPRI raw file under package/; aid headline source decided and recorded |
| 3 | Spec. compare.json extracted from the two revised pieces (energy and aid as fixtures), compare-scope reads it, references/comparatron.md written, formats.md points to it | DataPressr branch comparatron | Opus subagent, tests on the fixtures | 2 | Fixtures pass; a fixture with a missing role, relation or sensitivity.verdict fails; example cards byte-identical |
| 4 | Third piece from the chosen sketch, built with the spec, reviewed | factory pilot-1/<slug> | Opus subagent; Codex review | 1, 3 | Package PASS, review APPROVED, compare.json complete |
| 5 | Publish and measure. The 15 Nov hold stays unless Rufus lifts it for these pieces; then one a day through releases/QUEUE.md, a P3 review-after bead each. Measurement, honestly: Rufus's guess form before, next-day retell against the pre-written title sentences with prior familiarity noted; blog pageviews when GA4 access exists; social saves and shares per 1,000 views only if a channel and poster are authorised (human), otherwise recorded as missing evidence, not zero | factory | Main thread | 2, 4, Rufus's yes | Live URLs in publications.csv; retell rows; a note of which signals exist and which do not |
| 6 | OG proposal PR as specified in §E, with a before/after of a shared link; fix the 2020 post's two 404 image URLs and add one paragraph linking the spec and the first live pieces | datahub-next branch fix/post-og-image; factory post dir | Sonnet subagent | none (independent) | PR open; live 2020 post renders all images |
| 7 | Ten-piece review: collection, embedding, authoring and maintenance needs against what was learned; publication or component decided then, with ownership, canonical URLs and asset portability specified if yes | factory doc | Main thread | 5, ten pieces | A written review with the evidence available, including its gaps |
4. Risks and open questions for Rufus
- Treatment and third example (phase 1). Recommended: pick by eye from the sheet; my prior is circles for the hero image and bars for the blog chart, and China/US as the third because of COP31. If no answer, the pilot pair form stays and the everyday pair is sketched further before choosing.
- Aid headline source. Recommended: switch to the public-domain US fiscal-year pair if FY2025 ForeignAssistance data is complete; it removes the period footnote and the SIPRI question together, and a lower, fairer ratio is the format's point. If no answer, both are computed and the review picks; SIPRI stays only with clarification.
- The hold. Recommended: lift it for the three pieces once each passes the revised gate (sensitivity check computed, item-level roles stated, review APPROVED). If no answer, phases 1–4 and 6 proceed and nothing publishes.
5. Critique applied and rejected
Codex (gpt-6-astra) returned ten findings. Applied: the schema now has item-level denominators and temporal roles with a relation sentence, and the energy piece is its first fixture (1); the universal thresholds (half the headline ratio, 75% overlap, which the fiscal/calendar case itself would have failed at 74.8%) are replaced by a bounded sensitivity check with any number as a screening heuristic (2); the sequence is sketches and the two examples first, tooling extracted after, only demonstrated checker defects fixed alongside (3); the SIPRI conclusion no longer claims "no blocker": public-domain pair preferred, otherwise clarification covering promotional use; .datahubignore noted (4); the OG defect is now verified against live HTML and the patch description corrected (independent metadata fetch, absolute URLs, existing twitter.card, the hero-image side effect) (5); aid's history wording fixed (15 to 33, not 14–22 to 33), KFF dated, energy's gap caveated, China/US reworded and demoted to a sketch shortlist with heat/tornadoes and an everyday pair (6); ten pieces is a review checkpoint with the publication-creation specifics named (7); circles are first-class, the cut-off and the perception claim are gone, grids must carry labels and absolutes, repo archiving is cut (8); measurement names its mechanism and treats missing analytics as missing (9); the client-rendering argument, the Flowershow comparison and the effort estimates are cut, and the card word budget is unchanged (10). Rejected in part: keeping the 2020 post's broken images out of scope (a reader-facing 404 on the post that introduces the idea is a five-minute fix, kept in phase 6).