Markdown高级应用-图
- 基于mermaid的插件型
- 原生
插件型流程图(LR表示横向,TD表示纵向)
```mermaid
graph LR
A(开始) --> B[起床] --> C[洗漱] --> D[吃早饭] --> E[出门]
E --> F{选择交通工具}
F --> |选择公交车| G
F --> |选择共享汽车| H
G[到达公司] --> H[工作] --> I[结束]
```
标准流程图
```mermaid
flowchat
st=>start: 开始框
op=>operation: 处理框
cond=>condition: 判断框
sub1=>subroutine: 子流程
io=>inputoutput: 输入输出
e=>end: 结束框
st(right)->op(bottom)->cond
cond(yes)->io(right)->e
cond(no)->sub1->op
```
练习
```mermaid
flowchat
st=>start: 开始
op1=>operation: 起床
op2=>operation: 洗漱
op3=>operation: 吃早饭
op4=>operation: 出门
op5=>operation: 到达公司
op6=>operation: 工作
op7=>operation: 结束
cond=>condition: 选择交通工具
e=>end: 结束
st(right)->op1(right)->op2(right)->op3(right)->op4(right)->cond
cond(yes)->op5
cond(no)->op6
op5(right)->op6(right)->e
```
mermaid时序图
```mermaid
%% ->:直线 -->:虚线 ->>:实线箭头
sequenceDiagram %%给画布指定类型
participant 张三
participant 李四
张三->王五:王五你好吗?
loop 健康检查
王五->王五:与疾病战斗
end
Note right of 王五:合理食物,不要抽烟,<br/>不要喝酒,不要熬夜,<br/>及时看医生
王五->>李四:你怎么样了鸭,是不是快挂了?
李四->>张三:我很好,还能活一段时间!
张三-->王五:你不要刺激李四了,他快要挂了!
```
练习