Wednesday, 15 March 2023

PlantUML: Hide unlinked participants in a sequence diagram

All the participants are displayed in a diagram by default. If you do not want to display unlinked participants, you can use the command 'hide unlinked'.

 

normalFlow.txt

@startuml

participant sys1
participant sys2
participant sys3
participant sys4

sys1 -> sys2: M1
sys1 <- sys2: M2
sys1 -> sys2: M3

@enduml

 

Above snippet generate below diagram.

 

 


As you observe the above diagram, sys3, sys4 too displayed even though they do not have a linkage between other participants.

 

Let’s hide the unlinked participants.

 

hideUnlinkedParticipants.txt 

@startuml

hide unlinked

participant sys1
participant sys2
participant sys3
participant sys4

sys1 -> sys2: M1
sys1 <- sys2: M2
sys1 -> sys2: M3

@enduml

 

Above snippet generate below diagram.


 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment