Skip to content

Instantly share code, notes, and snippets.

@ashnur

ashnur/q.js Secret

Created February 2, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashnur/a99a08ea787cb0147669803b31bb9da5 to your computer and use it in GitHub Desktop.
Save ashnur/a99a08ea787cb0147669803b31bb9da5 to your computer and use it in GitHub Desktop.
const simulation = d3.forceSimulation()
.force("center", d3.forceCenter(width / 2, height / 2))
.force("link", d3.forceLink().distance(50).strength(0.02))
.force("collide", d3.forceCollide(5))
.force("charge", d3.forceManyBody().distanceMin(20).strength(-1))
.force("boxed", limitToScreen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment