d3-force icon indicating copy to clipboard operation
d3-force copied to clipboard

d3.forceCollideRect?

Open martgnz opened this issue 6 years ago • 4 comments

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?

martgnz avatar Jan 03 '18 10:01 martgnz

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

vasturiano avatar Jan 08 '18 08:01 vasturiano

@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.

martgnz avatar Jan 10 '18 15:01 martgnz

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

Fil avatar Jun 25 '20 15:06 Fil

Also related: d3fc-label-layout

curran avatar Jun 25 '20 18:06 curran