Docs
📊 ⏐ Charts
Map

Map

A Choropleth Map in REAVIZ is a thematic map where areas are shaded or patterned in proportion to the measurement of a statistical variable, such as population density or per-capita income. This map type makes it easy to visualize how a measurement varies across a geographic area or shows the level of variability within a region.

When to use:

  • Visualize Geographic Data: Ideal for displaying data that varies across different regions.
  • Show Regional Patterns: Useful for highlighting regional patterns and differences.
  • Analyze Demographic Data: Great for analyzing data such as population density, income levels, or election results.

Quick Start

To get started with the map chart, you need to add some extra depedencies to your application:

  • topojson-client
  • world-atlas

Making these extra make it the bundle smaller and gives you more control of what data you import into your chart.

In the above example, we can pass an array of MapMarkers which contain longitude and latitude coordinates for the location. Optionally, a tooltip can be defined on hover.

Examples

API

Map (opens in a new tab)

PropDescriptionDefault
markers
MarkerElement[]
data *
any
fill
string
rgba(255, 255, 255, 0.3)
projectionDetermines how the map transforms spherical geometry to planar geometry
"mercator" | "natural-earth"
mercator
idId of the chart.
string
widthWidth of the chart. If not provided will autosize.
number
heightHeight of the chart. If not provided will autosize.
number
marginsMargins for the chart.
Margins
classNameClassnames for the chart.
string
containerClassNameClassnames for the chart.
string
styleAdditional css styles.
StyleHTMLAttributes<SVGSVGElement>
centerCenter the chart. Used mainly internally.
boolean
centerXCenter chart on X Axis only. Used mainly internally.
boolean
centerYCenter chart on Y Axis only. Used mainly internally.
boolean

MapMarker (opens in a new tab)

PropDescriptionDefault
coordinates
[number, number]
index
number
cy
number
cx
number
size
number
3
tooltip
any
onClick
() => void
() => undefined