Mermaidでシーケンス図を書く
シーケンス図
以下のコード例では省略しているが、1行目にsequenceDiagramと書く必要がある
docs
何も考えなくても時系列に並ぶのが良い
#WIP
participant, actor
宣言しなくても自動で入るが、宣言することで順序を規定できる
code:mermaid
participant A as Alice
participant B as Bob
矢印 ref
線の種類
-が実線
--が点線
先端
>: ただの横線
>>: 矢印
x: Solid line with a cross at the end
): Solid line with an open arrow at the end (async)
activations ref
2種類方法がある
+と-を矢印の先端に付ける
e.g.
->>+
-->-
activate,deactiveを付ける
https://gyazo.com/5e71b5b18b6c579361c4136e5134e7cb
これ、図としては何を表すんだmrsekut.icon
継続してる感を出したいのか?
Notes ref
四角いボックスを表示する
線とずらしたり、線と重ねたりできる
https://gyazo.com/a00e6461f83bad9a2f2a4df7405d71af
Loop
code:mermaid
Alice->John: Hello John, how are you?
loop Every minute
John-->Alice: Great!
end
Alt
https://mermaid-js.github.io/mermaid/#/./sequenceDiagram?id=alt
条件分岐
par
並列
https://mermaid-js.github.io/mermaid/#/./sequenceDiagram?id=parallel
Critical Region
https://mermaid-js.github.io/mermaid/#/./sequenceDiagram?id=critical-region
よくわからんmrsekut.icon
何のイベントもなく発火することとかあるのか?
break
停止、例外