Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlantUML component diagam port

Is there any possible way to create component port in the component diagram?

If port has to be attached to only one arrow, its easy, because I can use #-- arrow.

interface y
[x] #- y

The problem is, if I try to attach to arrows to one port. I tried to use rectangle, but its not on the border then.

rectangle " " as P
[Component] - P

interface I1
interface I2

P - I1
P -- I2

Do you know any better workarounds?

like image 573
Patryk Cholewa Avatar asked Oct 19 '19 22:10

Patryk Cholewa


1 Answers

Although a bit late for TO perhaps helpful for someone else.

I managed to create ports on components with the following approach:

@startuml
skinparam componentstyle uml2
left to right direction

component X {
    port " " as x_out
}

'u for layouting it more nicely, 0) for lollipop
x_out -u0)- [Y]
x_out -u0)- [Z]

@enduml

However I experienced a bad layout of the port itself, means when a component has several ports it will start looking messy. But hey at least its a port with multiple connections.

Result looks like:

enter image description here

like image 175
HaeschenaufGras Avatar answered Oct 10 '22 15:10

HaeschenaufGras