handleman
3/1/2016 - 1:24 PM

Accessing SVG path length in d3

Accessing SVG path length in d3

path.each(function(d) { d.totalLength = this.getTotalLength(); })
    .attr("stroke-dasharray", function(d) { return d.totalLength + " " + d.totalLength; })
    .attr("stroke-dashoffset", function(d) { return d.totalLength; })