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.