mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.98k stars 6.11k forks source link

Statechart transition out of composite states only works in first concurrent partition #5096

Open plotkin-trisense opened 7 months ago

plotkin-trisense commented 7 months ago

This works:

stateDiagram-v2
    [*] --> ONLINE
    state ONLINE {
        [*] --> OKAY
        OKAY --> OVERHEAT
        --
        [*] --> A
        A --> B
        B --> A
    }
    OVERHEAT --> OFFLINE : on timer

image

This says "syntax error":

stateDiagram-v2
    [*] --> ONLINE
    state ONLINE {
        [*] --> A
        A --> B
        B --> A
        --
        [*] --> OKAY
        OKAY --> OVERHEAT
    }
    OVERHEAT --> OFFLINE : on timer

Looks like escaping a composite only works in the first orthogonal region? Not sure if a bug, but not very intuitive and took a while to figure out why am I getting "syntax error".

aloisklink commented 7 months ago

I've reproduced this on https://mermaid.live so I don't think this bug is related to the mermaid-cli project explicitly.

I'm moving it to the main mermaid project.