What you'll get
- Layout
- Grid
Instructions
What your AI reads before it draws a board with this skill.
- name
- visual-explainer
- description
- Use when someone wants to visualize data or explain something complex: a chart, graph, infographic, report, data story, timeline, comparison, explainer, calculator or simulation. Builds live HTML pages on the board with big numbers, photos, notes and charts beside them.
Visual explainer
A row of live HTML pages, each in its own frame with a column of the board's own blocks beside it: big numbers, photos, sticky notes, a chart. The pages carry what HTML is good at (real typography, charts you can hover, anything interactive). The blocks carry what should be read from across the room.
People first see the whole board at about a fifth of its size. Only large type, colour and photos survive that, which is why a script draws the blocks and you never set their sizes.
1. Plan the pages
- 2 to 6 pages, one idea each. The first is a cover: the subject in a few very large words and the one number or picture that sums it up.
- Every later page answers one question with one chart, one picture or one explanation.
- Gather the real numbers, dates, names and photo urls before drawing. Never invent data silently: say "Sample data" on the page when it is.
2. Choose the blocks beside each page
3 or 4 per page, in this order of preference:
stat: the page's headline number in at most 8 characters, with a label of 3 to 9 words. Give it the colour that fits its meaning (redrising or bad,bluefalling or cool,greengood,paperneutral).photo: a real photo of the thing itself, with a caption that credits its source. Give its trueratio(width divided by height). When the result warnsimage_not_copied, the host refused Drawdy's download (Wikimedia does): use another source, such as NASA's image library or a museum's open-access server, and run again.sticky: one per page that has something to try, saying exactly what to do, starting with the click that wakes the page ("Click the page, then hover a bar").atis how far down the page the thing is, from 0 to 1.chart: a small native chart of at most 8 values,kindbarorline, when the page's data has a second cut worth showing.swatches: a colour scale or palette the page uses.text: two or three sentences, only when nothing above fits.
A page beside which you can put only text blocks is a sign the page has no number or picture yet.
3. Draw the board
Call run_board_script with the program below. Edit only BOARD and PAGES. It draws the title, a frame per page and every block, and its log tells you where each page goes. If it reports that a page's blocks are too tall, remove a block.
// EDIT: board data
const BOARD = { title: "146 years of warming in live charts", subtitle: "Live HTML pages laid out like a magazine feature, with native numbers, photos and charts beside each one.", columns: 2, sourcesTitle: "Sources and method", sources: ["Temperature: NASA GISS Surface Temperature Analysis (GISTEMP v4), annual means against the 1951 to 1980 average.", "Carbon dioxide: NOAA Global Monitoring Laboratory, Mauna Loa annual mean for 2025.", "Method: every number is read from those two records, and each chart is SVG drawn inside its page."] };
const PAGES = [
{ name: "The temperature", caption: "Global temperature since 1880. Switch to ten-year averages.", blocks: [
{ stat: "+1.28 °C", label: "2024, the warmest year on record", color: "red" },
{ chart: { kind: "bar", categories: ["1880s", "1900s", "1920s", "1940s", "1960s", "1980s", "2000s", "2016+"], series: [{ name: "Ten-year mean", values: [-0.21, -0.31, -0.24, 0.04, -0.03, 0.25, 0.59, 1.01], color: "#cb181d" }], title: "Ten-year mean, every other decade", unit: " °C" } },
{ sticky: "Switch to Ten-year average", at: 0.25 },
{ swatches: [{ color: "#08306b", label: "-0.6" }, { color: "#2171b5", label: "-0.15" }, { color: "#c6dbef", label: "0.17" }, { color: "#fcbba1", label: "0.44" }, { color: "#cb181d", label: "0.75" }, { color: "#67000d", label: "1.2" }], label: "The ramp, in °C" },
] },
{ name: "The cause", caption: "Carbon dioxide at Mauna Loa, month by month.", blocks: [
{ stat: "427 ppm", label: "carbon dioxide in 2025, up 35% since 1959", color: "paper" },
{ photo: "https://images-assets.nasa.gov/image/iss072e421839/iss072e421839~medium.jpg", ratio: 1.7813, caption: "Hawaii and Mauna Loa from orbit. Photo: NASA." },
{ sticky: "Hover a month on the curve", at: 0.6 },
{ title: "Where it is measured", text: "Air sampled 3,400 m up the volcano, far from cities, gives the longest clean record, kept since 1958.", color: "blue" },
] },
];
// END EDIT: do not change anything below
const COLORS = {
red: ["#cb181d", "#ffffff"], "deep-red": ["#67000d", "#ffffff"], orange: ["#e2401b", "#ffffff"],
amber: ["#f59e0b", "#111827"], green: ["#10b981", "#111827"], sky: ["#38bdf8", "#111827"],
blue: ["#2171b5", "#ffffff"], "deep-blue": ["#08306b", "#ffffff"], violet: ["#8b5cf6", "#ffffff"],
pink: ["#ec4899", "#ffffff"], paper: ["#f5f2ea", "#16181d"], ink: ["#16181d", "#f5f2ea"],
};
const KINDS = ["stat", "photo", "sticky", "text", "chart", "swatches"];
const fail = (message) => { throw new Error(message); };
const colorOf = (name = "paper") => Object.keys(COLORS).includes(name) ? COLORS[name] : fail(`Unknown colour "${name}". Use one of: ${Object.keys(COLORS).join(", ")}.`);
const linesIn = (string, perLine) => {
let total = 0;
for (const paragraph of String(string).split("\n")) {
let used = 0, lines = 1;
for (const word of paragraph.split(" ")) {
if (used && used + 1 + word.length > perLine) { lines++; used = word.length; }
else used += (used ? 1 : 0) + word.length;
}
total += lines;
}
return total;
};
const heightOf = (string, width, size, wide = 0.6) => string ? linesIn(string, Math.floor(width / (wide * size))) * 1.4 * size : 0;
const lum = (hex) => {
const [r, g, b] = [1, 3, 5].map((i) => { const v = parseInt(hex.slice(i, i + 2), 16) / 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); });
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
};
const text = (x, y, string, fontSize, extra) => ({ type: "text", x, y, text: string, fontSize, ...extra });
const panel = (x, y, height, name) => {
const fill = colorOf(name)[0], ink = name === "ink";
return { type: "shape", x, y, width: 380, height, fillColor: fill, strokeColor: ink ? "#f5f2ea" : fill, strokeWidth: ink ? 3 : 1, cornerRadius: 20, roughness: 0 };
};
const PW = BOARD.pageWidth ?? 900, PH = BOARD.pageHeight ?? 1228, OX = BOARD.x ?? 0, OY = BOARD.y ?? 0;
let stickies = 0;
const spec = (b, page, index) => {
const where = `Page "${page.name}", block ${index + 1}`;
const kinds = KINDS.filter((k) => b && b[k] !== undefined);
if (kinds.length !== 1) fail(`${where}: use exactly one of ${KINDS.join(", ")}.`);
if (kinds[0] === "stat") {
const ink = colorOf(b.color)[1], head = String(b.stat);
const size = Math.min(Math.floor((0.85 * 340) / (0.6 * head.length)), 150), label = heightOf(b.label, 340, 26), shown = heightOf(b.label, 340, 26, 0.5);
return { tile: true, height: Math.max(220, 60 + 1.2 * size + label), draw: (x, y, h) => {
const top = y + (h - 1.2 * size - 1 - shown) / 2;
return [panel(x, y, h, b.color), text(x + 20, top, head, size, { width: 340, fontFamily: "serif", bold: true, color: ink }),
...(b.label ? [text(x + 20, top + 1.2 * size + 1, b.label, 26, { width: 340, fontFamily: "sans", color: ink })] : [])];
} };
}
if (kinds[0] === "photo") {
if (!(b.ratio > 0)) fail(`${where}: a photo needs a ratio, its width divided by its height.`);
const pic = 380 / b.ratio;
return { height: pic + (b.caption ? 8 + heightOf(b.caption, 380, 24) : 0), draw: (x, y) => [
{ type: "image", x, y, width: 380, height: pic, url: b.photo },
...(b.caption ? [text(x, y + pic + 8, b.caption, 24, { width: 380, fontFamily: "sans" })] : []),
] };
}
if (kinds[0] === "sticky") {
const at = b.at ?? 0.5;
if (!(at >= 0 && at <= 1)) fail(`${where}: at is ${b.at}, but it must be between 0 and 1.`);
const tilt = stickies++ % 2 ? 0.03 : -0.03, height = linesIn(b.sticky, 20) > 2 ? 220 : 160;
return { height, draw: (x, y, h, slot) => [
{ type: "shape", x, y, width: 380, height, fillColor: "#fde047", strokeColor: "#eab308", strokeWidth: 3, cornerRadius: 6, roughness: 1, rotation: tilt, text: b.sticky, fontSize: 30, bold: true, textColor: "#422006" },
{ type: "arrow", from: [x, y + height / 2], to: [slot.x + 8, slot.y + at * PH], color: "#eab308", strokeWidth: 6 },
] };
}
if (kinds[0] === "text") {
const ink = colorOf(b.color)[1], title = heightOf(b.title, 340, 30);
return { height: 48 + title + heightOf(b.text, 340, 24), draw: (x, y, h) => [
panel(x, y, h, b.color),
...(b.title ? [text(x + 24, y + 24, b.title, 30, { width: 340, bold: true, color: ink })] : []),
text(x + 24, y + 24 + title, b.text, 24, { width: 340, fontFamily: "sans", color: ink }),
] };
}
if (kinds[0] === "chart") {
const chart = b.chart || {}, cats = chart.categories;
if (!Array.isArray(cats)) fail(`${where}: the chart needs a categories list.`);
if (cats.length > 8) fail(`${where}: a chart takes at most 8 categories, and this one has ${cats.length}.`);
const long = cats.find((c) => String(c).length > 5);
if (long !== undefined) fail(`${where}: the chart label "${long}" is over 5 characters.`);
return { height: 380, draw: (x, y) => [{ type: "chart", x, y, width: 380, height: 380, ...chart }] };
}
const list = b.swatches;
if (!Array.isArray(list) || list.length < 2 || list.length > 6) fail(`${where}: swatches takes 2 to 6 colours.`);
const hexes = list.map((s) => /^#[0-9a-f]{6}$/i.test(s.color) ? s.color : colorOf(s.color)[0]);
return { height: 34 + 50 * list.length + (b.label ? 10 + heightOf(b.label, 340, 24) : 0), draw: (x, y, h) => [
panel(x, y, h, "paper"),
...list.map((s, i) => ({ type: "shape", x: x + 20, y: y + 20 + 50 * i, width: 340, height: 44, fillColor: hexes[i], strokeColor: hexes[i], roughness: 0, text: s.label, fontSize: 24, bold: true, textColor: lum(hexes[i]) < 0.4 ? "#ffffff" : "#16181d" })),
...(b.label ? [text(x + 20, y + 24 + 50 * list.length, b.label, 24, { width: 340, fontFamily: "sans", color: "#16181d" })] : []),
] };
};
if (!BOARD.title) fail("BOARD.title is required.");
if (!BOARD.subtitle) fail("BOARD.subtitle is required.");
if (!Array.isArray(PAGES) || !PAGES.length) fail("PAGES needs at least one page.");
const columns = BOARD.columns ?? Math.min(3, PAGES.length);
if (!(columns >= 1)) fail("BOARD.columns must be 1 or more.");
const sources = BOARD.sources, srcTitle = BOARD.sourcesTitle ?? "Sources and method";
if (sources !== undefined && (!Array.isArray(sources) || sources.length < 1 || sources.length > 10 || sources.some((l) => typeof l !== "string" || !l.trim()))) fail("BOARD.sources must be a list of 1 to 10 lines, each a non-empty string.");
if (typeof srcTitle !== "string" || !srcTitle.trim()) fail("BOARD.sourcesTitle must be a non-empty string.");
const taken = (name) => { if (board.frames.some((f) => f.name === name)) fail(`Frame "${name}" already exists. Remove it first, or rename the page.`); };
const seen = [];
PAGES.forEach((page, i) => {
if (!page || !page.name) fail(`Page ${i + 1} needs a name.`);
if (seen.includes(page.name)) fail(`The page name "${page.name}" is used twice. Each page needs its own name.`);
seen.push(page.name);
const frameName = `${i + 1}. ${page.name}`;
taken(frameName);
if ((page.blocks || []).length > 6) fail(`Page "${page.name}" has ${page.blocks.length} blocks, and the most is 6.`);
});
const parts = PAGES.map((page) => (page.blocks || []).map((b, i) => spec(b, page, i)));
const frames = [], notes = [], blocks = [], tail = [];
let x = OX, right = OX;
PAGES.forEach((page, i) => {
const specs = parts[i], n = specs.length, wide = n ? PW + 500 : PW + 80;
if (i % columns === 0) x = OX;
const fx = x, fy = OY + 460 + Math.floor(i / columns) * (PH + 260);
x += wide + 40;
right = Math.max(right, fx + wide);
const total = specs.reduce((sum, s) => sum + s.height, 0) + 24 * (n - 1);
if (total > PH + 1e-6) fail(`Page "${page.name}": the blocks are ${Math.ceil(total - PH)} units too tall. Remove one or shorten a label.`);
const tiles = specs.filter((s) => s.tile), grow = tiles.length ? Math.min(80, (PH - total) / tiles.length) : 0;
const gap = n > 1 ? Math.min(72, 24 + (PH - total - grow * tiles.length) / (n - 1)) : 24;
frames.push({ type: "frame", x: fx, y: fy, width: wide, height: PH + 130, name: `${i + 1}. ${page.name}` });
if (page.caption) notes.push(text(fx + 40, fy + 30, page.caption, 28, { width: wide - 80 }));
let y = fy + 90;
specs.forEach((s, bi) => {
const h = s.height + (s.tile ? grow : 0);
const items = s.draw(fx + PW + 80, y, h, { x: fx + 40 + PW, y: fy + 90 });
if (items.length > 1) items.forEach((e) => { e.group = `${i}-${bi}`; });
blocks.push(...items);
y += h + gap;
});
console.log(`Add the page "${page.name}" as an iframe at x ${fx + 40}, y ${fy + 90}, width ${PW}, height ${PH}.`);
});
if (sources) {
let y = OY + 460 + Math.floor((PAGES.length - 1) / columns) * (PH + 260) + PH + 190;
tail.push(text(OX, y, srcTitle, 40, { bold: true }));
y += 70;
sources.forEach((line) => { tail.push(text(OX, y, line, 24, { fontFamily: "sans", width: right - OX })); y += heightOf(line, right - OX, 24) + 16; });
tail.forEach((e) => { e.group = "sources"; });
}
console.log(sources ? "Everything is drawn. Put more notes in the sources list rather than adding frames beside the rows." : `Free space for more frames starts at x ${right + 40}, y ${OY + 460}.`);
return [...frames, text(OX, OY, BOARD.title, 160, { bold: true }), text(OX, OY + 210, BOARD.subtitle, 48, { fontFamily: "sans", width: right - OX }), ...notes, ...blocks, ...tail];
4. Write each page
Each page is one self-contained HTML file, 900 wide and 1228 tall, designed like a magazine page, not a web app. The page gets the whole 1228: the board draws no title bar over it.
- Fixed format:
html, body { height: 100%; margin: 0; overflow: hidden }. Nothing scrolls and nothing is clipped. 56 px margins. - Fonts from Google Fonts with a
<link>in the head: one serif for headlines and text (Newsreader, Fraunces or EB Garamond) and one sans for labels and axes (Inter).display=block. - Paper
#f5f2ea, ink#16181d, one accent. No gradients except in data, no shadows, no rounded cards. - Top to bottom: a folio line (a short publication name you make up and keep on every page, the section, the page number, 11 px capitals over a 1 px rule), a kicker in the accent, a headline of 56 to 132 px that states the finding, a standfirst of 22 to 26 px, then the chart or picture filling the space left, a short text with a drop cap, and a caption naming the source.
- Body text 17 to 19 px, left-aligned, never justified.
- Charts are SVG drawn by the page's own script, with no library: horizontal grid lines only, the unit on the top tick, tabular figures, annotations that name a year and a value. Hovering writes the value into a fixed line above the chart, never a floating tooltip.
- Wrap the page's whole script in
(() => { ... })();. A top-levelconst top(orname,parent,status) clashes with the window's own and stops the script, and the board cannot show that error. - The page is inert until clicked once, so say what to do in a small hint line ("Hover a year").
- No
localStorage, no links that navigate, noalert.
5. Add the pages
One add_elements call per page: an iframe item with the page's html and its name, at the x, y, width and height the script logged for it. Those are board coordinates: give the item no frame.
6. Sources
Give the script BOARD.sources: one line per source or method note, at most ten. It writes them under the pages. Add no frame beside the rows of pages.
Avoid
Small notes and thin arrows around a page, text blocks where a number or a photo would do, more than one sticky per page, and a dashboard of many small charts on one page (one chart per page, large).



