Wednesday, July 10, 2019

PlantUML tricks


I've bee using plantuml a lot to draw various diagrams.  Here are a few tricks I've picked up.

Increase the size of the image

# define PLANTUML_LIMIT_SIZE to increase max size
java -DPLANTUML_LIMIT_SIZE=1024000 -jar plantuml.jar > png

Reading from pipe

grep “xxx” puml | java -jar plantuml.jar -pipe > png

Increase node separation or rank separation

@startuml
skinparam nodesep 10
skinparam ranksep 20

Notes on the same rank

@startuml
!pragma teoz true
note over a: hi
/ note over b: yea
/ note over c: yo
a -> b: x
& b -> c: y
@enduml

Arrows on the same rank

@startuml
!pragma teoz true
a -> b: x
& b -> c: y
@enduml

Rank is set automatically based on line length.

->  is same rank

--> is one rank lower

---> is 2 rank lowers

You can use -[norank]> to create arrows between nodes that will be always on same rank independent of length.


No comments:

Post a Comment