// SLIDE 01 — HOOK

TREEMAP

Technology and life sciences dominate global R&D — but the subcategory breakdown reveals where the real concentration li

Treemap — Figure 75.1 — Technology and life sciences dominate
NARRATION

Technology and life sciences dominate global R and D , but the subcategory breakdown reveals where the real concentration lies Figure 75.1 , Technology and life sciences dominate

// SLIDE 02 — WHAT THIS CHART IS

WHAT THIS CHART IS.

A Treemap encodes a hierarchical dataset as nested rectangles. At the top level, each parent category receives a rectang

What this chart is — The perceptual mechanism is area comparison . Viewers can rapidly identify which cells are largest and which are smalles
NARRATION

A Treemap encodes a hierarchical dataset as nested rectangles. At the top level, each parent category receives a rectangle whose area is proportional to its total value. Within each parent rectangle, child categories are drawn as smaller nested rectangles, again with area proportional to value. The entire chart area is divided exactly , there is no wasted space, and every pixel of area represents real data. The perceptual mechanism is area comparison .

// SLIDE 03 — WHY THE SQUARIFIED ALGORITHM

WHY THE SQUARIFIED ALGORITHM.

Early treemap algorithms used simple recursive slicing: divide the remaining area horizontally, then vertically, alterna

Why the squarified algorithm — The squarified algorithm (Bruls, Huizing, van Wijk, 1999) specifically minimises the aspect ratio of each cell, keeping
NARRATION

Early treemap algorithms used simple recursive slicing: divide the remaining area horizontally, then vertically, alternating on each level. This produces cells with extreme aspect ratios , thin slivers many times longer than they are wide. Perceptually, a 200times4 pixel rectangle and a 40times20 pixel rectangle of equal area are extremely difficult to compare because the viewer's eye reads length, not area, when shapes are highly elongated.

// SLIDE 04 — WHY IT WAS CHOSEN HERE

WHY IT WAS CHOSEN HERE.

The message is about relative proportions within a two-level hierarchy: how much does each sector spend, and within each

Why it was chosen here — The treemap encodes both levels simultaneously in a single view, with area as the encoding channel at both levels. The d
NARRATION

The message is about relative proportions within a two-level hierarchy: how much does each sector spend, and within each sector, how is that spend distributed across subcategories? A bar chart could show one level at a time but would require two separate charts and lose the nested relationship. A Sunburst Diagram encodes the same hierarchy as concentric arcs but suffers the angle-comparison problem , arcs in different radial rings have different physical lengths for the same proportional value, introducing a systematic perceptual distortion.

// SLIDE 05 — WHAT THE TREEMAP CANNOT DO CLE

WHAT THE TREEMAP CANNOT DO CLEARLY.

Treemaps do not convey hierarchical depth clearly. In a two-level treemap the nesting is obvious; in a three-or-more-lev

What the treemap cannot do clearly — Treemaps also struggle with values of very different magnitudes: a cell representing 0.1% of the total may be too small
NARRATION

Treemaps do not convey hierarchical depth clearly. In a two-level treemap the nesting is obvious; in a three-or-more-level treemap, the visual boundaries between parent and grandparent become ambiguous. A Tree Diagram or Sunburst Diagram shows the hierarchical structure more explicitly, at the cost of space efficiency and area-comparison accuracy. Treemaps also struggle with values of very different magnitudes: a cell representing 0.1 percent of the total may be too small to label or even see.

// SLIDE 06 — PROMPT

PROMPT

treemap.htmla full HTML page with inline CSS and inline D3 v7 (loaded from The chart should fill the viewport, be responsive on resi
treemap/data.jsonthe data file the chart loads via d3.json("./treemap/data.json"), with a fallback inline literal in the HTML if the fetc
Two-level hierarchical datasetglobal R&D spending (billions USD) by sector and subcategory. 6 parent sectors, 28 leaf subcategories. Values represent
NARRATION

Paste this into Claude Code to generate a working version of this chart, plus its data file. The result will not be a perfect replica , the goal is that the reader can run the prompt, get a chart of this type, and read its source. Generate a complete, self-contained treemap in D3 v7. Two files:

// SLIDE 07 — AI WAYBACK MACHINE

AI WAYBACK MACHINE.

Brian JohnsonRun this:"Treemapping"Now make the prompt better.
NARRATION

The ideas in this chapter didn't appear from nowhere. Brian Johnson co-invented the rectangular treemap with Ben Shneiderman at the University of Maryland in 1991 , collaborating on the recursive slice-and-dice algorithm that turns a hierarchical tree into a space-filling rectangle. The chart became one of the most-cited tools in information visualization. Brian Johnson, circa 1991. AI-generated portrait based on a public domain photograph (Wikimedia Commons).

// SLIDE 08 — THESIS

THE CORE CLAIM.

The ideas in this chapter didn't appear from nowhere. Brian Johnson co-invented the rectangular treemap with Ben Shneide

Brian Johnson, circa 1991. AI-generated portrait based on a public domain photograph (Wikimedia Commons).

NARRATION

The ideas in this chapter didn't appear from nowhere. Brian Johnson co-invented the rectangular treemap with Ben Shneiderman at the University of Maryland in 1991 , collaborating on the recursive slice-and-dice algorithm that turns a hierarchical tree into a space-filling rectangle. The chart became one of the most-cited tools in information visualization. Brian Johnson, circa 1991. AI-generated portrait based on a public domain photograph (Wikimedia Commons).

// SLIDE 09 — CLOSE

ASK THE QUESTION. APPLY THE FRAMEWORK.

WHAT THIS CHART IS//WHY THE SQUARIFIED ALGORI//WHY IT WAS CHOSEN HERE

Brutalist D3 × Claude · Ch.75 · Treemap

NARRATION

That is the framework. Brutalist D3 times Claude, chapter 75: Treemap. The patterns are now in place. Apply them.

01 / 09
Brutalist D3 × Claude · Ch.75 · Nik Bear Brown