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.75k stars 6.08k forks source link

Misleading doc statement about state diagram? #5472

Open voroninp opened 2 months ago

voroninp commented 2 months ago

Description

There's a statement in the docs about state diagram:

You can not define transitions between internal states belonging to different composite states

Cannot I?

Steps to reproduce

Here's the diagram I created:

---
title: Global states of the app.
---
stateDiagram-v2
    notAccessible: App is not accessible
    accessible : App is accessible 

    state notAccessible {
        init: App initialization phase
        Stopping --> [*]
    }

    state accessible {
        Starting --> Running
        Running --> Suspending
        Suspending --> Suspended
        Suspended --> Starting
    }

    [*] --> init
    init --> Starting
    Running --> Stopping
    Suspended --> Stopping

And here's what I get: image

Screenshots

No response

Code Sample

No response

Setup

Suggested Solutions

Well, I'm happy it works =D I'm simply confused by the documentation.

Additional Context

No response

nirname commented 2 weeks ago

@voroninp Highly likely it was not updated. Feel free to fix documentation according current behaviour.

voroninp commented 2 weeks ago

@nirname , I am not 100% sure. I have experience when something was working because of the bug :-)

nirname commented 2 weeks ago

I am not 100% sure either, I am not so well aware of all the flowchart features, so that I could tell what exactly was meant by "composite state", could you please investigate it further?

nirname commented 2 weeks ago

It really seems that documentation is obsolete.