Map Chart
ProMap chart for values by place: a dot-matrix world map, or Europe or North America, with points sized by value.
Playground Map Charts
Workspaces by city
| Location | Workspaces |
|---|---|
| San Francisco | 1,240 |
| New York | 1,860 |
| Chicago | 690 |
| Austin | 560 |
| Toronto | 620 |
| Vancouver | 330 |
| Mexico City | 410 |
| São Paulo | 730 |
| London | 1,520 |
| Berlin | 1,310 |
| Paris | 880 |
| Amsterdam | 720 |
| Madrid | 510 |
| Zurich | 450 |
| Stockholm | 460 |
| Warsaw | 380 |
| Lagos | 290 |
| Bangalore | 940 |
| Singapore | 680 |
| Tokyo | 1,070 |
| Sydney | 540 |
Playground Regions
Workspaces by city
| Location | Workspaces |
|---|---|
| London | 1,520 |
| Berlin | 1,310 |
| Paris | 880 |
| Amsterdam | 720 |
| Madrid | 510 |
| Zurich | 450 |
| Stockholm | 460 |
| Warsaw | 380 |
Installation
Map Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.
The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.
Then import what you need:
import {
MapChart,
MapChartPoint,
MapChartProps,
MapChartZoom,
} from "@wunderui/react/charts"States
Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.
Workspaces by city
| Location | Workspaces |
|---|---|
| San Francisco | 1,240 |
| New York | 1,860 |
| Chicago | 690 |
| Austin | 560 |
| Toronto | 620 |
| Vancouver | 330 |
| Mexico City | 410 |
| São Paulo | 730 |
| London | 1,520 |
| Berlin | 1,310 |
| Paris | 880 |
| Amsterdam | 720 |
| Madrid | 510 |
| Zurich | 450 |
| Stockholm | 460 |
| Warsaw | 380 |
| Lagos | 290 |
| Bangalore | 940 |
| Singapore | 680 |
| Tokyo | 1,070 |
| Sydney | 540 |
Anatomy
The parts the component is made of. Each one renders a you can target from CSS.
Workspaces by city
| Location | Workspaces |
|---|---|
| San Francisco | 1,240 |
| New York | 1,860 |
| Chicago | 690 |
| Austin | 560 |
| Toronto | 620 |
| Vancouver | 330 |
| Mexico City | 410 |
| São Paulo | 730 |
| London | 1,520 |
| Berlin | 1,310 |
| Paris | 880 |
| Amsterdam | 720 |
| Madrid | 510 |
| Zurich | 450 |
| Stockholm | 460 |
| Warsaw | 380 |
| Lagos | 290 |
| Bangalore | 940 |
| Singapore | 680 |
| Tokyo | 1,070 |
| Sydney | 540 |
- 1data-slot="map-chart"
Takes the locations (id, label, latitude, longitude, value), the section of the map (world, Europe or North America), a value formatter and label, and onPointClick. Points outside the section are left out.
- 2data-slot="map-land"
A dot matrix of the land in the border-control token, drawn from a coarse mask built into the library. About 110 dots across, 4.5 to 9 px apart.
- 3data-slot="map-points"
One circle per location in the first chart colour, its area growing with the value; larger points are drawn first so small ones stay on top. The active point gets a heavier ring.
- data-slot="chart-plot"
The focusable region. Arrow keys, Home and End walk the points in data order and the live region reads each one; Enter or Space calls onPointClick.
- 4data-slot="chart-tooltip"
The shared chart tooltip: the location and its value.
- data-slot="chart-skeleton"
- data-slot="map-point"Optional
Best practices
When to use
Use a Map Chart when where something happens matters: customers, sessions or offices by city. To compare values, put a ranked list or a bar chart beside it.
- Do
Set valueLabel and valueFormatter, so the tooltip, the live region and the table read Workspaces 1,310 rather than Value 1.3k.
- Do
Pick the section that holds the points: zoom Europe when most points are in Europe, so they do not pile up.
- Don’t
Don't use it for exact comparisons; point areas are hard to compare. Show the numbers next to it.
- Don’t
Don't plot hundreds of points; above a few dozen they overlap. Group them by city or region first.
API reference
One table per part, in the order of the anatomy. Every part also takes the props of the Base UI part it wraps (such as , and ) and the native attributes of its element.
Takes the locations (id, label, latitude, longitude, value), the section of the map (world, Europe or North America), a value formatter and label, and onPointClick. Points outside the section are left out.
| Prop | Type | Default | Description |
|---|---|---|---|
| data required | readonly MapChartPoint[] | — | |
| activeIndex | number | null | — | |
| animate | boolean | — | |
| animationKey | string | number | — | |
| defaultActiveIndex | number | null | — | |
| description | string | — | |
| emptyDescription | string | — | |
| emptyTitle | string | — | |
| errorDescription | string | — | |
| errorTitle | string | — | |
| height | number | 360 | Height of the plot frame in px. Default 280 (Figma small card plot). |
| hiddenSeries | readonly string[] | — | Labels of rows switched off in the legend: drawn faded. |
| label | string | — | Accessible name, e.g. the card title. |
| onActiveIndexChange | (index) => void | — | |
| onPointClick | (point, index) => void | — | A click on a point, or Enter / Space while the keyboard is on it. |
| onRetry | () => void | — | |
| state | "ready" | "loading" | "empty" | "error" | — | |
| tooltip | boolean | — | |
| valueFormatter | ChartValueFormatter | — | Formats the value in the tooltip, the live region and the data table. Default: compact (1.2k). |
| valueLabel | string | "Value" | Name of the value in the tooltip and the table header, e.g. "Sessions". Default "Value". |
| width | number | — | |
| zoom | "world" | "europe" | "north-america" | "world" | The section of the map. Points outside it are left out (also from the data table). Default . |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("map-chart")The full library index for assistants is at /llms.txt.
Related components
Account health: 11 points in 3 groups, x from 0 to 172, y from 0 to 92. Account health, data table name x y Size Group Account 1 22 78 40 Enterprise Account 2 72 92 120 Enterprise Account 3 124 62 200 Enterprise Account 4 172 86 80 Enterprise Account 5 34 42 30 Mid-market Account 6 88 68 60 Mid-market Account 7 138 38 45 Mid-market Account 8 166 58 35 Mid-market Account 9 52 22 20 Startup Account 10 104 30 25 Startup Account 11 148 80 18 Startup Charts10 stylesProBubble ChartScatter and bubble charts for the relation between two or three values: scatter, bubbles, dot plot, dot matrix, regression, quadrants, beeswarm and a connected scatter.Sessions by weekday and hour, 7 rows × 24 columns, values from 0 to 87. Sessions by weekday and hour, data table Row · column Value Mon · 0:00 6 Mon · 1:00 2 Mon · 2:00 8 Mon · 3:00 4 Mon · 4:00 4 Mon · 5:00 6 Mon · 6:00 10 Mon · 7:00 20 Mon · 8:00 27 Mon · 9:00 43 Mon · 10:00 50 Mon · 11:00 66 Mon · 12:00 78 Mon · 13:00 80 Mon · 14:00 87 Mon · 15:00 82 Mon · 16:00 72 Mon · 17:00 66 Mon · 18:00 48 Mon · 19:00 35 Mon · 20:00 32 Mon · 21:00 16 Mon · 22:00 16 Mon · 23:00 11 Tue · 0:00 4 Tue · 1:00 1 Tue · 2:00 6 Tue · 3:00 4 Tue · 4:00 10 Tue · 5:00 12 Tue · 6:00 14 Tue · 7:00 16 Tue · 8:00 27 Tue · 9:00 39 Tue · 10:00 50 Tue · 11:00 67 Tue · 12:00 75 Tue · 13:00 83 Tue · 14:00 82 Tue · 15:00 85 Tue · 16:00 72 Tue · 17:00 64 Tue · 18:00 55 Tue · 19:00 42 Tue · 20:00 33 Tue · 21:00 18 Tue · 22:00 15 Tue · 23:00 11 Wed · 0:00 7 Wed · 1:00 5 Wed · 2:00 8 Wed · 3:00 7 Wed · 4:00 10 Wed · 5:00 11 Wed · 6:00 11 Wed · 7:00 22 Wed · 8:00 31 Wed · 9:00 39 Wed · 10:00 52 Wed · 11:00 61 Wed · 12:00 74 Wed · 13:00 78 Wed · 14:00 87 Wed · 15:00 81 Wed · 16:00 75 Wed · 17:00 63 Wed · 18:00 54 Wed · 19:00 40 Wed · 20:00 25 Wed · 21:00 24 Wed · 22:00 12 Wed · 23:00 8 Thu · 0:00 6 Thu · 1:00 1 Thu · 2:00 3 Thu · 3:00 4 Thu · 4:00 3 Thu · 5:00 14 Thu · 6:00 18 Thu · 7:00 20 Thu · 8:00 30 Thu · 9:00 41 Thu · 10:00 51 Thu · 11:00 62 Thu · 12:00 72 Thu · 13:00 85 Thu · 14:00 86 Thu · 15:00 83 Thu · 16:00 78 Thu · 17:00 68 Thu · 18:00 48 Thu · 19:00 35 Thu · 20:00 32 Thu · 21:00 16 Thu · 22:00 15 Thu · 23:00 13 Fri · 0:00 6 Fri · 1:00 2 Fri · 2:00 5 Fri · 3:00 4 Fri · 4:00 5 Fri · 5:00 8 Fri · 6:00 16 Fri · 7:00 19 Fri · 8:00 29 Fri · 9:00 41 Fri · 10:00 51 Fri · 11:00 61 Fri · 12:00 77 Fri · 13:00 82 Fri · 14:00 82 Fri · 15:00 80 Fri · 16:00 71 Fri · 17:00 66 Fri · 18:00 52 Fri · 19:00 38 Fri · 20:00 28 Fri · 21:00 17 Fri · 22:00 12 Fri · 23:00 11 Sat · 0:00 0 Sat · 1:00 7 Sat · 2:00 5 Sat · 3:00 9 Sat · 4:00 7 Sat · 5:00 9 Sat · 6:00 7 Sat · 7:00 9 Sat · 8:00 12 Sat · 9:00 16 Sat · 10:00 24 Sat · 11:00 27 Sat · 12:00 37 Sat · 13:00 31 Sat · 14:00 34 Sat · 15:00 38 Sat · 16:00 31 Sat · 17:00 30 Sat · 18:00 24 Sat · 19:00 22 Sat · 20:00 15 Sat · 21:00 8 Sat · 22:00 13 Sat · 23:00 4 Sun · 0:00 7 Sun · 1:00 5 Sun · 2:00 4 Sun · 3:00 3 Sun · 4:00 6 Sun · 5:00 6 Sun · 6:00 12 Sun · 7:00 13 Sun · 8:00 15 Sun · 9:00 20 Sun · 10:00 25 Sun · 11:00 27 Sun · 12:00 34 Sun · 13:00 39 Sun · 14:00 37 Sun · 15:00 32 Sun · 16:00 31 Sun · 17:00 26 Sun · 18:00 27 Sun · 19:00 17 Sun · 20:00 18 Sun · 21:00 11 Sun · 22:00 8 Sun · 23:00 10 Charts6 stylesProHeatmapHeatmap for values across two dimensions: a weekday × hour matrix, a contribution calendar, a punch card, labelled cells and a correlation matrix.Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k. Revenue by product line, data table label Path Value Share Core Software › Core $340k 18.4% Pro Software › Pro $260k 14.1% Enterprise Software › Enterprise $410k 22.2% Add-ons Software › Add-ons $90k 4.9% Onboarding Services › Onboarding $120k 6.5% Training Services › Training $80k 4.3% Support Services › Support $150k 8.1% Devices Hardware › Devices $180k 9.8% Accessories Hardware › Accessories $60k 3.3% Templates Marketplace › Templates $70k 3.8% Plugins Marketplace › Plugins $55k 3% Themes Marketplace › Themes $30k 1.6% Charts5 stylesProTreemapTreemap for the parts of a hierarchy: squarified, nested with group headers, or as an icicle.Bar chart, 12 points from Jan to Dec. Revenue from $32.0k to $58.0k, lowest $32.0k, highest $58.0k; Expenses from $18.0k to $35.0k, lowest $18.0k, highest $38.0k. Revenue and expenses, data table month Revenue Expenses Jan $32.0k $18.0k Feb $41.0k $22.0k Mar $38.0k $27.0k Apr $47.0k $24.0k May $44.0k $30.0k Jun $52.0k $28.0k Jul $49.0k $34.0k Aug $55.0k $31.0k Sep $51.0k $36.0k Oct $46.0k $33.0k Nov $53.0k $38.0k Dec $58.0k $35.0k Charts32 stylesProBar ChartBar chart for comparing values: grouped, horizontal, diverging, top-k and highlighted bars, with tooltip, keyboard navigation and a data table.