I dived into d3 force & d3.time recently. There are many examples using d3.time with forces together.
I understood d3.interval - which makes d3.timer loop run with comparaly slower pace than as it is.
However, I don't know why this code put d3.now() in the d3.interval. And don't know why there are two elements going on wihtin d3.interval one is 2000, and the other one is d3.now() .
Entier Code: https://jsfiddle.net/onw8v29g/
The point I got stuck.
d3.interval(function() {
nodes.push(c); // Re-add c.
links.push({source: b, target: c}); // Re-add b-c.
links.push({source: c, target: a}); // Re-add c-a.
restart();
}, 2000, d3.now() + 1000);
P.S I think the most daunting part while learning d3 is decoding the documentation. I recently started reading 'd3 indepth' which is very helpful to decrypt the official documentation. If you guys have other recommendations for understanding d3,please let me know as well.
Thank you.