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, 2024 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, 2024 by The-Lu (89,080 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.

commented Jan 23, 2025 by twk233 (120 points)
You're right. It seems that graphviz is more concerned with the connection between nodes. If i want to control exactly which edge of the node the arrow starts from and what path it takes to reach which edge of another node, it seems that it is not so easy to do this with graphviz. plantUML is a re-encapsulation and use of graphviz, so it seems like things are getting more difficult.

In the end, perhaps I should choose something else on top of this matter. Anyway, thanks for pointing out that this has something to do with graphviz.
0 votes
answered Nov 10, 2024 by kirchsth (7,760 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) 

...