choropleth

A dataset column joined onto a map's regions and shaded by value.

On this page
A world map with nine countries shaded by median age, each within its continent’s hue: Europe blue, Asia orange, Africa purple, South America green.A world map with nine countries shaded by median age, each within its continent’s hue: Europe blue, Asia orange, Africa purple, South America green.

#Attributes

basemapImplicit
The boundary pack the join shades, or an attached .geojson dataset by #id.
worldus-statescanada-provincesaustralia-statesuk-countiesnz-regionseurope-admin1
Can be written as shorthand: choropleth:value
regionsRequired
The @data column matched against each region's name or code.
valueRequiredAnimatable
The column of numbers each region reads, which colour shades along.
colour
The ramp the regions shade along by value, or a map that paints each region flat.
value-colour-style
Also written: color
Defaultmulticolour
invertAnimatable
Flips the ramp, putting deep colour at low values.
Defaultfalse
style
How each region is filled: solid, hatched, dotted or outlined.
fill-style-style
Defaultsolid
slice
The column that long-format data is sliced by, showing the slice the scene's control stands on.
opacityAnimatable
How heavy the shading sits over the basemap.
Default1
hiddenAnimatable
Declared but not drawn.
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.
maxDerived
The largest joined value.
meanDerived
The mean of the joined values.
countDerived
How many regions the join covered.

#Allowed in

#Examples

A world map with sixteen countries shaded by GDP per head, the United States reddest at the top of the scale and Australia orange just below it.A world map with sixteen countries shaded by GDP per head, the United States reddest at the top of the scale and Australia orange just below it.
region:world{
    choropleth#gdp(basemap: world; regions: #economy.country; value: #economy.gdppc)
}
A world map with twelve countries on the blue-to-red temperature ramp from −2 °C to 2 °C, Canada and Russia deepest red.A world map with twelve countries on the blue-to-red temperature ramp from −2 °C to 2 °C, Canada and Russia deepest red.
region:world{
    choropleth(basemap: world; regions: #anomaly.country; value: #anomaly.delta; colour: #anomaly.delta -> -2..2 -> temperature)
}
A world map with eight countries shaded by under-five mortality in 1990, Nigeria reddest, and a Year slider beneath the map.A world map with eight countries shaded by under-five mortality in 1990, Nigeria reddest, and a Year slider beneath the map.
region:world{
    slider:t(column: #rates.year; name: Year)
    choropleth(regions: #rates.country; value: #rates.rate; slice: #rates.year; colour: #rates.rate -> 0..220 -> multicolour)
}

#Notes

  • A region the join does not cover keeps the plain land fill.
  • A value: column of words compiles but shades nothing.
  • The legend gives a strip for each scale.

Last updated