D3.JS - Library for SVG and Data Visualization
D3(https://d3js.org/) is some kind of accronym for Data Driven Documents. It i
The documentation of the API can be found in GitHub
I used it recently to create an animation of the Euclid's proof of the
Pythagorean Theorem. (http://bit.ly/2F9m7Ph).
In D3, you access an HTML DOM elenets using "d3.select" or "d3.selectAll";
the returned value is called a selection, and the selection can have more
properties than the DOM element.
On member function of the selection is "data".
The data has its methoda; let us list some:
- "enter" - handles new members.
- "exit" - handles removed member.
- "update" - handles changed members.
One more things is the "transition" that helps in creating animations.
You can set the duration of the animation and the attribute or style attribute
change. If the default interpolator function is not good enough, you can define
a custom one using "attrTween" or "styleTween". Your interpolator should
accept "t" for an arguments, and "t" changes its value gradually from 0 to 1,
like the famous "t" of the bezier curves.
Are you ready to try it?