Skip to Content

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Β 

NameTypeDefault
markersMarkerElement[]
dataany
fillstring

Fill color for countries.

'rgba(255, 255, 255, 0.3)'
projection"mercator" | "natural-earth"

Determines how the map transforms spherical geometry to planar geometry

'mercator'
idstring

Id of the chart.

widthnumber

Width of the chart. If not provided will autosize.

heightnumber

Height of the chart. If not provided will autosize.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

MapMarkerΒ 

NameTypeDefault
coordinates[number, number]
indexnumber
cynumber
cxnumber
sizenumber

Radius of the marker circle.

3
tooltipany
onClick() => void
Last updated on