My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do I make a D3 Geo Map Responsive

Emil Moe's photo
Emil Moe
·Feb 2, 2017

I have found this neat tool that helps me generate the map code to display the map: http://mapstarter.com/

If you click US states you get some demo data. If you then select the download tab the source code is provided.

My question is, how much does it take to make the map responsive to the box it's put within? I have been struggling, but I can't figure out how to define the height, width, scale, transition and center points. The map just disappears. If possible, I want to make it responsive to any map size, so I don't have to worry about the map I provide.