Canvas version of this block by Mike Bostock, using the svg-path-properties library
This example demonstrates how to use the getTotalLength and getPointAtLength methods on SVG path elements using the svg-path-properties library to interpolate a point along a Catmull–Rom spline.
https://d3js.org/d3.v3.min.js