Search code examples
d3.jsstroketopojson

Stroke rendering inside of Topojson area. How to change the style of the full shape?


I am having an issue with changing the stroke of an individual element in a Topojson file where my mouseover is not altering the stroke of the full shape.

A visual is probably best:

enter image description here

I would like every border element from the county shape area to receive the same stroke on mouse-over. Instead, I am getting this odd effect where only part of the border changes stroke.


Solution

  • I ended up using a solution like this, referenced here.

    .on("mouseover", function(d,i) {
        d3.select(this.parentNode.appendChild(this)).transition().duration(300)
            .style({'stroke-opacity':1,'stroke':'#F00'});
    })