A Packed Cartogram of the United States
Every state keeps its exact shape. Only size and position change.
- Guaranteed clearance—
- Collision circles—
- Packing density—
- Solve time—
Packing…
How it is built
A cartogram has to distort something. Diffusion cartograms distort shape until the areas come out right, which makes states hard to recognise and leaves the area itself only approximately correct. This map makes the opposite trade: it refuses to bend a single border, and gives up contiguity instead. States are resized and rearranged, but never reshaped, so shape error and area error are both exactly zero. What is lost is that the states no longer touch, and their relative positions shift.
1. Resize each state
Each state is scaled about its own centroid by a factor that makes its area exactly its share of the total. Uniform scaling, so the shape is preserved precisely:
ki = sqrt( (target area × valuei / total value) / areai )
2. Turn each outline into a ring of circles
Each outline is resampled at a uniform arc length s, and a circle of radius s/2 is placed at every sample. This does two things at once.
- Consecutive circles touch, so the ring is a sealed wall. Nothing can pass through it at any size, which is why no state can ever end up inside another and why the interiors never need filling. Ringing the boundary rather than packing the inside is the difference between about 3,000 circles and about 30,000.
- The union of the circles is the outline dilated by s/2 — a Minkowski sum with a disc. So if circles belonging to different states are forbidden from coming closer than s + gap, then every point of one outline finishes at least gap away from every point of the other. A boundary point is within s/2 of its nearest sample, so |p − q| ≥ |a − b| − s = gap.
That keeps the two knobs independent: s buys resolution, gap buys padding, and tight padding stays cheap. The padding is not a typical value or an average — it is a guaranteed minimum, uniform along every border, and the readout above measures it rather than assuming it.
3. Pack by relaxation
Each state is a rigid body that may translate but not rotate or deform — a tilted Florida costs more legibility than the packing gains. Every pass hashes the circles into a uniform grid, pushes overlapping cross-state pairs apart along their centre line, and combines each body's corrections into a single translation. Overlaps are projected out directly rather than integrated through velocities, so nothing can tunnel through a wall.
The layout starts expanded and contracts, which is the opposite of what seems natural. Scaling every state about its own centroid pushes neighbours into each other, so the true map is not a legal starting point. Growing the states from tiny is the obvious fix and it fails: a growing arm sweeps sideways and can close around a neighbour, and a shape that may only slide can never escape that — Maryland does it to Delaware every time. So the states are held at full size, the positions are pushed apart until nothing overlaps, and gravity draws them back together. Shapes that only ever approach one another cannot interlock: they meet, and they stop.
One more detail decides whether it works at all. Each body's correction is weighted by how deep each contact is, rather than averaged flat. Under a flat average, a hundred neighbours resting quietly at the padding out-vote the one contact that is genuinely overlapping, and that contact never clears no matter how long the solve runs. Weighting by depth lets the worst contact lead.
A fourth force holds neighbours in their true bearing to one another. Gravity says where each state belongs on its own and nothing at all about where states belong relative to each other, so a large state on the edge of the pack can shoulder a small one straight past itself — which is how Maine came to sit west of New Hampshire. It corrects only the component across the true bearing, never along it, so the padding is still free to push neighbours apart.
That force is only switched on when the map is barely resized, and the reason is worth stating: true bearings are not all satisfiable at once. Once New Jersey is 3.6× its true size it cannot sit at its true bearing from both New York and Pennsylvania without overlapping one of them. A spring demanding it fights the separation pass until the packing comes out worse than with no alignment at all — which is what happened at every strength tried. So its strength is scaled by the measured spread of the scale factors. Under Land area the spread is zero, alignment runs at full strength, and it halves the misordered pairs; under the three resized measures it is off.
Honest caveats, both measured rather than asserted. The solver does not converge at every padding, and Two per state falls short at the default — so the clearance above is measured on the finished map, not inferred from the settings, and the line beneath it says plainly when the packing missed. And relative position is only approximate: under the resized measures about 1% of east–west state pairs come out on the wrong side of one another compared with the true projection. This map buys exact shape and exact area by spending accuracy on where things sit, and that is the bill.
What the controls show
Switching to Land area turns the resizing off and leaves only the packing, which isolates what step 3 does on its own — and it packs tightest, because states at their true relative sizes still fit together nearly as well as they do on a real map. Two per state gives every state the same area — the Senate, drawn to scale. Raising the padding costs nothing in the solve; it simply widens the gap the circles must respect.