Attempt at simulation of multiple particles orbitting around each other in a hierarchical system (e.g. sun > planet > moon).
Uses D3 force-directed physics engine's forceLink to connect particles to their moving gravitational centers via fixed position anchor nodes.
The system fails to reach equilibrium due to the "spring" nature of forceLink, in which contrary to gravitational forces the intensity decreases with proximity, causing bodies to inevitably fall onto their attraction center. The forceMagnetic force is a better fit for modelling this type of motion.
Compare with the forceMagnetic version.
https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.0/d3.min.js