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

[Question] How to add edge labels without increasing space between layers? #308

Closed
keyserj opened this issue Nov 13, 2024 · 2 comments
Closed
Labels

Comments

@keyserj
Copy link

keyserj commented Nov 13, 2024

Ask your questions
I want to add labels to my layout so that they can avoid overlap, but I don't want to unnecessarily increase the space between node layers when I do so. Is there a way to do this?

Here is a simplest reproduction: elklive. If you remove the edge label, the spacing.nodeNodeBetweenLayers is respected, but with the label, the spacing is much more.

Without edge label vs with:
image image

I tried setting a bunch of label-related spacing options, and the label's size to [0, 0], to no avail (see elklive above). I also noticed that it seems like the edge label acts similar to a new node layer. That would explain why no spacing options affects this, but that's not ideal for me.

(Optional) ELK Version
ELK snapshot/0.9.1

@Eddykasp
Copy link
Collaborator

Your observation that they act like nodes is correct. During the layout edge labels are treated as nodes and laid out as such.

Depending on what your graphs generally look like, nodeNodeBetweenLayerSpacing may be helpful for you.

@keyserj
Copy link
Author

keyserj commented Nov 14, 2024

Thanks @Eddykasp for clarifying!

I was able to halve my nodeNodeBetweenLayers (since there will be a label between all nodes, doubling the layers) and set the label height to 0.001 (I guess zero results in some default value in the elklive), here's the elklive with it working.

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

No branches or pull requests

2 participants