zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.12k stars 426 forks source link

Country drill down #124

Open MihaiLiviuGit opened 5 years ago

MihaiLiviuGit commented 5 years ago

A common use case is to drill down on a country to its subregions. I would like to be able to click on USA and view a choropleth map of it's states together with on hover tooltip. Is this possible?

akilkumar commented 5 years ago

A common use case is to drill down on a country to its subregions. I would like to be able to click on USA and view a choropleth map of it's states together with on hover tooltip. Is this possible?

+1

zimrick commented 5 years ago

I made a similar drill down experiment with a world map and a cantonal map of Switzerland a while back on codesandbox. It could provide some basis for what you are trying to do.

https://codesandbox.io/s/v653jj6oz3

With two topojson files it's still ok, but if you have more than that, you may have to prepare them to have standardised ids etc.