How to create nested box in PlantUML?
Asked Answered
G

2

18

I cannot make a nested box in plantUML.

@startuml
box "B0" #LightBlue
 Bob -> Alice : hello
 Box "B1" #LightYellow
  Bob --> Cunny : hi
 end box
end box
@enduml

This gives an error that box cannot be nested.

Any other way to show nested box, like in layered diagrams?

Ganny answered 1/7, 2018 at 6:11 Comment(3)
Any luck with this?Proletarian
No luck yet. :(Ganny
Update: Mar/2021 issue was not addressed yet.Ilan
S
20

It seems it's still not supported: http://forum.plantuml.net/6304/please-add-box-and-or-participant-nesting-ability

You can up-vote the feature request.

Stheno answered 20/10, 2018 at 23:52 Comment(0)
P
7

It's been implemented and you can use it if you have v1.2022.0 or a newer release. The feature seems to be in an early stage and it needs the teoz engine.

Example:

@startuml
!pragma teoz true
box "component"
  box "sub1\n\n"
    participant a
    box "subsub1"
      participant suba
    end box
  endbox
  box "sub2"
    participant b
  endbox
end box
@enduml

Github issue for reference (The examples comes from here)

Pachton answered 22/9, 2022 at 14:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.