Mermaid 时序图
使用时序图说明对象之间随时间的交互。为您的系统建模消息流和通信。
代码
预览
100%
开始输入以查看您的图表
100% • 拖动平移
快速语法参考
创建时序图的关键语法。
参与者定义参与者和对象
sequenceDiagram
actor User
participant A
participant B as "Service B"消息在参与者之间发送消息
A ->> B : Synchronous
A -->> B : Asynchronous
A ->> A : Self message
A ->>+ B : Activate
A -->>- B : Deactivate循环重复消息序列
loop Every minute
A ->> B : Ping
B -->> A : Pong
end替代方案条件流
alt Success
A ->> B : Data
else Error
A ->> B : Error
end注释添加注释
Note over A,B : Shared note
Note left of A : Left note
Note right of B : Right note激活生命线激活
A ->>+ B : Activate B
B ->>+ C : Activate C
C -->>- B : Return
B -->>- A : Return应用场景
时序图说明对象在特定场景中的交互方式。
API文档
记录API调用和响应。
系统集成
显示微服务之间的交互。
用例建模
可视化特定用户场景。
协议设计
设计和记录通信协议。
调试
跟踪和分析系统交互。
代码审查
审查和讨论系统设计。