Skip to content

Instantly share code, notes, and snippets.

@devjoca
Created April 9, 2021 04:05
Show Gist options
  • Save devjoca/b13262f6e3ad293d910fdef2643c3079 to your computer and use it in GitHub Desktop.
Save devjoca/b13262f6e3ad293d910fdef2643c3079 to your computer and use it in GitHub Desktop.
const simulation = d3
.forceSimulation()
.force(
"link",
d3
.forceLink()
.id(function (d) {
return d.name;
})
.strength(0.015)
.distance(15)
)
.force("charge", d3.forceManyBody().strength(-400))
.force('collide', d3.forceCollide()
.radius(1))
.force("center", d3.forceCenter(width / 2, height / 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment