d3.js Map () Auto Fit into Parent Container and Resize with Window
COMPLETE SOLUTION: Here’s the solution which will resize the map AFTER the user has released the edge of the window to resize it, and center it in the parent container. <div id=”mapContainer”></div> function draw(ht) { $(“#mapContainer”).html(“<svg id=’map’ xmlns=”http://www.w3.org/2000/svg” width=”100%” height=”” + ht + “”></svg>”); map = d3.select(“svg”); var width = $(“svg”).parent().width(); var height = ht; … Read more