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 prefer a lower or higher layer when multiple layers work for a partition #303

Open
keyserj opened this issue Oct 18, 2024 · 1 comment
Labels

Comments

@keyserj
Copy link

keyserj commented Oct 18, 2024

Ask your questions
I've got a diagram with some nodes being partitioned: elklive

There are a few instances here where multiple layers can work for the partitions that are selected - I want to add preference for which layer is chosen.

For the top portion of nodes, I want them to prefer being placed in a layer towards the top, and for the bottom portion of nodes, I want to prefer them being placed in a layer towards the bottom, like so:
image

ELK Version
snapshot (latest/0.9.1?)

Additional context
The alignment option got me excited, but I think that's intended for aligning nodes within a layer (e.g. when nodes vary in size).

I also thought the nodePromotion.strategy might work with a parent node around the top portion with MODEL_ORDER_LEFT_TO_RIGHT and a parent node around the bottom portion with MODEL_ORDER_RIGHT_TO_LEFT... right to left seems to make the nodes prefer the bottom layer, but MODEL_ORDER_LEFT_TO_RIGHT throws a runtime exception. I didn't make this ticket a bug for that because I'm unsure if I'm using it as intended - when I delete most of the bottom portion nodes, LEFT_TO_RIGHT stops erroring but doesn't seem to make them prefer the top layer (elklive - I'd expect c2 to be in same layer as c1, also maybe a separate issue but x1 should be below x12).

@soerendomroes
Copy link
Member

The model order node promotion strategies are somehow different than the other promotion strategies and require certain constraint to be true such that edges only lead to nodes that are defined below the target node or are backward edges.

Partition works by trying to add nodes with the same partition in the same layer and moving nodes to succeeding layers if this is not possible.
The other way around: if it is possible to put the nodes of the same partition in the same layer, it will happen.

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