I'm actually trying to generate a component diagram with PlantUml
. Is it possible to define the relative position of the different components? What I want to define is: ComponentB is left from ComponentA. ComponentC is below ComponentA, ...
When we want to text to be center aligned we simply use the new-line character \n . If we want to have our text left aligned we use \l instead of \n . And to right align the text we use \r . Written with PlantUML 1.2017.
You have to add an end statement to close the alt block. As a side note: You do not need to add the square brackets in your alt statements. PlantUML renders those itself.
File created by PlantUML, a UML diagram creator used within programs like Sublime Text Editor or programming language like HTML; same as the . PU file; contains code referenced by PlantUML to create diagram images that can be generated as . PNG or .
A typical approach is to mark a line as hidden.
One thing to keep in mind is that hidden
is only supported for left-to-right ->
, and top-to-bottom -->
lines, so you need to place the left and right side accordingly (syntax X <[hidden]- Y
doesn't seem to be supported).
@startuml class ComponentA ComponentB -[hidden]> ComponentA ComponentA -[hidden]-> ComponentC @enduml
See also How to correct PlantUML Line Path for more positioning tips.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With