Maps
A wrapper component for every mapchart built with react-simple-maps. It determines the map context, which is passed to all react-simple-maps components. The context contains information about the projection and path generator, as well as the dimensions of the mapchart.
Basic Annotation
Basic Marker
Basic World Map
Custom Marker
Europe Map With Graticule
Graticule
Map Chart With Tooltip
Choropleth map chart of the US (quantile)
Choropleth map chart of the US (quantize)
USA states map with labels
API
ComposableMap
| Prop | Description | Type | Default |
|---|---|---|---|
| width | - | number | 800 |
| height | - | number | 600 |
| projection | - | string | () => void | 'geoEqualEarth' |
| projectionConfig | - | object | {} |
ZoomableGroup
| Prop | Description | Type | Default |
|---|---|---|---|
| center | - | array | [0, 0] |
| zoom | - | number | 1 |
| minZoom | - | number | 1 |
| maxZoom | - | number | 8 |
| translateExtent | - | array | [-∞, -∞, ∞, ∞] |
| onMoveStart | - | (position: { coordinates: [number, number], zoom: number }, event: D3ZoomEvent< SVGElement, any>) => void | - |
| onMove | - | (position: {x: number, y: number, k: number, dragging: WheelEvent }, event: D3ZoomEvent< SVGElement, any>) => void | - |
| onMoveEnd | - | (position: { coordinates: [number, number], zoom: number }, event: D3ZoomEvent< SVGElement, any>) => void | - |
Sphere
| Prop | Description | Type | Default |
|---|---|---|---|
| id | - | string | 'rsm-sphere' |
| fill | - | string | 'transparent' |
| stroke | - | string | 'currentcolor' |
| strokeWidth | - | number | 0.5 |
Graticule
| Prop | Description | Type | Default |
|---|---|---|---|
| fill | - | string | 'transparent' |
| stroke | - | string | 'currentcolor' |
| step | - | Array | [10, 10] |
Geographies
| Prop | Description | Type | Default |
|---|---|---|---|
| geography | - | string | - |
| children | - | (data: object) => void | - |
| parseGeographies | - | (features: Array) => Array | - |
Geography
| Prop | Description | Type | Default |
|---|---|---|---|
| geography | - | object | - |
| style | - | object | - |
Marker
| Prop | Description | Type | Default |
|---|---|---|---|
| coordinates | - | array | [] |
| style | - | object | {} |
Line
| Prop | Description | Type | Default |
|---|---|---|---|
| from | - | [number, number] | [0, 0] |
| to | - | [number, number] | [0, 0] |
| coordinates | - | array | [] |
| fill | - | string | 'transparent' |
| stroke | - | string | 'currentcolor' |
| strokeWidth | - | number | 3 |
Annotation
| Prop | Description | Type | Default |
|---|---|---|---|
| subject | - | array | [] |
| dx | - | number | 30 |
| dy | - | number | 30 |
| curve | - | number | 0 |
| connectorProps | - | object | - |