Human_BetaRelease
Human_BetaRelease

Reputation: 327

PlantUML: Packages next to each other, components in a list

I want to have 2 packages next to each other and the containing components among each other. Goal (Draft):

enter image description here

Code:

@startuml
left to right direction 
() Mechanical
() Hydraulical
() Electrical
package Machine{
    Mechanical )-left- [Turning Disc]  
    Mechanical )-left- [Vent]
    Electrical )-left-[Baler_ECU]
    Hydraulical )-left-[Arm] 
}

package Tractor{
    [Engine] -right- Mechanical
    [Hydraulics] -right- Hydraulical
    [Tractor_ECU] -right- Electrical
}

@enduml

Current Result of this code: enter image description here

Thank you for any help

Upvotes: 1

Views: 1469

Answers (1)

arif dwiyanto
arif dwiyanto

Reputation: 31

Try to use "hidden" attribute

@startuml
left to right direction 

rectangle interface{
    () Mechanical
    () Hydraulical
    () Electrical
}

package Machine{
    Mechanical )-- [Turning Disc]  
    Mechanical )-- [Vent]
    Electrical )--[Baler_ECU]
    Hydraulical )--[Arm] 
}

package Tractor{
    [Engine] -- Mechanical
    [Hydraulics] -- Hydraulical
    [Tractor_ECU] -- Electrical
}

interface -[hidden]- Machine
Tractor -[hidden]- interface
@enduml

enter image description here

Upvotes: 3

Related Questions