Forcing angle in crystalline structure #3509
Unanswered
fabiospampinato
asked this question in
Q&A
Replies: 1 comment 1 reply
-
There's d3-bboxCollide already available which in theory could partially address the problem, but I couldn't get it to work at all, possibly the only option is to patch the built-in collision force for this, hopefully detecting overlapping hexagons isn't too much of a pain in the ass to code. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there, I'm using d3-force for a little simulation where nodes have labels attached to them visually.
The problem is that if nodes happen to align ~horizontally then those labels are really crammed in there visually:
While if nodes are aligned ~vertically labels are laid out much better:
Those two crystalline (?) structures are both hexagonal, but basically the difference is that if the pointy tips of the hexagon are aligned vertically the thing looks great, while if they are aligned horizontally the thing looks pretty bad.
What would be the best way to force the pointy tips to align vertically? I'm thinking that maybe I should change the collision force, since the default one expects point-like masses, should that work? If so is there some already-done alternative collision force that I could use for this?
Beta Was this translation helpful? Give feedback.
All reactions