New! Render PlantUML diagrams directly inside GitHub
with our official browser extension —
No server. No tokens. No tracking. Zero permissions but clipboard. —
Try it out and let us know what you think!
⚙ Layout Engines and Options
PlantUML allows you to use several different layout engines. The following 4 apply to most diagrams. See these 4 variants of a SAREF4CITY diagram for comparison (this is an RDF graph using the Smart Applications REFerence Ontology (SAREF) extension for Smart Cities). The source is example1-saref4city.puml and is generated from a Turtle file). The notes below are based on observing only these examples, so they are subjective.- Graphviz is the default engine. Relies on an external program
- Smetana. Use
!pragma layout smetanain the file or-Playout=smetanaon the command-line. A port of Graphviz to Java. Tends to make slightly straighter arrows - VizJs uses JavaScript. Use
-graphvizdot vizjson the command line. Tends to space out nodes more, resulting in a bigger diagram. - ELK (Eclipse Layout Kernel). Use
!pragma layout elkin the file or-Playout=elkon the command-line. Supports only orthogonal layout, and doesn't cover all features
- "puma" is the older and still default engine
- teoz is a new engine that has some unique features: anchors (named arrows/messages), duration, nested boxes. More features are in development (see teoz in the forum), eg parallel messages
- noditaa replaces
ditaawith java code. It's a beta release from 2019 that hasn't been updated
- #4418, #3111, #4045
!pragma svek_trace: savesdotandsvgfiles for debugging - #1343
!pragma aspect: aspect ratio. May be obsolete, sinceaspectis not found on the graphviz attrs page, and attrs-test is missing altogether. - #1226
!pragma ratio: aspect ratio. Currently seems broken: specifying two numbersm,ncauses graphviz error. - #977
skinparam nodesep: space between nodes in pixels. - #977
skinparam ranksep: space between node ranks. - #1608
skinparam linetype ortho: orthogonal layout (but label position is wrong, see plantuml/backlog#11) - #1608
skinparam linetype polyline: straight not curved edges - #4387 #5007
together: keep nodes next to each other - #3188
norank: edge doesn't count for the layout process - #8365
hidden: invisible edge that counts for the layout process - #4418, #1132, #3231, #3111, #3143
!pragma horizontalLineBetweenDifferentPackageAllowed: allow to make a horizontal line between packages. (Also see #1628 on layout of grouping components) - #1296
skinparam minClassWidth: make nodes not narrower than this - #1296
skinparam sameClassWidth: make all nodes the same width - #4637
skinparam minClassWidthon sequence diagrams - #2538
layout__new__linefor disconnected parts of a diagram - #3118
skinparam paddingandmarginfor title, footer, etc - #5493
skinparam ParticipantPaddingandskinparam BoxPadding: padding on sequence diagrams