Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision resolution should process nodes from smallest-to-largest. #24

Closed
mbostock opened this issue May 3, 2016 · 2 comments
Closed
Assignees

Comments

@mbostock
Copy link
Member

mbostock commented May 3, 2016

Currently it processes nodes in input order, which I believe makes it especially bad in the common case where nodes are ordered from largest-to-smallest. Since d3.forceCollide is told the radius function and computes an array of radii, it could create a sorted index at the same time.

It might be worth revisiting how multiple resolutions are combined at the same time.

@mbostock
Copy link
Member Author

mbostock commented May 3, 2016

Superseded by #25.

@mbostock mbostock closed this as completed May 3, 2016
@mbostock
Copy link
Member Author

mbostock commented May 4, 2016

It seems like a better solution is to bias the resolution by area, such that larger nodes (which are more likely to overlap many nodes) are moved less than smaller nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant