How to make the down arrow start from the group package bottom border rather than right border in a coponent diagram?

0 votes
asked Nov 4 in Question / help by twk233 (120 points)

A demo plantuml code is here

@startuml demo
package group1 {
    package group12 {
        component A
        component B
        A --> B
    }
}

package groupA {
    package groupAA
}
group1 --> groupA

@enduml

Actually, groupA is to the right of group1, but because gorupA is smaller than group1, its position is lower than group1. The arrow starts from the right edge of group1 and points diagonally downward to groupA.
But what I want is that gorupA is completely below group1. Then the arrow from group1->groupA should start from the bottom edge of group1 and point vertically downward to the upper edge of groupA.

2 Answers

0 votes
answered Nov 4 by The-Lu (74,900 points)

Hello T.,

In fact that depends of the Graphviz version, here is an attempt with smetana (the internal port of graphviz in plantuml) [on V1.2024.6]:

@startuml demo
!pragma layout smetana
left to right direction

package groupA {
    package groupAA
}

package group1 {
    package group12 {
        component A
        component B
        A -l-> B
    }
}

group1 -l-> groupA

@enduml

If that can help,
Regards,
Th.

0 votes
answered Nov 10 by kirchsth (7,140 points)

Hello twk233,

an alternative answer (but I don't know if it works in all scenarios):
The length of the arrow defines the "layer".  "A - - > B" (spaces added that it is simpler to read) produces already second "layer". Therefore if groupA  should be below B you need a third "layer" which you can create with "group1 - - - > groupA" .

BR Helmut


(image is linked with the source) 

...