elk icon indicating copy to clipboard operation
elk copied to clipboard

Can elk set the alignment of some components

Open zangchuan1989 opened this issue 4 years ago • 3 comments

This is a sample graph.

image

The red boxes in the picture are aligned vertically.

How to set it?

zangchuan1989 avatar Feb 09 '21 10:02 zangchuan1989

I'm not sure I understand the question. Do you like it this way and want to know how to force the same kind of alignment in other diagrams? Do you not like it this way and are looking for a way to change it?

le-cds avatar Feb 16 '21 19:02 le-cds

I want to get a way to align the nodes of the same type vertically

zangchuan1989 avatar Feb 20 '21 01:02 zangchuan1989

If it just concerns moving those nodes to the left or to the right of the diagram, the layer constraint option might be what you're looking for.

If you're looking for a more general solution, I'm afraid there is none. What you can try is to turn partitioning on and assign the same partition to the nodes that should be vertically align, but you'll have to assign partitions to all other nodes as well, which might not be what you want.

Another solution could be to wrap nodes that should be grouped into a subgraph, but that comes with its own layout problems.

le-cds avatar Feb 26 '21 19:02 le-cds