I have an on click event on my rectangles but in some places, I can't select them because other shapes overlapping them. I can identify all my shapes somehow, f.e. by ID, etc.
Can I somehow click trough shapes to select the underlying shape, like with attribute pointer-events = none for text? Or put my rectangles on top of everything else?
I append my paths from a single Geojson-file like this:
svgContainer.selectAll(null)
.data(feat.features)
.enter()
.append("path")
.attr("d", path)
.attr("stroke", "black")
.attr("stroke-width", 0.1)
.attr("fill", "none")
.attr("PENr", function (d) {
return d.properties.Nr
})
.attr("myID", function (d) {
return d.properties.ID;
})
.style("pointer-events", "visible")
.on("click", click);