当前位置:网站首页>Markdown mermaid种草(1)_ mermaid简介
Markdown mermaid种草(1)_ mermaid简介
2022-06-28 19:29:00 【CarnivoreRabbit】
Markdown mermaid种草(1)_ mermaid简介
文章目录
1 为什么要推荐mermaid
本小白最近特别迷恋markdown及markdown相关的工具. 可能是因为正牌的编程技巧学不会,只能学学这种用来锦上添花(zhuangbility)的技巧. 开个玩笑,好的笔记好的呈现,可以为学习效果添砖加瓦.
Markdown语言怎么说呢,简直可以说是程序员之友了. 不管是github还是你现在正在查看的CSDN,以及各种笔记类产品,都支持这种图文并茂的编辑格式. 本小白首先推荐一款人人都推荐的markdown神器typora,这款产品目前是我使用markdown语言的主打产品,在体会了几种线上编辑器和几种笔记类软件之后,我还是觉得typora是本地端markdown编辑器的最优解(本小白个人见解,高手轻喷).
言归正传,来讲本篇的主角mermaid. 本小白之前以为,markdown也只能在文本、表格层面耍得很精彩了,直到最近偶然间发现了mermaid这个markdown语言的加成神器.
可以说,mermaid基本上满足了程序员对工作中常用图表的编辑需求.冲这一点,就值得本小白的墙裂推荐.
2 mermaid简介
直接先上一个mermaid的主页:mermaid传送门.
mermaid目前提供了以下类型的图形绘制:
| 编号 | 英文图名 | 中文图名 |
|---|---|---|
| 1 | Flowchart | 流程图 |
| 2 | Sequence Diagram | 序列图 |
| 3 | Class Diagram | 类图 |
| 4 | State Diagram | 状态图 |
| 5 | Entity Relationship Diagram | 实体关系图 |
| 6 | User Journey | 流水账 |
| 7 | Gantt | 甘特图 |
| 8 | Pie Chart | 饼图 |
Mermaid lets you represent diagrams using text and code.
mermaid的目标是让你可以用文本编辑器和代码来绘制图表. OK,既然是简介,那就每种图来一个示例吧(以下示例摘抄来的,没有版权保护):
感谢CSDN支持了mermaid的多数绘图,但是甘特图是不是没有支持???
2.1 流程图
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
2.2 序列图
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
2.3 类图
classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
2.4 状态图
stateDiagram-v2
state fork_state <<fork>>
[*] --> fork_state
fork_state --> State2
fork_state --> State3
state join_state <<join>>
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
2.5 实体关系图(ER图)
erDiagram
CUSTOMER ||--o{
ORDER : places
ORDER ||--|{
LINE-ITEM : contains
CUSTOMER }|..|{
DELIVERY-ADDRESS : uses
2.6 用户体验地图
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
2.7 甘特图
gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
title Adding GANTT diagram to mermaid
excludes weekdays 2021-01-10
section A section
Completed task :done, des1, 2021-01-16,2021-01-28
Active task :active, des2, 2021-01-29, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d

2.8 饼图
pie
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5

边栏推荐
- 智能计算系统1 环境搭建
- 机器学习笔记 temperature+Softmax
- H5 sunflower operation
- Can py SQL get the table structure?
- 直播app系统源码,动态遇到视频时开始自动播放
- 内核错误怎么解决?Win11系统内核错误解决方法
- Bayesian inference problem, MCMC and variational inference
- 华为云OneMeeting告诉你全场景会议这么开!
- 智能计算系统2 bangc算子开发的demo (CPU和MLU270的异构编程流程)
- Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
猜你喜欢

Nanopc-t4 (rk3399) Game1 OLED (I2C) display time weather temperature

基于趋势和季节性的时间序列预测

There are thousands of roads. Why did this innovative storage company choose this one?

《数据安全法》出台一周年,看哪四大变化来袭?

Markdown绘图mermaid实用教程

SQL interview question: find the maximum number of consecutive login days

R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题

MDM数据分析功能说明

math_证明常用等价无穷小&案例&代换

Technical methodology of new AI engine under the data infrastructure upgrade window
随机推荐
Idea merge other branches into dev branch
首部元宇宙概念小说《元宇宙2086》获得2022年上袭元宇宙奖
智能计算系统2 bangc算子开发的demo (CPU和MLU270的异构编程流程)
I. The HR system is put on the enterprise wechat ISV to enhance the in-depth application of enterprise wechat in service chain retail and other industries
《数字经济全景白皮书》消费金融数字化篇 重磅发布
事实/论断/断言/结论/断定/判定
2280.Cupboards
内核错误怎么解决?Win11系统内核错误解决方法
Try except add auxiliary new column
智能计算系统1 环境搭建
H5 sunflower operation
Bayesian inference problem, MCMC and variational inference
Build halo blog in arm version rk3399
Month on month SQL implementation
数据库学习笔记(SQL04)
《数据安全法》出台一周年,看哪四大变化来袭?
High performance and high availability computing architecture scheme commented by Weibo
Fontawesome icon for color gradient
Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
Find out the users who log in for 7 consecutive days and 30 consecutive days