Whilst I wouldn't want to animate every line, it can be useful on certain occasions to illustrate growth / decline, direction or geographical movement. In this situation we're using population projections that can go in all sorts of different directions depending on the underlying assumptions made. The animatelines function below shows how to animate a line by modifying the stroke-dash & stroke-dashoffset properties of a line.
forked from fryford's block: Animating a single line & multiple lines
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js