allwi
allwi

Reputation: 101

PlantUML: How to change diagram style

for a while I'm using PlantUML to create sequence diagram. Everything works fine ... but looked a bit boring and "geek"-like.

So I google for nice sprites and found PlantUML Icon-Font Sprites on GitHub. I included the sprites successfully in my sequence diagram but as soon as I used them, I got a syntax error. After some investigation, I discovered that PlantUML tries to create state diagrams and certain elements of the sequence diagram (like the separator) are not valid.

So my two questions:

  1. How does PlantUML decide which diagram type to draw?
  2. How can I change this to sequence diagrams?

Example

@startuml
!pragma teoz true
skinparam defaultTextAlignment center

!include puml-icons/common.puml
!include  puml-icons/font-awesome-5/user.puml

hide footbox
/'FA5_USER(Alice, Alice)
FA5_USER(Bob, Bob)'/

Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml

Sequence diagram

@startuml
!pragma teoz true
skinparam defaultTextAlignment center

!include puml-icons/common.puml
!include  puml-icons/font-awesome-5/user.puml

hide footbox
FA5_USER(Alice, Alice)
FA5_USER(Bob, Bob)

Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml

enter image description here

Upvotes: 2

Views: 3504

Answers (1)

Paul Verest
Paul Verest

Reputation: 64012

See How can a PlantUML document specify its diagram type?

And Examples on https://plantuml.com/commons that gives an idea how PlantUML decides what diagram to generate.

You can use hidden elements of specific type, like component for deployment diagram, to point PlantUML into right direct, when there is mix.

Upvotes: 0

Related Questions