map = {
const height = 1250;
const projection = d3.geoMercator().fitExtent(
[
[0, 0],
[width, height]
],
depts_geojson
);
const path = d3.geoPath(projection);
const svg = d3
.create("svg")
.attr("id", "svg")
.attr("viewBox", [0, 0, width, height]);
const g = svg.append("g");
var features = g
.selectAll("path")
.data(depts_geojson.features)
.enter()
.append("path")
.attr("id", (d) => "d" + d.properties.code)
.attr("d", path)
.attr("fill", "white")
.attr("stroke", "black");
function zoomed(event) {
const {transform} = event;
g.attr("transform", transform);
g.attr("stroke-width", 1 / transform.k);
}
const zoom = d3.zoom()
.scaleExtent([1, 8])
.on("zoom", zoomed);
svg.call(zoom);
return svg.node();
}