This demo inspired by z-m-k, where I have make it as a reuseable modular and fix a trival statistics problem.
You guys can generate many effects with the interpolation attribut, while I think step-after is most appropriate interpolation from the statistics perspective.
https://d3js.org/d3.v3.min.js