graph LR
subgraph g1
a1–>b1
end
subgraph g2
a2–>b2
end
subgraph g3
a3–>b3
end
a3–>a2
关键字
-
participant,参与者,相当先定义模块,可通过设定参与者(participant)的顺序控制展示顺序
-
note, 便签,格式如下
note [right of | left of][Actor]:Text
给多个模块做标签, 通过逗号分割
note over [Actor1, Actor2…]:Text
- 循环
loop Loop_text
… statements…
end
- 选择
alt Describing_text
…statements…
else
…statements…
end
推荐在没有else的情况下使用 opt(option,选择)
opt Describing_text
…statements…
end
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice:not so good 😦
else is well
Bob->>Alice:good
end
opt Extra response
Bob->>Alice:Thanks for asking
end
连线
-
无箭头实线 -&