Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlantUml define relative position of components

Tags:

plantuml

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, ...

like image 830
Moerwald Avatar asked Jul 14 '17 12:07

Moerwald


People also ask

How do you align PlantUML?

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.

How do you use Alt in PlantUML?

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.

What is PUML file?

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 .


1 Answers

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 

enter image description here

See also How to correct PlantUML Line Path for more positioning tips.

like image 168
Peter Uhnak Avatar answered Sep 21 '22 11:09

Peter Uhnak