ValyroUI Русская версия

Map Chart

World map: choropleth and points, zoom and pan. Pro · Charts and analytics › Maps and matrices

World choropleth with point markers on an Equal Earth projection — no tiles, no network.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add map-chart
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { MapChart } from 'valyro-ui-pro';

Props

PropTypeDefault
dataMapChartDatum[][]One value per country; countries without one are drawn as "no data".
markersMapChartMarker[][]Points placed by longitude/latitude over the countries.
colorstring'var(--ui-chart-1)'High end of the color scale; any CSS color. Default --ui-chart-1.
lowColorstringLow end of the color scale. Default: a faint tint of color.
scale'linear' | 'log' | 'sqrt' | 'quantize''linear'linear blends continuously; log and sqrt spread skewed data (populations, traffic) across the ramp; quantize splits the domain into steps equal classes. Default linear.
stepsnumber5Classes of the quantize scale. Default 5.
domain[min: number, max: number]Values mapped to the ends of the scale. Default: the data's minimum and maximum.
valueFormatterValueFormatterFormats values in the tooltip, legend and data table; locale number formatting when omitted.
markerColorstring'var(--ui-chart-3)'Default --ui-chart-3.
heightnumberPlot height in px. Default: the world's aspect ratio at the current width.
zoomablebooleantrueZoom with ⌘/Ctrl + scroll, pinch, double-click, the +/− buttons and keys; drag to pan. Default true.
maxZoomnumber8Default 8.
showLegendbooleantrueColor scale under the map (class ranges or a gradient with ticks) plus the "No data" swatch.
onCountryClick(country: MapChartCountry) => voidClick or Enter on a country.
onMarkerClick(marker: MapChartMarker) => voidClick or Enter on a marker.
localestringBCP 47 locale for country names and numbers. Default: the ThemeProvider locale, then the browser's.
labelsPartial<MapChartLabels>Overrides for the built-in English text; keys left out keep their defaults.
ariaLabel *stringAccessible name of the map (also the caption of its sr-only data tables).

Related components

Previous: Heatmap · Next: Tile Map · All Charts and analytics