Basic props
In the most basic setup, you need to provide:
• `height`, `width`;
• `topojson`, the Topojson of regions to be represented, with `properties` having the a field corresponding to the prop `key`.
• `topojsonId`, the key to us to select items in the `objects` field inthe topojson; e.g. `NUTS` or `countries`.
The default projection (`geoEquirectangular`) will be applied.
Under certain conditions the chart shows a message that you can customize using the props `message`, `theme.messageColor` (default: black) and `theme.messageFontSize` (default: 1rem):
• if `topojson` is undefined or it has no objects;
• if you pass `projection` and it is `undefined`: this is an useful way to control the message if you know that the projection has been generated with a geojson with an empty `features` property.
Choose an example
Usage
<ChoroplethG {height} {width} topojson={world_110m_iso_a2} topojsonId='countries' />
Props
topojson
- { type: "Topology" ,objects: {…} ,arcs: Array(595) ,bbox: Array(4) ,transform: {…} }
- type: "Topology"
- objects: { countries: {…} ,land: {…} }
- arcs: (595) [ Array(9) ,Array(11) ,Array(5) ,Array(11) ,Array(9) , … ]
- bbox: (4) [ -180 ,-85.60903777459771 ,180 ,83.64513000000001 ]
- transform: { scale: Array(2) ,translate: Array(2) }
topojsonId
- "countries"