d3 / d3-force

Force-directed graph layout using velocity Verlet integration.
https://d3js.org/d3-force
ISC License
1.81k stars 376 forks source link

d3.forceCollideRect? #110

Open martgnz opened 6 years ago

martgnz commented 6 years ago

While making cartograms I'm finding that the collide function of this block works much better than just using d3.forceCollide, as it seems to be made for squares rather than circles with a certain radius.

Is there a way to emulate its behaviour with the current forces available? If not, does it make sense to have it inside d3-force in some form?

vasturiano commented 6 years ago

@martgnz you may want to have a look at d3-bboxCollide. That force plugin aims to solve exactly what you're describing.

martgnz commented 6 years ago

@vasturiano Great find! Thanks, I'll try it.

But I still think that it makes sense to have this force inside d3 in some form or another.

Fil commented 4 years ago

Related: https://github.com/mapbox/polylabel/pull/63

curran commented 4 years ago

Also related: d3fc-label-layout