circles = {
const circles = gCircles
.selectAll("circle")
.data(points)
.enter()
.append("circle")
.attr("cx", (f) => projection(f.geometry.coordinates)[0])
.attr("cy", (f) => projection(f.geometry.coordinates)[1])
.attr("fill", (f) => "url(#patt_" + f.properties.id + ")")
.attr("stroke", "#666")
.attr("stroke-width", "1")
.on("mouseover", function (e, rg) {
d3.select(this).attr("stroke", "#333").attr("stroke-width", "3");
gD.selectAll("*").remove();
gD.append("text").text(rg.properties.na).style("font-weight", "bold");
for (let i = 0; i < icdCodes.length; i++) {
const c = icdCodes[i];
gD.append("text")
.text(c + " - " + ICDdata[rg.properties.id][c].toFixed(1) + " %")
.attr("x", 0)
.attr("y", 20 + 20 * i);
}
gD.attr("visibility", "visible");
})
.on("mouseout", function () {
d3.select(this).attr("stroke", "#666").attr("stroke-width", "1");
gD.attr("visibility", "hidden");
});
return circles;
}