simpleSVGMap = {
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", height);
svg
.append("g")
.selectAll("path")
.data(precinctGeometry)
.join("path")
.attr("fill", d => {
if (overlappingPrecincts.get(d.id)) {
return "seagreen";
} else {
return "lightgray";
}
})
.attr("d", d3.geoPath(projection));
svg
.append("g")
.selectAll("circle.centroid")
.data(pGeomCentroids)
.join("circle")
.classed("centroid", true)
.attr("fill", d => {
if (overlappingPrecincts.get(d.precinct)) {
return "black";
} else {
return "gray";
}
})
.attr("r", 5)
.attr(
"transform",
d => `translate(${projection(d.centroid.geometry.coordinates)})`
)
.attr("d", d3.geoPath(projection));
return svg.node();
}