Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can transition the stroke-dasharray property and use element.getTotalLength to determine the total length of the path. Here’s a bl.ock:

http://bl.ocks.org/mbostock/5649592

And here’s an older graphic that demonstrates the technique in use:

http://www.nytimes.com/interactive/2013/02/20/movies/among-t...

We also used this technique to render the progress map in The Russia Left Behind:

http://www.nytimes.com/newsgraphics/2013/10/13/russia/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: