mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 09:20:03 +02:00
Document <<choice>> in the state diagram page
This commit is contained in:
@@ -228,6 +228,28 @@ stateDiagram-v2
|
|||||||
|
|
||||||
*You can not define transitions between internal states belonging to different composite states*
|
*You can not define transitions between internal states belonging to different composite states*
|
||||||
|
|
||||||
|
## Choice
|
||||||
|
|
||||||
|
Sometimes you need to model a choice between two or more paths, you can do so using <<choice>>.
|
||||||
|
|
||||||
|
```
|
||||||
|
stateDiagram-v2
|
||||||
|
state if_state <<choice>>
|
||||||
|
[*] --> IsPositive
|
||||||
|
IsPositive --> if_state
|
||||||
|
if_state --> False: if n < 0
|
||||||
|
if_state --> True : if n >= 0
|
||||||
|
```
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
stateDiagram-v2
|
||||||
|
state if_state <<choice>>
|
||||||
|
[*] --> IsPositive
|
||||||
|
IsPositive --> if_state
|
||||||
|
if_state --> False: if n < 0
|
||||||
|
if_state --> True : if n >= 0
|
||||||
|
```
|
||||||
|
|
||||||
## Forks
|
## Forks
|
||||||
|
|
||||||
It is possible to specify a fork in the diagram using <<fork>> <<join>>.
|
It is possible to specify a fork in the diagram using <<fork>> <<join>>.
|
||||||
|
Reference in New Issue
Block a user