Choropleth

choroplethNode

A dataset column joined onto a pack's regions — 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 regions the join does not cover keep the neutral land fill. A NUMERIC values column shades through the ramp, with a legend row pricing the region under the cursor; a TEXT column ENUMERATES — each distinct value becomes a category with its own flat hue, keyed by key:, and the legend lists the swatches.

#Attributes

inRequiredImplicit
geo-pack
The boundary pack the join shades — see region's in: for the pack list.Can be written as shorthand: choropleth:value
regionsRequired
reference
The dataset column naming regions: regions: #gdp.country.
valuesRequired
reference
The column to shade by: values: #gdp.gdppc. Numeric shades through the ramp; text enumerates categories (values: #vote.party).
colour
surface-colour
Also written: colormulticolour (the default) runs the spectrum, violet low to red high; temperature is the blue → white → red ramp for diverging data; a hue shades its own intensity ramp instead.
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblackmulticolourtemperature
Defaultmulticolour
The value window the ramp spans, e.g. [0, 60]; values outside clamp. Absent, the ramp spans the joined extrema. Animatable — !cue.to re-normalises the shading across steps.
invert
boolean
Flip the ramp, putting deep colour at low values rather than high.
Defaultfalse
key
category-colours
Also written: legendThe categorical legend, category then hue: key: Liberal red, Conservative blue, New Democratic orange. Categories the key does not name take the next unused hue, so nothing in the data silently vanishes. Ignored for numeric values.
opacity
number
0 to 1.
Default1
hidden
boolean
Declared but not drawn. Animatable.
Defaultfalse

#Derived attributes

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

minDerived
The smallest joined value. Cite it with !value:#id.min().
maxDerived
The largest joined value.
meanDerived
The mean of the joined values.
countDerived
How many regions the join covered.

#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)