Selected regions

You can highlight regions using `selectedKeys` and specify a style for selected regions.

You also have to pass `key` or `key_alt` (see basic props for an examplation of these)

Choose an example

Usage

<ChoroplethG
  {height}
  {width}
  key='iso_a2'
  theme={{
    defaultFill: 'palegreen',
    defaultStroke: 'red',
    deselectedOpacity: 0.5,
    selectedStroke: 'palegoldenrod',
    selectedStrokeWidth: 4
  }}
  topojson={world_110m_iso_a2}
  topojsonId='countries'
/>

Props

key

    "iso_a2"

theme

    { defaultFill: "palegreen" ,defaultStroke: "red" ,deselectedOpacity: 0.5 ,selectedStroke: "palegoldenrod" ,selectedStrokeWidth: 4 }
    • defaultFill: "palegreen"
    • defaultStroke: "red"
    • deselectedOpacity: 0.5
    • selectedStroke: "palegoldenrod"
    • selectedStrokeWidth: 4

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"