diff --git a/index.js b/index.js index 8f1f448..1ba6732 100644 --- a/index.js +++ b/index.js @@ -43,7 +43,9 @@ const colorMap = { const colors9 = ["#75d795", "#EFDFD8", "#D5F6FB", "#E5ECF8", "#F0EBD8", "#F7DFC2", "#B4D9EF", "#F8C57C", "#A4D8D8"] function drawMap(world) { - const projection = d3.geoMercator().fitSize([1000,600], world) + const mapWidth = document.getElementById("indiaMap").getAttribute("width") + const mapHeight = document.getElementById("indiaMap").getAttribute("height") + const projection = d3.geoMercator().fitSize([mapWidth, mapHeight], world) const path = d3.geoPath().projection(projection); // Draw the map