Projection

You can provide a projection function either by passing `projectionFn` or by choosing among some of the projections provided by `d3-geo` by passing a `projectionId` choosing among the ids below.

Azimuthal projections:

• `geoAzimuthalEqualArea`

• `geoAzimuthalEquidistant`

Equal-Earth projections: `geoEqualEarth`

Cylindrical projections

• `geoEquirectangular`

• `geoMercator`

• `geoNaturalEarth1`

You can also pass a precomputed `projection`, useful when you need to share a projection with other components: this won't be affected internally and will be used as given.

If you don't pass `projection`, `projectionFn` or `projectionId`, the default projection is `geoEquirectangular`.

In other words, the order of precedence here is: `projection`, `projectionFn`, `projectionId`, default.

Choose an example

Usage

<ChoroplethG
  {height}
  {width}
  key='iso_a2'
  projectionId='geoAzimuthalEqualArea'
  topojson={world_110m_iso_a2}
  topojsonId='countries'
/>

Props

key

    "iso_a2"

projectionId

    "geoAzimuthalEqualArea"

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"