markdown画流程图


markdown画流程图

1.mermaid

mermaid是一种类似于markdown的脚本语言,通过javascript语言将文本转化为图片

1.流程图
1
2
3
4
graph TD;
A-->B;
A-->C;
B-->D;

实际效果

1
2
3
4
graph TD;
A-->B;
A-->C;
B-->D;
2.时序图
1
2
3
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!

实际效果

1
2
3
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
3.状态图
1
2
3
stateDiagram
[*] --> s1
s1 --> [*]
1
2
3
stateDiagram
[*] --> s1
s1 --> [*]
4.类图
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}

5.饼图

1
2
3
4
5
6
pie
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5
1
2
3
4
5
6
pie
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5

参考于:https://zhuanlan.zhihu.com/p/355997933


文章作者: 404NotFound
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 404NotFound !
评论
0 comments
Anonymous
Error: Not Found.
Markdown is supported

Be the first person to leave a comment!

  目录