A while ago, I had to create a bit more complex component diagrams than the simple ones I used to create in PlantUML.
Some links that helped me:
- Linking between packages:
- a
- Note I still do not understand why I cannot name a package like
cloud [Back Office] as BO { .... }
- Note I still do not understand why I cannot name a package like
- a
- Class diagrams have [WayBack]
package
styles (Node
,Rectangle
,Folder
,Frame
,Cloud,
Database
); component diagrams have various grouping keywords (package
,node
,folder
,frame
,cloud
,database
) which you can nest.- Note you can perform
[Component Description] as ComponentName
, but notdatabase [Database Description] as DatabaseName
.
- Note you can perform
- For a tool that does automatic lay-out, influencing the lay-out is always a bit of pain, see for instance:
- [WayBack] General and common command to handle graphic layout in diagrams.
- Comments (
'
),header
/footer
,scale
(for zooming),title
,caption
,legend
- via [WayBack] Restricting the width of diagrams – PlantUML Q&A
- Comments (
- [WayBack] PlantUml define relative position of components – Stack Overflow
- [WayBack] class diagram layout
together
andhidden
(only for left to right and top to bottom relations)
- [WayBack] class diagram layout
- [WayBack] PlantUML Pleasantness: Layout Elements With Hidden Lines – Messages from mrhaki:
' Layout Logging under BackendClient
BackendClient -[hidden]- Logging
- You can even
hide
components: [WayBack] Hide function in components diagrams – PlantUML Q&A - Lots of visual settings can be configured using
skinparam
as explained in [WayBack] Changing colors and fonts. - Even more advanced are
- [WayBack] templates/plantuml/class-diagram-tips.md – mark.george/templates: Controlling Class Lay-out as part of [WayBack] templates/plantuml at master – mark.george/templates and – next to many other tips – shows
NodeSep
andRankSep
like in [WayBack] It is possible to decrease gab between elements – PlantUML Q&A - [WayBack] PlantUML Pleasantness: Align Elements With Line Length – Messages from mrhaki (not 2 but 3 hyphens: –> into —> to push one level down); it has a few other nice more generic tips; see below.
- Some [WayBack] Class Diagram syntax and features can also be applied in [WayBack] Component Diagram syntax and features
- [WayBack] templates/plantuml/class-diagram-tips.md – mark.george/templates: Controlling Class Lay-out as part of [WayBack] templates/plantuml at master – mark.george/templates and – next to many other tips – shows
- Not sure I’m ready for this, as I have been living include file and macro nightmares in other environments: [WayBack] Use the preprocessor
- [WayBack] PlantUML in a nutshell: Open-source tool that uses simple textual descriptions to draw UML diagrams.
You can add notes:
- to elements at a certain position (using
note left of elementName
,note right of ...
, etc) - the position is only applied when the note is within the same group as the element (otherwise the position is not taken into account)
- you cannot add notes to groups, but the first added
note
(not bound to any element) is usually close to the group name: [WayBack] Note at package not class – PlantUML Q&A [Archive.is]
- to elements at a certain position (using
- [WayBack] Grouping and Positioning of Packages/Components: Having Issues – PlantUML Q&A: it is possible to link to/from packages, but their names need to be globally unique.
package PPP { [AAA] [BBB] }
package QQQ { [CCC] [DDD] } ' Linking between packages PPP --> QQQ 'Linking a component to a package AAA --> QQQ 'Linking a component to another component AAA --> CCC
- You can use UML2 style ([WayBack] Component Diagram syntax and features: components and interfaces look different),
but many people still like UML1 better:
UML2 style examples for skinparam
that are equivalent:
skinparam component { Style uml2 }skinparam { componentStyle uml2 }