# mermaid
Markdown Preview Enhanced 使用 mermaid 来渲染流程图和时序图。
mermaid 代码块中的内容将会渲染 mermaid 图像。
查看 mermaid 文档 了解更多如果创建图形。
```
TB - top bottom
BT - bottom top
RL - right left
LR - left right
TD - same as TB
```
```mermaid
graph LR
a --> b;
b --> c;
c --> a;
```
```mermaid
graph LR
A --> B;
```
# 节点与形状
文本节点
```mermaid
graph TB
id1;
id[This is the text in the box];
```
圆角节点
```mermaid
graph LR
id(This is the text in the box);
```
圆节点(The form of a circle)
```mermaid
graph LR
id((This is the text in the circle));
```
非对称节点(asymetric shape)
```mermaid
graph LR
id>This is the text in the box]
```
菱形节点(rhombus)
```mermaid
graph LR
id{This is the text in the box}
```
# 连接线
节点间的连接线有多种形状,而且可以在连接线中加入标签:
箭头形连接
```mermaid
graph LR;
A-->B;
```
开放行连接
```mermaid
graph LR
A --- B
```
标签连接
```mermaid
graph LR
A -- This is the label text --- B;
```
箭头标签连接
虚线(dotted link,点连线)
粗实线==>
```mermaid
graph LR
A-.text.->B
e==text==>f
```
# html 字符的转义字符
转义字符的使用语法
流程图定义如下:
```mermaid
graph LR
A["A double quote:#quot;"]-->B["A dec char:#9829;"]
```
子图(Subgraphs)
```mermaid
graph TB
subgraph one
a1 --> a2
end
subgraph two
b2 --> b2
end
subgraph three
c1 --> c2
end
c1 --> a2
```
# 基础 fontawesome 支持
想加入来自frontawesome的图表字体,详情请点击:fontawdsome
引用的语法为:++fa:#icon class name#++
```mermaid
graph TD
B["fa:fa-twitter for peace"]
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner);
B-->E(A fa:fa-camerra-retro perhaps?);
```
# 图表(graph)
定义连接线的样式
```mermaid
graph LR
id1(Start)-->id2(Stop)
style id1 fill:#f9f,stroke:#333,stroke-width:4px;
style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray:5,5;
```
```mermaid
graph LR
classDef default fill:#f90,stroke:#555,stroke-width:4px;
id3(Start)-->id4(Stop)
```
# 序列图(sequence diagram)
```mermaid
sequenceDiagram
Alice->John: Hello John, how are you ?
John-->Alice:Great!
Alice->>John: dont borther me !
John-->>Alice:Great!
Alice-xJohn: wait!
John--xAlice: Ok!
```
```mermaid
sequenceDiagram
participant John
participant Alice
Alice-xJohn:Hello John,how are you?
John-->>Alice:Great!
```
```
箭头的六种样式
->
–>
->>
–>>
-x
–x
```
# 便签
给序列图增加便签:
具体规则:
```mermaid
sequenceDiagram
participant John
Note left of John: Text in note
```
跨越两个 Actor 的便签:
```mermaid
sequenceDiagram
Alice->John:Hello John, how are you?
Note over Alice,John:A typical interaction
```
# 循环 Loops
```mermaid
sequenceDiagram
Alice->>John: Hello!
loop Reply every minute
John->>Alice:Great!
end
```
# 选择 ALT
在序列图中选择的表达。规则如下:
```mermaid
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice:not so good :(
else is well
Bob->>Alice:Feeling fresh like a daisy:)
end
opt Extra response
Bob->>Alice:Thanks for asking
end
```
# 甘特图(gantt)
```mermaid
gantt
dateFormat YYYY-MM-DD
section S1
T1: 2014-01-01, 9d
section S2
T2: 2014-01-11, 9d
section S3
T3: 2014-01-02, 9d
```
```mermaid
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
```
```mermaid
graph LR
sq[Square shape] --> ci((Circle shape))
subgraph A subgraph
di{Diamond with line break} -.-> ro(Rounded)
di==>ro2(Rounded square shape)
end
e --> od3>Really long text with linebreak<br>in an Odd shape]
cyr[Cyrillic]-->cyr2((Circle shape Начало));
classDef green fill:#9f6,stroke:#333,stroke-width:2px;
classDef orange fill:#f96,stroke:#333,stroke-width:4px;
class sq,e green
class di orange
```
一个小 Bug
在 Markdown 模式下
```mermaid
graph TB
id[a]
```
与 LaTex 公式不能实现混编, 否则, 公式将不能正确显示.
若要与 LaTex 实现混编, 只需要将其改为下面的形式即可
<div class="mermaid">graph LR;
id[a]
</div>
- HTML
- 讯飞插件
- Python
- 王者荣耀
- demo_cg.py
- demo_cg_TT.py
- img.py
- MySQL
- 清空表数据
- ID自增长重置
- 用户密码及权限操作
- 外键在数据库中的作用
- MySQL增删改查语句
- DDL-数据库操作
- DDL-表操作-查询
- DDL-表操作-创建
- DDL-表操作-数据类型
- DDL-表操作-修改
- DDL-表操作-删除
- DML-语句
- DML-添加数据
- DML-修改数据
- DML-删除数据
- DQL-语法
- DQL-基本查询
- DQL-条件查询
- DQL-聚合函数
- DQL-分组查询
- DQL-排序查询
- DQL-分页查询
- DCL-介绍
- DCL-管理用户
- DCL-权限控制
- 函数
- JS
- ajax
- ajax get请求
- ajax post提交
- ajax 同时上传文本和文件到数据库(inpt text和input file)
- 路径传值+接收解析
- js 本地sessionStorage
- js Excel导出.xls
- 二维码生成插件
- VUE-CLI4
- 安装手脚架及插件
- ECharts-数据可视化
- element-ui-时间戳
- qrcode二维码生成插件
- vuedraggable-拖拽组件
- vue-drag-resize-自由拖拽、缩放组件
- gitee配置
- src
- plugins
- element.js
- echartsMixin.js
- views
- login
- login.vue
- btn.vue
- home
- home.vue
- Welcome.vue
- user
- users.vue
- router
- main.js
- App.vue
- 引入语法
- 获取路径传值
- ajax请求
- token语法
- NPM更换镜像方案
- PHP
- PHP 微信网页登录
- PHP 判断函数
- PHP 获取微信公众号openid
- PHP 实现发送模板消息(微信公众号版)
- PHP 阳历阴历转换计算生肖闰年
- PHP 接口数组形式
- PHP 同文件夹下顺序命名
- PHP 输出文件
- PHP E-mail发送
- PHP cURL资源
- PHP 远程访问控制服务器
- PHP 8.0 开启mysqli扩展
- PHP 使用 OSS 批量上传图片
- PHP md5 加密与解密
- ThinkPHP
- PT6
- TP6安装多应用
- TP5
- view渲染模板常见语法
- Visual Studio Code
- 介绍
- 插件-eslint
- vs code插件
- VSCode添加自定义模板
- SFTP
- md格式的文档
- mermaid
- frp内网穿透
- 自定义端口
- ui-china.cn
- 常用软件
- 框架
- 服务器
- 微信小程序
- 云函数 Email
- 参数传递
- 其他
- VMware虚拟机centos7设置静态ip 连接外网