Using tweening
Tween comes from the word inbetween, which is a common practice performed in the traditional animation where after key frames were created by the master animator, less experienced animators were used to generate frames in between the key frames. This phrase is borrowed in modern computer-generated animation and refers to the technique or algorithm that controls how the inbetween frames are generated. In this recipe, we will examine how the D3 transition supports tweening.
Getting ready
Open your local copy of the following file in your web browser:
https://github.com/NickQiZhu/d3-cookbook-v2/blob/master/src/chapter6/tweening.html
How to do it...
In the following code example, we will create a custom tweening function to animate a ...
Get Data Visualization with D3 4.x Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.