All examples By author By category About

sxywu

Animate Donut Chart

Developed while working with WalletIQ, inspired by mbostock's Arc Tween example. Exiting arcs are first animated out, then existing arcs are updated, and finally entering arcs are animated in.

My main goal for this exercise was to learn D3.v4, and in particular its new way of working with selections and transitions. I definitely didn't have the time to carefully read through the new changes, and it's apparent in my implementation of the chained transitions; it's important to note that this doesn't seem like the best way of chaining transitions, since if at any point the animation does not occur the next animation does not trigger. In particular, the animations do not start for the first 2 seconds, because the exit animations does not happen and the rest are not triggered. I will experiment more in the future.

Another great thing to note: along with Mike's example that this is forked from, there are many other arcTween examples, among some are:

https://twitter.com/yonester/status/753771544627728384 https://twitter.com/FournaiseThomas/status/753893453688365058 https://twitter.com/micahstubbs/status/753865966283436032 https://twitter.com/veltman/status/753959910656868352

--

forked from mbostock's block: Arc Tween