Get started โ
d3-maps is a toolkit for interactive SVG maps in React and Vue. Reactive components, pure SVG and D3.js power without low-level wiring.
Let's build your first map ๐
Install โ
bash
npm install @d3-maps/vueLoad data โ
Load a map data object first
ts
const { default: data } = await import('@d3-maps/atlas/world/countries/countries-110m')See Atlas for more maps
Render the map โ
Pass the data to MapFeatures
vue
<script setup lang="ts">
import { MapBase, MapFeatures, type MapData } from '@d3-maps/vue'
defineProps<{
data: MapData
}>()
</script>
<template>
<MapBase>
<MapFeatures :data="data" />
</MapBase>
</template>Result โ
When to use โ
| Case | Supported | Notes |
|---|---|---|
| SVG map charts | โ | Choropleth, bubble, heatmap, etc |
| Components API | โ | React & Vue packages |
| GeoJSON/TopoJSON rendering | โ | Renders to SVG |
| Markers, lines, annotations | โ | Framework-native components |
| Zoomable maps | โ | SVG zoom and pan |
| Full chart workflow | โ ๏ธ | Use amCharts, Highcharts or Plot |
| Low-level map rendering | โ ๏ธ | Use D3.js for full control |
| Real-world map apps | โ | Use Leaflet or MapLibre |
| Data-heavy 3D maps | โ | Use MapLibre |
Migrate from react-simple-maps โ
@d3-maps/react is fully compatible with react-simple-maps, supports React 19 an has more features under the hood. See migration guide