UI

Map chart

Compares one geographic measure worldwide using proportional circles for amounts or sequential shading for rates.

import { MapChart } from '@uthereal/ui/map-chart'

Map chart playground

Orders by countryIllustrative order totals; circle area represents orders.
Orders1,0504,200Missing (dashed circle or unshaded region)Zero (hollow circle)

Arrow keys explore records. Home and End reach the first and last record. PageUp and PageDown jump. Escape clears the selection.

Orders by country
LocationOrdersCountry code
United States of America4,200USA
Brazil1,800BRA
Germany2,900DEU
India3,600IND
Australia1,200AUS
Loading interactive preview…

Overview

MapChart displays how a single geographic measure varies worldwide on a fixed Equal Earth projection with bundled country geometry. It requires no map tiles, API keys, runtime network requests, pan/zoom controls, or geocoding.

  • locations: circle area encodes a nonnegative amount at WGS84 longitude and latitude coordinates.
  • country-totals: circle area encodes an absolute total at each country's label point without population normalization.
  • country-rates: seven sequential color steps encode a host-normalized rate, percentage, density, or average across one shared unit and reporting period. Never shade raw counts to imply incidence.

Use a bar chart for exact rankings. Use a dedicated mapping library for street detail, navigation, or thousands of overlapping points.

Usage

import { MapChart } from '@uthereal/ui/map-chart'

export function ConversionMap() {
  return (
    <MapChart
      title="Conversion by country"
      description="Illustrative rates for one reporting period"
      valueLabel="Conversion"
      valueFormat={{ style: 'percent', maximumFractionDigits: 1 }}
      max={0.1}
      tableToggle
      data={{
        type: 'country-rates',
        countries: [
          { country: 'USA', value: 0.045 },
          { country: 'DEU', value: 0.062 },
          { country: 'BRA', value: null },
        ],
      }}
    />
  )
}

Replace the entire data object when changing data.type. Normalize rates in the host before passing them to country-rates, and omit unit when valueFormat already includes a unit or percent symbol.

Examples

Data modes

The playground above shows proportional circles (country-totals). The examples below compare sequential regional shading (country-rates) and coordinate bubbles (locations). Both examples use illustrative data.

Conversion rate by countryIllustrative rates for one period; values are fractions, normalized by the host.
Conversion0% – 10%Missing (dashed circle or unshaded region)

Arrow keys explore records. Home and End reach the first and last record. PageUp and PageDown jump. Escape clears the selection.

Conversion rate by country
LocationConversionCountry code
United States of America4.5%USA
Brazil2.6%BRA
Germany6.2%DEU
India0%IND
AustraliaNo dataAUS
AfghanistanNo dataAFG
AngolaNo dataAGO
AlbaniaNo dataALB
United Arab EmiratesNo dataARE
ArgentinaNo dataARG
ArmeniaNo dataARM
AntarcticaNo dataATA
French Southern and Antarctic LandsNo dataATF
AustriaNo dataAUT
AzerbaijanNo dataAZE
BurundiNo dataBDI
BelgiumNo dataBEL
BeninNo dataBEN
Burkina FasoNo dataBFA
BangladeshNo dataBGD
BulgariaNo dataBGR
The BahamasNo dataBHS
Bosnia and HerzegovinaNo dataBIH
BelarusNo dataBLR
BelizeNo dataBLZ
BoliviaNo dataBOL
BruneiNo dataBRN
BhutanNo dataBTN
BotswanaNo dataBWA
Central African RepublicNo dataCAF
CanadaNo dataCAN
SwitzerlandNo dataCHE
ChileNo dataCHL
People's Republic of ChinaNo dataCHN
Ivory CoastNo dataCIV
CameroonNo dataCMR
Democratic Republic of the CongoNo dataCOD
Republic of the CongoNo dataCOG
ColombiaNo dataCOL
Costa RicaNo dataCRI
CubaNo dataCUB
Turkish Republic of Northern CyprusNo dataCYN
CyprusNo dataCYP
Czech RepublicNo dataCZE
DjiboutiNo dataDJI
DenmarkNo dataDNK
Dominican RepublicNo dataDOM
AlgeriaNo dataDZA
EcuadorNo dataECU
EgyptNo dataEGY
EritreaNo dataERI
Western SaharaNo dataESH
SpainNo dataESP
EstoniaNo dataEST
EthiopiaNo dataETH
FinlandNo dataFIN
FijiNo dataFJI
Falkland IslandsNo dataFLK
FranceNo dataFRA
GabonNo dataGAB
United KingdomNo dataGBR
GeorgiaNo dataGEO
GhanaNo dataGHA
GuineaNo dataGIN
The GambiaNo dataGMB
Guinea-BissauNo dataGNB
Equatorial GuineaNo dataGNQ
GreeceNo dataGRC
GreenlandNo dataGRL
GuatemalaNo dataGTM
GuyanaNo dataGUY
HondurasNo dataHND
CroatiaNo dataHRV
HaitiNo dataHTI
HungaryNo dataHUN
IndonesiaNo dataIDN
IrelandNo dataIRL
IranNo dataIRN
IraqNo dataIRQ
IcelandNo dataISL
IsraelNo dataISR
ItalyNo dataITA
JamaicaNo dataJAM
JordanNo dataJOR
JapanNo dataJPN
KazakhstanNo dataKAZ
KenyaNo dataKEN
KyrgyzstanNo dataKGZ
CambodiaNo dataKHM
South KoreaNo dataKOR
KosovoNo dataKOS
KuwaitNo dataKWT
LaosNo dataLAO
LebanonNo dataLBN
LiberiaNo dataLBR
LibyaNo dataLBY
Sri LankaNo dataLKA
LesothoNo dataLSO
LithuaniaNo dataLTU
LuxembourgNo dataLUX
LatviaNo dataLVA
MoroccoNo dataMAR
MoldovaNo dataMDA
MadagascarNo dataMDG
MexicoNo dataMEX
North MacedoniaNo dataMKD
MaliNo dataMLI
MyanmarNo dataMMR
MontenegroNo dataMNE
MongoliaNo dataMNG
MozambiqueNo dataMOZ
MauritaniaNo dataMRT
MalawiNo dataMWI
MalaysiaNo dataMYS
NamibiaNo dataNAM
New CaledoniaNo dataNCL
NigerNo dataNER
NigeriaNo dataNGA
NicaraguaNo dataNIC
NetherlandsNo dataNLD
NorwayNo dataNOR
NepalNo dataNPL
New ZealandNo dataNZL
OmanNo dataOMN
PakistanNo dataPAK
PanamaNo dataPAN
PeruNo dataPER
PhilippinesNo dataPHL
Papua New GuineaNo dataPNG
PolandNo dataPOL
Puerto RicoNo dataPRI
North KoreaNo dataPRK
PortugalNo dataPRT
ParaguayNo dataPRY
PalestineNo dataPSE
QatarNo dataQAT
RomaniaNo dataROU
RussiaNo dataRUS
RwandaNo dataRWA
Saudi ArabiaNo dataSAU
SudanNo dataSDN
SenegalNo dataSEN
Solomon IslandsNo dataSLB
Sierra LeoneNo dataSLE
El SalvadorNo dataSLV
SomalilandNo dataSOL
SomaliaNo dataSOM
SerbiaNo dataSRB
South SudanNo dataSSD
SurinameNo dataSUR
SlovakiaNo dataSVK
SloveniaNo dataSVN
SwedenNo dataSWE
EswatiniNo dataSWZ
SyriaNo dataSYR
ChadNo dataTCD
TogoNo dataTGO
ThailandNo dataTHA
TajikistanNo dataTJK
TurkmenistanNo dataTKM
East TimorNo dataTLS
Trinidad and TobagoNo dataTTO
TunisiaNo dataTUN
TurkeyNo dataTUR
TaiwanNo dataTWN
TanzaniaNo dataTZA
UgandaNo dataUGA
UkraineNo dataUKR
UruguayNo dataURY
UzbekistanNo dataUZB
VenezuelaNo dataVEN
VietnamNo dataVNM
VanuatuNo dataVUT
YemenNo dataYEM
South AfricaNo dataZAF
ZambiaNo dataZMB
ZimbabweNo dataZWE
Orders at fulfillment locationsIllustrative counts at supplied WGS84 coordinates. Area represents orders.
Orders4001,600Missing (dashed circle or unshaded region)Zero (hollow circle)

Arrow keys explore records. Home and End reach the first and last record. PageUp and PageDown jump. Escape clears the selection.

Orders at fulfillment locations
LocationOrdersLongitude, latitude
London900⁦-0.1276, 51.5072⁩
Tokyo1,600⁦139.6917, 35.6895⁩
Sydney400⁦151.2093, -33.8688⁩

Zero, missing, and unmapped records

Zero renders as a small hollow circle and null renders as a dashed hollow circle rather than encoding area. Country codes absent from the bundled 1:110m geometry (such as SGP) remain in the shared scale, keyboard sequence, visible unmatchedLabel notice, and data table.

Missing and unsupported countries
Orders125500Missing (dashed circle or unshaded region)Zero (hollow circle)

Arrow keys explore records. Home and End reach the first and last record. PageUp and PageDown jump. Escape clears the selection.

Unmapped country codes: 1. All values remain in the data table.

Missing and unsupported countries
LocationOrdersCountry code
United States of America0USA
BrazilNo dataBRA
SGP500SGP — Not on map

Data and scale

data is a discriminated union keyed by type:

TypeCollectionRecord shape
locationslocations, up to 500{ id, label, longitude, latitude, value }
country-totalscountries, up to 250{ country, value }
country-ratescountries, up to 250{ country, value }

IDs and uppercase three-letter country codes must be unique. Longitude spans -180 to 180 and latitude spans -90 to 90; coordinates are never snapped to land, wrapped, or guessed. Numeric values must be finite and nonnegative (null marks missing data). Invalid coordinates, duplicate records, or values exceeding an explicit max reject the configuration atomically.

Country joins require exact uppercase ISO alpha-3 codes (such as USA, DEU, BRA) or documented Natural Earth unit codes. Import mapCountries from @uthereal/ui/map-chart for the complete list of supported codes and labels; names and alpha-2 codes are not converted. Unmapped codes are never drawn on another country's geometry, and their values remain in the shared scale so failed joins cannot rescale visible marks.

The scale always starts at zero. Set max to fix the upper bound across views; otherwise the scale uses the largest supplied value (or 1 when all values are zero or missing). Circle area is strictly proportional to value (four times the value doubles the radius) without inflating small positive circles. country-rates divides [0, max] into seven equal-width intervals including each upper boundary, with zero in the first interval and unshaded regions indicating missing data.

Geographic accuracy and limitations

Country geometry comes from Natural Earth 5.1.2 at 1:110m scale under public-domain terms, covering 177 geographic units. Small territories, islands, and fine coastlines are omitted; boundaries follow that snapshot rather than an authoritative jurisdiction source.

Equal Earth preserves relative area globally while distorting shapes, angles, and distances. Country circles anchor at Natural Earth LABEL_X/LABEL_Y points rather than capitals or population centroids. At the antimeridian (±180°), nearby points appear on opposite edges of the fixed world view. Co-located circles do not cluster or displace; smaller marks draw on top, nearest-center pointer snapping selects one record within at least 12 px, and keyboard navigation and the data table expose every record. Resizing fits the full world without cropping, and dir="rtl" changes text direction only, never east-west geography.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
titlestringDefault: "Orders by country"Figure title; names the chart for assistive technology
descriptionstring—One or two sentences on what the chart shows; omit when the title says it
tableTogglebooleanDefault: falseShow a button that reveals the data table; the table is always announced
tableLabelstringDefault: "Data table"Name of the data table toggle and the table caption suffix
pointLabelstringDefault: "{series}, {x}: {value}"Announced when keyboard focus moves to a point; {series}, {x}, {value}
noDataLabelstringDefault: "No data"Announced and shown in the tooltip for a missing value
valueFormatNumberFormat—How values are displayed; omitted shows plain numbers
localestring—BCP 47 locale for numbers and dates; omitted inherits the application
dataMapChartDataDefault: {"type":"country-totals","countries":[{"country":"USA","value":4200},{"country":"BRA","value":1800},{"country":"DEU","value":2900},{"country":"IND","value":3600},{"country":"AUS","value":1200}]}One geographic measure: locations, country-totals, or country-rates
valueLabelstringDefault: "Orders"Name of the measure in the tooltip, legend and table
locationLabelstringDefault: "Location"First column of the data table
unitstring—Unit appended to full values; omit if valueFormat already supplies it
maxnumber—Fixed zero-based scale maximum, containing every supplied value; omitted uses the largest value, including unmatched records
keysLabelstringDefault: "Arrow keys explore records. Home and End reach the first and last record. PageUp and PageDown jump. Escape clears the selection."Instructions for the focusable plot
unmatchedLabelstringDefault: "Unmapped country codes: {count}. All values remain in the data table."Visible notice; {count} is the number of unsupported country codes
unplacedLabelstringDefault: "Not on map"Status of an unsupported country code
zeroLabelstringDefault: "Zero (hollow circle)"Explanation of the zero-value symbol
missingLabelstringDefault: "Missing (dashed circle or unshaded region)"Explanation of missing values
loadingbooleanDefault: falseKeep the lines on screen, dimmed, while the next data loads
loadingLabelstringDefault: "Loading"Announced politely while loading
emptyLabelstringDefault: "No geographic records"Message for an empty input collection
heightintegerDefault: 360Plot height in pixels; the world fits without cropping
recipestudio | softDefault: "studio"Visual treatment
themeMapChartTheme—Shared chart theme overrides
motionnone | subtle | expressiveDefault: "subtle"Draw and update motion; reduced motion takes precedence
motionOptionsChartMotionOptions—Draw and morph transitions
dirltr | rtl—Text direction; geographic east and west never mirror

React integration

PropPurpose
onActiveChangeFires with { id, value, placed } during transient exploration, or null when cleared
presetApplication defaults, overridden by explicit instance props
tokensCSS variables applied after the typed theme
refRef forwarded to the root <figure>
className, styleApplied to the root <figure>
Native attributesid, data-*, and remaining <figure> attributes forwarded to the root

Keyboard & accessibility

KeyInteraction
TabFocus the plot on the first geographic record
ArrowLeft, Right, Up, DownStep through records in input order (plus unmapped rates)
PageUp, PageDownJump across multiple records
Home, EndJump to the first or last record
EscapeClear the active exploration marker and tooltip

The chart renders a <figure> named by title, described by description, and linked via aria-details to a native data table (set tableToggle: true to display a visible disclosure button). For country-rates, the table includes all bundled countries, including those without supplied data. The plot is a single tab stop described by keysLabel. Each focused record displays a non-color-dependent focus marker and announces its full formatted value, noting unplacedLabel ("Not on map") for unsupported codes. Touch drags scrub records and release on lift while vertical swipes scroll the page. loading: true disables exploration and announces loadingLabel; empty collections display emptyLabel.

Motion and theming

Circle marks reveal on entry and morph radii when values change, while geographic coordinates update directly so markers never animate across unrelated regions. Rate fills transition smoothly across the seven sequential steps. motionOptions.draw and motionOptions.morph accept a tween with duration (ms) or a spring. motion="none" and prefers-reduced-motion: reduce apply updates immediately.

theme accepts a mode, an accent, and semantic tokens from the shared chart theme. An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, MapChart is a leaf with no actions. Exploration is transient and is not persisted in host state; the host owns data fetching, normalization, and composition updates. See Building with agents.

{
  "type": "MapChart",
  "props": {
    "title": "Orders by country",
    "valueLabel": "Orders",
    "data": {
      "type": "country-totals",
      "countries": [{ "country": "USA", "value": 4200 }]
    }
  },
  "children": []
}

On this page