mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

Home Page:https://mermaid.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected rendering of message arrows in sequence diagrams

Azam-Ra opened this issue · comments

Description

There is a feature of destroying participant/actor objects, when designing sequence diagrams in mermaid. It's defined in mermaid, that destroy action should associate with a destroying message after its declaration.

However, if you leave the contents of the destroying message empty; then the previous message arrow will point not to the lifeline of the participant/actor object being destroyed, but to the participant/actor object itself:
[Picture1]
image
Furthermore, if the previous message arrow was associated with create action (which is pretty unrealistic, but still...), then it causes even more chaos:
[Picture2]
image

On the other hand, if you fill contents of the destroying message:

  • in case of preceeding message being associated to a create action, rendered participant/actor objects will not overlap;
    [Picture3]
    image
  • in other cases, rendered message arrow will point to the lifeline of participant/actor object, being destroyed.
    [Picture4]
    image

Steps to reproduce

Code to recreate the pictures provided in the description:
[Picture1]:

sequenceDiagram
    participant p1

    create participant p2
    p1 ->> p2: Instantiate p2

    p2 -->> p1: Time has passed

    destroy p2
    p1 -x p2: 

[Picture2]:

sequenceDiagram
    participant p1

    create participant p2
    p1 ->> p2: Instantiate p2

    destroy p2
    p1 -x p2: 

[Picture3]:

sequenceDiagram
    participant p1

    create participant p2
    p1 ->> p2: Instantiate p2

    p2 -->> p1: Time has passed

    destroy p2
    p1 -x p2: .

[Picture4]:

sequenceDiagram
    participant p1

    create participant p2
    p1 ->> p2: Instantiate p2

    destroy p2
    p1 -x p2: .

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: v10.9.0
  • Browser and Version: Google Chrome 123.0.6312.58

Suggested Solutions

No response

Additional Context

No response