choropleth

choroplethNode

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 @data 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

inImplicit
worldus-statescanada-provincesaustralia-statesuk-countiesnz-regionseurope-admin1reference
The boundary pack the join shades. Defaults to the environment's own 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:value
regionsRequired
The @data column holding the region names: regions: #gdp.country.
valuesRequiredAnimatable
The column to shade by: values: #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.
colourAnimatable
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblackmulticolourtemperature
Also written: colormulticolour, 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.
Defaultmulticolour
rangeAnimatable
The value window the ramp spans, range: [0, 60]; values outside it clamp. Absent, the ramp spans the joined extrema. Animatable — a !cue.to re-normalises the shading across steps.
invertAnimatable
Flip the ramp, putting deep colour at low values rather than high.
Defaultfalse
Also written: legendThe categorical legend, category then hue: 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.
period
Also written: atThe period column of a LONG-FORMAT table — one row per region per period. The mark then shows the slice at whatever the environment's 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.
intensity
Also written: depth, byDepth WITHIN a category's hue — the electoral map's own grammar: the winner names the colour, the margin names how solid it is, so a knife-edge win is pale and a landslide is full. A numeric column, written beside a categorical values:. range: pins its window; absent, the observed extrema span it.
opacityAnimatable
How heavy the shading sits over the basemap, 0 to 1.
Default1
hiddenAnimatable
Declared but not drawn. Animatable, so hidden: true !cue.to{false}(at: 2) is the overlay's reveal.
Defaultfalse

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

minDerived
The smallest joined value. Cite it in prose with {{#id.min}}.
maxDerived
The largest joined value.
meanDerived
The mean of the joined values.
countDerived
How many regions the join actually covered — worth citing when it is fewer than the dataset has rows. For a categorical 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])