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

Edge labels create additional node layers and inconsistent spacing between node layers #1092

Open
keyserj opened this issue Nov 19, 2024 · 3 comments
Labels
bug Erroneous behaviour. new feature A new feature.

Comments

@keyserj
Copy link

keyserj commented Nov 19, 2024

Describe the bug
When edge labels are included in layout, they can result in more node layers and different amounts of space between node layers (elklive):
image

I want my edge labels to avoid collision, but the diagram feels more chaotic with a larger number of node layers as well as inconsistent spacing between node layers.

Presumably this happens because edge labels are treated like nodes for layout, and so can either have their own layers or share layers with nodes. I'm not sure how this can be implemented differently - perhaps node layers could be determined first, then edge labels could be added, and allowed to be in half-layers e.g. layer 1.5/2.5 ?

ELK Version
Snapshot/0.9.1

Additional context
Without addressing this, I will likely expose a config in my app to allow users to choose whether or not to include labels in layout, so they can use their best judgment as to whether avoiding label collisions is worth the extra node layers/inconsistent spacing.

Also I respect if this seems not worth implementing - it seems like edge label layout logic could have to change a lot.

Somewhat related kieler/elkjs#308

@keyserj keyserj added the bug Erroneous behaviour. label Nov 19, 2024
@keyserj
Copy link
Author

keyserj commented Nov 19, 2024

Another idea: maybe instead of putting edge labels in half-layers, logic would be easier if node layers were determined and then doubled, with edge labels then able to fit in between.

@soerendomroes
Copy link
Contributor

Hi, if I remember correctly, the network simplex layerer aims to somehow balance the position of nodes, which may be undesired in your case.
Have you tried the much simpler LONG_EDGE_SOURCE layerer, as seen here? It works well for digraphs with only one source node.

I mark your label layers idea as a feature request since it might be benefitial to have more specialized layers or intermediate processes which might add the labels.

@soerendomroes soerendomroes added the new feature A new feature. label Nov 20, 2024
@soerendomroes soerendomroes added this to the Release 0.10.0 milestone Nov 20, 2024
@keyserj
Copy link
Author

keyserj commented Nov 20, 2024

Have you tried the much simpler LONG_EDGE_SOURCE layerer, as seen here? It works well for digraphs with only one source node.

Oh I hadn't tried that, thanks for the suggestion. It seems to do well in some cases, but unfortunately has some issues in others. I changed the elklive to be closer to a realistic case for my app, rather than a minimal reproduction:

  1. I added a few nodes in a way that my app may have them - basically can have problem nodes at the top of the diagram with effect nodes spanning out below those, and solution nodes at the bottom of the diagram with effect nodes spanning out above those. Then any problem/effect can be "addressed by" (edge) any solution/effect.
  2. I added a few more settings that my app currently uses

Here is the (elklive) that shows some issues:
image

  1. when partitioning is on with the new set of nodes, the issue of inconsistent spacing between layers persists
  2. when partitioning is off, the "long edge" you warned about becomes an issue

keyserj added a commit to amelioro/ameliorate that referenced this issue Nov 24, 2024
so that they avoid each other.

wanted to always do this (i.e. without an option), but ELK treats labels
as nodes, creating inconsistent spacing between node layers, and
creating more node layers total.

this sometimes results in more-chaotic layouts than otherwise, so an
option is added for it.

see eclipse/elk#1092 for more information.
keyserj added a commit to amelioro/ameliorate that referenced this issue Nov 24, 2024
so that they avoid each other.

wanted to always do this (i.e. without an option), but ELK treats labels
as nodes, creating inconsistent spacing between node layers, and
creating more node layers total.

this sometimes results in more-chaotic layouts than otherwise, so an
option is added for it.

see eclipse/elk#1092 for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Erroneous behaviour. new feature A new feature.
Projects
None yet
Development

No branches or pull requests

2 participants