choropleth
A dataset column joined onto a pack's regions and shaded by value — the geographic sibling of the graph's heatmap. regions: and values: name columns (#gdp.country, #gdp.gdppc); join keys match pack names and short codes — ISO alpha-3 on world, postal abbreviations on the admin-1 packs — case-insensitively, and any region the join does not cover keeps the neutral land fill. A NUMERIC values: column shades through a ramp, with a legend row pricing whichever region is under the cursor. A TEXT column enumerates instead: each distinct value becomes a category with its own flat hue, named by key:, and the legend lists the swatches.
#Attributes
in:. It may instead be #id naming an attached .geojson dataset — in: #wards — which makes the attachment itself the boundaries.Can be written as shorthand: choropleth:valuevalues: #gdp.gdppc. Numeric shades through the ramp; text enumerates categories instead (values: #vote.party). ANIMATABLE, which is how a map moves through time: a chain of columns — values: #y1990.rate !cue.to{#y2000.rate}(at: 1) — eases every region between its own two readings. Pin range: when animating, or the ramp re-normalises each frame and the change erases itself. Every reference is checked at compile time — the base and each keyframe, dataset and column alike — so a mistyped column fails the build rather than shading nothing.multicolour, the default, runs the full spectrum, violet low to red high; temperature is the blue → white → red ramp for diverging data — pair it with a symmetric range: to pin white at zero; any ordinary hue shades its own intensity ramp instead. Both ramps are fixed colours, identical in light and dark mode.multicolourrange: [0, 60]; values outside it clamp. Absent, the ramp spans the joined extrema. Animatable — a !cue.to re-normalises the shading across steps.key: Liberal red, Conservative blue, New Democratic orange. Categories the list does not name take the next unused hue, so nothing in the data silently vanishes. Ignored when values: is numeric.parameter.time holds, interpolating between the two periods that bracket it, so a reader scrubbing to 1995 sees half way between the 1990 and 2000 rows. Reach for this rather than a keyframe chain on values: once the data carries more than a few periods.values:. range: pins its window; absent, the observed extrema span it.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
{{#id.min}}.values: column it is the only aggregate published: min, max and mean need numbers.#Allowed in
#Examples
choropleth#gdp(in: world; regions: #gdp.country; values: #gdp.gdppc)choropleth(in: world; regions: #anomaly.country; values: #anomaly.delta; colour: temperature; range: [-2, 2])choropleth#winner(in: canada-provinces; regions: #vote.province; values: #vote.party; key: Liberal red, Conservative blue, New Democratic orange)choropleth(regions: #vote.state; values: #vote.party; intensity: #vote.margin; key: Greens green, Labor red)choropleth(regions: #y1990.country; values: #y1990.rate !cue.to{#y2000.rate}(at: 1; over: 1.6s); range: [0, 220])choropleth(regions: #rates.country; values: #rates.rate; period: #rates.year; range: [0, 220])