Mermaid: sequence diagram request: grouping actors in box

Created on 27 Jun 2020  Â·  4Comments  Â·  Source: mermaid-js/mermaid

Request Description

I'd love to be able to do this:

sequence diagram screenshot with box

More specifically, the "boxes" labeled "Application" and "Kafka".

Source: https://chrzaszcz.dev/2019/12/kafka-transactions/

Proposed Syntax

I propose using the same syntax as loops:

    participant Alice
    participant Bob


    box Alice_and_Bob
    Alice->>Bob: Hello John, how are you?
    Bob->>Alice: Fight against hypochondria
    end

Sequence Retained Approved Enhancement

Most helpful comment

Agreed. I can probably get this implemented.

soonâ„¢

All 4 comments

Thats a good idea! We should do this.

Agreed. I can probably get this implemented.

soonâ„¢

Agreed. I can probably get this implemented.

soonâ„¢

You're awesome, @cmmoran ! I volunteer to test.

If the participants belong to a single box, the box could be set when creating the participants.
For example:

sequenceDiagram
    %% Alice and Bob are grouped in "Alice_and_Bob" box
    box Alice_and_Bob
    participant Alice
    participant Bob
    end
    %% Truddy does not belong to a group
    participant Truddy
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tokyo786 picture tokyo786  Â·  3Comments

PaoloneM picture PaoloneM  Â·  4Comments

lumenwrites picture lumenwrites  Â·  5Comments

mestaritonttu picture mestaritonttu  Â·  3Comments

chen4221 picture chen4221  Â·  3Comments