Creating visualizations like this one but using canvas is possible.
The technique is the same as when using it with SVG with the problem that Canvas hasn't got a method to get the whole length of a path. To do it, I've created a hidden SVG first. This other page has a nice explanation about how the SVG path animation work.
The path is the Trans Mongolian train route taken from here but redrawn, since the original is a multi line.
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://d3js.org/topojson.v1.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://d3js.org/topojson.v1.min.js