Skip to content

Group participants by parent in plantuml structurizr seq diagrams #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

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

First example (components grouped by containers):

source (new test).

Before changes in this PR:

plantuml:structurizr:groups-Sequence-Container puml(before)

After changes in this PR - the elements with the same parent (f, g and h) are now grouped while they were not before. Also both parent and grand-parent elements are shown:

Screenshot 2025-07-01 at 20 27 13

Second example (containers grouped by software systems):

source (new test).

Before changes this PR:

plantuml:structurizr:groups-Sequence-SoftwareSystem puml(before)

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

Screenshot 2025-07-01 at 20 29 54

Third example: component inside group inside container

source

Before changes in this PR:

Screenshot 2025-07-01 at 20 42 05

After changes in this PR - showing the group and the container:

Screenshot 2025-07-01 at 20 03 06

Fourth example

source

Note: also includes changes in this PR

Before changes in this PR:

Screenshot 2025-07-01 at 20 25 39

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

Screenshot 2025-07-01 at 20 24 07

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).
  • default styling of plantuml box - use styling of relevant group / container / systemSoftware defined in the workspace.

@Leooo
Copy link
Author

Leooo commented Jun 30, 2025

Should resolve #398

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.

1 participant