Skip to content
  • System
  • Light
  • Dark
  • High contrast

GeoChart

Regions coloured by value using a three-colour scale (red → amber → green).

import { GeoChart } from '@eekodigital/raster';
import world from 'world-atlas/countries-110m.json';

<GeoChart
topology={world}
data={[
  { id: '826', value: 95, label: 'United Kingdom' },
  { id: '840', value: 65, label: 'United States' },
  { id: '392', value: 85, label: 'Japan' },
]}
colorScale={['var(--color-danger)', 'var(--color-warning)', 'var(--color-success)']}
aria-label="Compliance by country"
/>

Bubble markers at lat/lon coordinates overlaid on the choropleth.

<GeoChart
topology={world}
data={data}
markers={[
  { lat: 51.5, lon: -0.1, size: 8, label: 'London' },
  { lat: 48.9, lon: 2.3, size: 6, label: 'Paris' },
  { lat: 40.7, lon: -74.0, size: 7, label: 'New York' },
]}
aria-label="Compliance with office markers"
/>

GeoChart does not bundle any map data. Install world-atlas for world country boundaries, or provide your own TopoJSON data.

"mercator" (default) — most recognisable, distorts area at poles.

"equirectangular" — honest area representation, flat appearance.

Custom function: (lon, lat) => [x, y] where x/y are 0-1 normalised.

Pass a filter array of feature IDs to show only specific regions:

<GeoChart topology={world} filter={["GBR", "IRL"]} data={ukData} />
PropTypeDefaultDescription
topologyTopologyTopoJSON data (e.g. from world-atlas)
dataGeoRegionDatum[][]{ id, value, label? } per region
colorScalestring[]Interactive scaleColours from low to high value
markersGeoMarker[][]{ lat, lon, size?, label, color? }
projection"mercator" | "equirectangular" | fn"mercator"Map projection
filterstring[]Feature IDs to include (show only these)
onRegionClick(datum, id) => voidClick handler per region
onMarkerClick(marker, index) => voidClick handler per marker
aria-labelstringRequired.