map = {
const svg = d3.create("svg").attr("width", width).attr("height", height);
const viz = svg.append("g");
const path = d3.geoPath(projection);
const outlinePath = viz
.append("path")
.datum(outline)
.attr("id", "outline")
.attr("stroke", "#aaa")
.attr("opacity", 1)
.attr("stroke-width", 1)
.attr("stroke-linejoin", "round")
.attr("fill", "#eee")
.attr("d", path)
.attr("pointer-events", "none");
const landPath = viz
.append("g")
.attr("id", "land")
.selectAll("path")
.data(ne_110m_land.features)
.join("path")
.attr("id", (d) => d.properties.formal_en)
.attr("d", path)
.attr("fill", "#fff")
.attr("fill-opacity", 1)
.attr("stroke", "#043B62")
.attr("stroke-alignment", "inner");
const poli = viz
.append("g")
.attr("id", "polygons")
.selectAll("path")
.data(hexPoligons.features)
.join("path")
.attr("d", path)
.attr("fill", "none")
.attr("fill-opacity", 1)
.attr("stroke", "red")
.attr("stroke-alignment", "inner");
const projCentroids = hexPoligons.features.map((d) =>
projection(d3.geoCentroid(d))
);
const cent = viz
.append("g")
.attr("id", "centroids")
.selectAll("circle")
.data(projCentroids)
.join("circle")
.attr("cx", (d) => d[0])
.attr("cy", (d) => d[1])
.attr("r", 5)
.attr("fill", "blue")
.attr("stroke", "none");
console.log(projCentroids);
return svg.node();
}