Choropleth map chart reference

Choropleth map examples

Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures.

Equal-area region map with deterministic pre-baked geometry and explicit missing-data traces. Type choropleth.

Use cases

Chart IDs

One form; its chart ID is choropleth.

Minimal spec

{
  "type": "choropleth",
  "data": {
    "pack": "eu27",
    "regions": [{ "id": "DE", "value": 2.3 }, { "id": "FR", "value": 1.6 }, { "id": "IT", "value": 1.1 }]
  },
  "options": {
    "title": "Germany has the highest inflation rate among the three supplied countries",
    "unit": "%",
    "classes": 3,
    "source": "Illustrative data"
  }
}

Data

PathTypeRequiredMeaning
packstringyesBuilt-in boundary pack that supplies region shapes and identifiers. 'europe' holds the EU27, CH, NO, IS, GB, the Balkan states, UA, BY, MD and the small states, without RU and TR; it follows the EU view, shows Crimea as part of Ukraine and shows Cyprus whole. 'world' also shows Crimea as part of Ukraine and keeps Natural Earth's de facto view elsewhere; it also holds small places such as HK, MO, GI, AD, LI, MC, SM and VA as markers. One of 'de-states', 'eu27', 'dach', 'europe', 'world', 'us-states'.
regionsarrayyesObserved regions keyed by pack id; omitted pack members are not in the data and draw plain background.
regions[].idstringyesRegion identifier from the selected geographic pack. Exact spellings win, then ids and aliases match without regard to case. Unknown data ids are left out with a warning and a note; all-unknown data is refused.
regions[].valuenumber | nullyesRegion measure; null without a state means missing data.
regions[].statestringNamed null state: suppressed, not meaningful (nm), or not applicable (na). Each has a distinct pattern and key. Requires value null. One of 'na', 'nm', 'suppressed'.
overlaysarrayNamed glyphs and labels placed at geographic anchors.
overlays[].idstringyesStable overlay identifier, unique within the exhibit.
overlays[].atobjectyesRegion or longitude/latitude anchor for the overlay.
overlays[].at.region (overlays[].at branch 1)stringyesRegion id whose pack anchor positions the overlay. Exact spellings win, then ids and aliases match without regard to case.
overlays[].at.lon (overlays[].at branch 2)numberyesLongitude in degrees, west negative and east positive.
overlays[].at.lat (overlays[].at branch 2)numberyesLatitude in degrees, south negative and north positive.
overlays[].glyphobjectyesOverlay mark and its semantic data.
overlays[].glyph.kind (overlays[].glyph branch 1)stringyesDraw a small part-to-whole pie. One of 'pie'.
overlays[].glyph.shares (overlays[].glyph branch 1)arrayyesAt least two labeled shares with a positive combined amount.
overlays[].glyph.shares[].label (overlays[].glyph branch 1)stringyesReadable name for this overlay or pie share.
overlays[].glyph.shares[].value (overlays[].glyph branch 1)numberyesNonnegative share amount; slices divide by the positive sum of all shares.
overlays[].glyph.shares[].tone (overlays[].glyph branch 1)stringSemantic glyph tone resolved through the theme. One of 'good', 'bad', 'warn', 'neutral', 'info'.
overlays[].glyph.kind (overlays[].glyph branch 2)stringyesDraw a fractionally filled Harvey ball. One of 'harvey'.
overlays[].glyph.value (overlays[].glyph branch 2)numberyesFilled fraction from 0, empty, to 1, full.
overlays[].glyph.tone (overlays[].glyph branch 2 | overlays[].glyph branch 4 | overlays[].glyph branch 5)stringSemantic glyph tone resolved through the theme. One of 'good', 'bad', 'warn', 'neutral', 'info'.
overlays[].glyph.kind (overlays[].glyph branch 3)stringyesDraw a semantic status glyph. One of 'status'.
overlays[].glyph.status (overlays[].glyph branch 3)stringyesStatus judgment shown by the glyph. One of 'good', 'bad', 'warn', 'neutral'.
overlays[].glyph.kind (overlays[].glyph branch 4)stringyesDraw a named built-in icon. One of 'icon'.
overlays[].glyph.name (overlays[].glyph branch 4)stringyesName from the built-in icon catalog: alert calendar check conversation document flag gear lightbulb lock people star target workflow.
overlays[].glyph.kind (overlays[].glyph branch 5)stringyesDraw a geometric location marker. One of 'marker'.
overlays[].glyph.shape (overlays[].glyph branch 5)stringMarker outline; defaults to circle. One of 'circle', 'square', 'diamond'.
overlays[].labelstringyesReadable name for this overlay or pie share.
overlays[].sizestringGlyph size tier; defaults to md. One of 'sm', 'md', 'lg'.
overlays[].a11ystringAuthored accessible description for the overlay.

Options

PathTypeValuesDefaultMeaning
labelsstring | false'auto', 'all', 'none', false'auto'Region-label selection policy; placement still respects available space. false is the same as 'none'.
topNobject | integerOn the world pack, the automatic labels name the n regions with the largest absolute values, plus the large countries (default 12). The other packs label every region, and labels 'all' or 'none' decide for themselves, so there topN changes nothing. A positive integer n means { n }.
topN.nintegerHow many regions with the largest absolute values the automatic labels name.
scaleobject{"kind":"sequential"}Sequential magnitude or diverging midpoint color scale.
scale.kind (scale branch 1)string'sequential''sequential'Encode ordered magnitudes with one color ramp.
scale.kind (scale branch 2)string'diverging''sequential'Encode values on favorable and unfavorable sides of a midpoint, on one span both ways: the farther side sets full strength.
scale.midpoint (scale branch 2)numberNeutral dividing value in the same source units as region values.
scale.midpointLabel (scale branch 2)stringExplanation appended to the formatted midpoint in the key.
scale.polarity (scale branch 2)string'higherIsBetter', 'lowerIsBetter'Which side of the midpoint is favorable; the diverging poles paint good/bad accordingly. Default higherIsBetter.
classesintegerNumber of equal-interval color classes, from 3 through 7. Explicit steps define five classes instead.
stepsarrayFour ascending thresholds in source units, as on cohort, defining five color classes. A value on a threshold enters the higher class. The first and last classes are open-ended. Omit to keep the continuous ramp or equal-interval classes. Use a format that prints each threshold exactly.
regionValuesbooleanPrint each labeled region's value after its code, e.g. 'DE 2.2%', through the same placement and fit tiers as the code. Default true when no value table is drawn and the map labels at most 10 regions, or, off the world map, when the canvas is at least 560 px wide and gives each label at least 8000 square pixels; else false. A region whose label no longer fits is listed with its value. Needs region labels, so labels 'none' or false refuse it.
labelRegionsarrayExplicit region ids to label, retained by the small-region filter.
microStateMarkersbooleanDraw a dot for a micro-state the data lists without a value (null); one with a value is always drawn. Default off on the world pack, the only pack whose micro-states have no outline; on the other packs it would change nothing and is refused.
smallRegionAreanumberArea fraction below which automatic labels move to Small members. Default 0.001; 0 disables. Explicit label requests are retained.
overlayTonesobjectThe key words for each overlay tone, e.g. { warn: 'Behind plan' }. The overlay key shows a toned glyph among plain ones, each status and each pie share; beside keyed tones, plain Harvey balls take the overlayMeasure entry and other plain glyphs share one 'Other' entry. A toned entry without a name prints the tone word and warns.
overlayTones.goodstringWhat the good tone marks on this map.
overlayTones.badstringWhat the bad tone marks on this map.
overlayTones.warnstringWhat the warn tone marks on this map.
overlayTones.neutralstringWhat the neutral tone marks on this map.
overlayTones.infostringWhat the info tone marks on this map.
overlayMeasurestringThe measure the overlay glyphs show, e.g. 'Activation progress, %'. The overlay key prints it as a heading without a category swatch, apart from the color key; Harvey-ball overlays without it warn geo-overlay-measure-unnamed.
keyTitlestringTitle of the color key, naming what the colors measure. Default 'Measure, unit' from subtitle.measure and unit, else the unit alone; set it when the subtitle is drawn elsewhere.
valueTablestring | false'auto', 'side', 'below', falseThe table of every region with its class swatch, code and value; the top values print bold and the map then prints codes only. 'auto' (default): beside the map when the map keeps most of the row, else under it; off above 20 regions, without numeric values, or when a pinned canvas is too short for it; an authored 'auto' that the region count turns off warns option-ignored. 'side' or 'below' forces the place; false leaves it off.
valueTableEmphasisstring | false'top', false'top' (default) sets the top values bold in the value table and on the map, with a rule under them. The top group is ranked on all regions. false sets no row and no map label bold.
columnVisibilityobjectTrue shows a column and false leaves it out: the ids are data.columnToggles ids on table and column ids elsewhere. Ids: swatch, code, value.
columnOverridesobjectSettings per generated column. Ids: swatch, code, value. Only value prints a head, so label and headAlign are refused on swatch and code.
columnOverrides.*.widthnumberTrack width in px. It beats the width the type would pick.
columnOverrides.*.alignstring'left', 'right', 'center'Alignment of the column: its cell text and, unless headAlign is set, its head. Bars keep starting at the panel origin.
columnOverrides.*.headAlignstring'left', 'right', 'center'Head alignment; defaults to align.
columnOverrides.*.labelstringHead text.
rowVisibilityobjectFalse leaves a generated row out. Ids: each region id, through the aliases of the map pack.
rowOrderarrayOrder of the generated rows; rows left out follow in default order. Ids: each region id, through the aliases of the map pack.
rowOverridesobjectSettings per generated row. Ids: each region id, through the aliases of the map pack.
rowOverrides.*.labelstringRow name.
methodNotebooleanDefault false. true adds the method footnote on which regions the automatic label policy names. The world pack's endorsement disclaimer stays on the source line and prints once. The inset scale note is required for interpretation and prints regardless.

Plus the shared options. This type does not accept detailFields, labelPosition, valueAxis, highlight, story, rounding, annotations. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, sort, bandFraction, valueAxis.show, valueAxis.gridlines with an option-ignored warning.

Annotations

This type takes no annotations.

Sizing

Floor 160 × 270 px; fit content. Narrower than 280 px a map draws while its key and small members fit.

Below the floor a render is refused with size-below-floor and the pixels it needs. measure returns the natural and comfortable size for a given spec; see Sizing in the manual.

Fixtures

IDKindUse case
german-states-revenueexampleGermany: revenue concentration by state
eu-inflationexampleEU-27: inflation around a declared 2% midpoint
dach-market-sharestortureDACH: sequential market shares
world-inflationexampleWorld inflation: relevance-driven country labels
world-inflation-all-labelstortureTorture: world inflation with the full region census
us-margin-by-stateexampleUS states: sequential operating margin with Northeast callouts
world-footprintexampleWorld footprint: nine market Harvey overlays on a muted choropleth
world-all-nulltortureTorture: every world region is explicit no-data
all-nulltortureTorture: every DACH region is explicit no-data
single-region-datatortureTorture: one supplied value, fifteen visible missing regions
dense-labelstortureTorture: EU-27 full labels on a dashboard tile
europe-inflationexampleEurope: inflation around a declared 2% midpoint, with CH, NO, GB and UA
world-small-marketsexampleWorld: Hong Kong, Monaco and Liechtenstein draw as markers
eu-small-members-targettortureEU small members beside a named inflation target
eu-inflation-valuesexampleEU inflation with each region value printed after its code
eu-inflation-colorblindexampleEU inflation around 2% in the colorblind-safe good/bad pair
us-margin-versus-targetexampleState margins above the target are favorable
us-margin-wide-slotexampleState margins on a wide slot: the key and the unlabeled states stand beside the map
dach-all-region-labelsexampleAll three DACH markets carry their region labels
german-states-bremen-on-maptortureBremen keeps its label on the map through labelRegions, under an authored key title
german-states-table-belowexampleThe value table stands under the map
german-states-table-sidetortureThe value table stands beside the map on a slide frame
german-states-without-tabletortureWithout the value table the map labels every state it can and lists the rest
world-inflation-top-six-labelsexampleThe automatic labels name the six largest values plus the large countries
world-footprint-every-toneexampleMarket overlays in every tone, each tone named in the overlay key
world-footprint-micro-dotsexampleSingapore and Malta listed without data, drawn as dots through microStateMarkers
world-footprint-glyphstortureStatus, pie, icon and marker overlays in every tone, shape and size
outlier-steps-and-missing-valuesexampleExplicit thresholds keep ordinary values distinct from an outlier
overlay-measure-headingtortureThe overlay measure has a heading
named-null-statestortureNamed map states differ from missing values
info-glyphs-with-statustortureInfo marker and icon tones appear beside status in the key
lookup-columnsexampleThe value table without swatches, with rows left out, moved and renamed
lookup-no-emphasisexampleThe value table and the map set no top group in bold