-
Notifications
You must be signed in to change notification settings - Fork 26
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
Prevent overlapping in tightly packed nodes #64
Comments
Each white node is a "cluster" of its own (along with red/blue neighbors). So you could create a compound node for each such cluster and put all associated nodes of a cluster in that compound node, then start fcose layout. If you don't want to see the compound nodes corresponding to each cluster, these compound nodes could be introduced temporarily prior to layout and removed right after layout is finished and before rendering starts. |
Thank you very much for this suggestion. Here is a screenshot of the situation with a compound node as suggested. |
Maybe you can try to give a high value for the idealEdgeLength for the edges between white nodes and low value for the other edges. I can obtain something like this with that approach (this is the sample code - I just changed idealEdgeLength option in your code): |
Thanks this is already much better! |
@poornima-taranath Try decreasing gravityRangeCompound and increasing gravityCompound |
Is there a way to get fcose to pack nodes really tightly but at the same time prevent overlap?
I'm trying to get something like this.
The white nodes can move where they want, but the blue/red nodes should be packed tightly around the white nodes.
I tried decreasing idealEdgeLength, which gets the nodes closer to each other (not enough) but this also increases overlap.
Here is some example code, a possible simplification is that the white nodes could be fixed in place with coordinate constraints, but then I still can't get the blue/red ones to pack tightly without overlap.
https://drive.google.com/file/d/1z9oOHxh_9Q0_qpeYFjoXv9ncZsv8dORj/view?usp=share_link
The text was updated successfully, but these errors were encountered: