minimum rank

0 votes
asked May 18, 2022 in Question / help by cgoguyer (400 points)
retagged May 19, 2022 by cgoguyer

Hello,

Is there a way to align components by minimum rank without using packages or together ? As the diagram is generated by script, I cannot use correctly these keywords.

For example I would like B,D,F,H on the same rank (as they are the first successors of A)

Here is the sample:

@startuml
rectangle A
rectangle B
rectangle C
rectangle D
rectangle E
rectangle F
rectangle G
rectangle H
rectangle I

A --> B
B --> C
A --> D
D --> E
E --> G
A --> F
F --> C
G --> C
A --> H
H --> I
I --> C
@enduml

I get that:

and I would like this:

1 Answer

0 votes
answered May 18, 2022 by The-Lu (60,440 points)

Hello C.,

For that you can use `-[norank]->`, as:

@startuml
rectangle A
rectangle B
rectangle C
rectangle D
rectangle E
rectangle F
rectangle G
rectangle H
rectangle I

A --> B
B -[norank]-> C
A --> D
D --> E
E --> G
A --> F
F -[norank]-> C
G --> C
A --> H
H --> I
I -[norank]-> C
@enduml

See initial request here:

Regards.

commented May 19, 2022 by cgoguyer (400 points)
edited May 19, 2022 by cgoguyer
Hello,

As my diagram is generated by script (and is more complex than the sample), is it too complicated to define where [norank] is applicable. Is there a way to have such behavior by default ?

Like "Hierarchical Topmost" layout in YED

Thank you.
...