In a force layout, I'd like to slow down the animation when two distant nodes are linked.
For example: if I have 2 nodes that are 400px apart and a link is established between them (after the inital tick has completely cooled down), I'd like to link to start at 400px and then animate down towards say 100 (or as standard link distance is set).
You can set the linkStrength to a lower value to make the linking less abrupt. Like so:
force.linkStrength(0.1);
linkStrength is a value between 0 and 1. https://github.com/mbostock/d3/wiki/Force-Layout#linkStrength
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With