This example elaborates on the previous one by adding an attraction force towards arbitrary points, using d3-force-attract by Eric Socolofsky. The plugin, as well as various other useful insights on how to use d3 v4 force layout, is described in this post on hi.stamen.
https://d3js.org/d3.v4.min.js
https://d3js.org/d3-selection-multi.v0.4.min.js
https://unpkg.com/d3-force-attract@latest