This is a basic implementation of D3's force layout, a.k.a. d3-force, in version 4.
For more information on the various forces available in D3 v4, see Steve Haroz's d3-force testing ground.
forked from HarryStevens's block: Force Simulation
https://d3js.org/d3.v4.min.js