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

Some nodes with no edges are not being grouped with others. #367

Open
HaroldTexas opened this issue May 17, 2024 · 4 comments
Open

Some nodes with no edges are not being grouped with others. #367

HaroldTexas opened this issue May 17, 2024 · 4 comments

Comments

@HaroldTexas
Copy link

I'm using the MDS layout. Some but not all nodes with zero edges are being aligned to the right of the graph. Is this an known issue?
NodesWithZeroEdges

@levnach
Copy link
Contributor

levnach commented May 18, 2024

No, it is not a known issue. It is really not clear where to put the isolated nodes. For other nodes their neighbors help in positioning. The only constraint for the disjoint nodes is to avoid the overlaps. Do you have a suggestion?
I looked more carefully at the drawing and noticed the node in the left upper corner. If you lamp this not together with all other isolated nodes then the aspect ratio of the graph bounding box will be more than the current one. There's a packing algorithm that packs all connected components into a box, and tries to create this box with golden ratio. Every isolated node is a connected component: this explains the layout I believe.

@HaroldTexas
Copy link
Author

If I leave off all the nodes that do not have an edge the bounding box is much smaller and the box sides are close to the nodes (small margin). So, there appears to be logic to increase the size of the bounding box so the edgeless nodes can be placed along the side. I'm thinking that logic could use the largest width of edgeless nodes (the height would be adjusted to keep the golden ratio). This would allow all the edgeless nodes to fit along the side. However, the sheer number of those nodes could run into a height issue. So, the height may have to be increased to handle the number of nodes. Although, there appears to be current logic that combines smaller nodes on the same line to prevent so many lines. Definitely not a simple problem.

@levnach
Copy link
Contributor

levnach commented May 19, 2024

Please try the following : shorten the labels of the isolated nodes in the left top corner. You can modify them as "First string\nSecond string". It will improve the layout I believe.

@HaroldTexas
Copy link
Author

The layout is not always the same. Sometimes the nodes in the top left are shorter then ones along the right edge. I changed the layout packing method to columns. This prevented edgeless nodes from being placed on the same line. I'm not sure why the packing algorithm is creating 2 packages. There appears to be plenty of room along the right edge.

image

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

No branches or pull requests

2 participants