Skip to content

Conversation

Leooo
Copy link

@Leooo Leooo commented Jun 29, 2025

It is quite hard currently to understand large sequence diagrams created using Structurizr, as the participants are not grouped by parent.

This PR is starting to resolve this. It may also be a first step towards adding more advanced sequence diagram features relevant to C4 in the future, e.g. allowing to collapse or expand sequence diagram participants using element parents.

  • group components in Plantuml structurizr sequence diagrams by parent containers and by grand-parent software systems.

  • group containers in Plantuml structurizr sequence diagrams by parent software systems.

  • group elements in Plantuml structurizr sequence diagrams by parent groups.

  • add plantuml.teoz property to allow nested boxes in sequence diagrams - see teoz layout engine details here

  • styling of parent and grand-parents on sequence diagrams uses what is defined in styles object

First example (components grouped by containers then softwareSystem):

After changes in this PR - the elements with the same parent (f, g and h) are now grouped while they were not before. Both parent and grand-parent elements are shown. Any group is also shown

Screenshot 2025-10-04 at 15 24 24

Second example (containers grouped by software systems):

After changes in this PR - the parents Software Systems of the container participants are shown:

Screenshot 2025-10-02 at 11 20 21

Third example

After changes - elements belonging to the same container are grouped:

Screenshot 2025-09-26 at 14 38 07 Screenshot 2025-09-26 at 14 48 00

Possible extensions / improvements to this PR - to be discussed

  • add the changes proposed in this PR under a property flag to be backward compatible.
  • ensure that, inside a given parent box, the order of steps mirrors the order they were declared (in the first example above the participant f is not the first anymore).

@Leooo
Copy link
Author

Leooo commented Jun 30, 2025

Should resolve #398

@simonbrowndotje
Copy link
Contributor

Thanks for this - I saw your message on LinkedIn. I would pause on the PR at the moment because there are still some issues with the exporters that need resolving, specifically related to elements being rendered outside of their boundaries (this happens with the Structurizr UI too, so both need to be resolved before the next major release).

The re-ordering of elements on sequence diagrams when grouped also needs some thought. In the short-term, I'd recommend forking the exporter and building your own version if you need this functionality now.

@Leooo Leooo changed the title Group participants by parent in plantuml structurizr seq diagrams Group participants by parent in plantuml structurizr seq diagrams - MERGE BEING FIXED Sep 26, 2025
@Leooo Leooo changed the title Group participants by parent in plantuml structurizr seq diagrams - MERGE BEING FIXED Group participants by parent in plantuml structurizr seq diagrams Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants