PlantUml define relative position of components

Viewed 56018

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

2 Answers

You can follow guidelines from here: Layout of grouping component

In general when you write connections like -> you just have to know that there is special notation for right arrow, left arrow, bottom arrow, top arrow: This has special meaning for plantUml:

 -l->
 -r->
 -u->
 -d->

It means to place arrow on the left or right or up or down if possible.

Lets imagine this diagram:

@startuml
node "My system" {
  [A] -> [B]
  [C] -> [B]
}
@enduml

Not good placement

This looks horrible, you can fix this by directing PlanUml with arrow directions.

@startuml
node "My system" {
  [A] -d-> [B]
  [C] -r-> [B]
}
@enduml

Will generate this:

Good placement

Related