Fetch SVG size from HTML, instead of re-defining it in JS

master
Aadhavan Srinivasan 1 month ago
parent ec4f1ddca9
commit d438a91cdf

@ -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

Loading…
Cancel
Save