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)
Prop | Description | Default |
---|---|---|
markers | MarkerElement[] | |
data * | any | |
fill | string | rgba(255, 255, 255, 0.3) |
projection | Determines how the map transforms spherical geometry to planar geometry"mercator" | "natural-earth" | mercator |
id | Id of the chart.string | |
width | Width of the chart. If not provided will autosize.number | |
height | Height of the chart. If not provided will autosize.number | |
margins | Margins for the chart.Margins | |
className | Classnames for the chart.string | |
containerClassName | Classnames for the chart.string | |
style | Additional css styles.StyleHTMLAttributes<SVGSVGElement> | |
center | Center the chart. Used mainly internally.boolean | |
centerX | Center chart on X Axis only. Used mainly internally.boolean | |
centerY | Center chart on Y Axis only. Used mainly internally.boolean |
MapMarker (opens in a new tab)
Prop | Description | Default |
---|---|---|
coordinates | [number, number] | |
index | number | |
cy | number | |
cx | number | |
size | number | 3 |
tooltip | any | |
onClick | () => void | () => undefined |