当前位置:网站首页>Markdown mermaid種草(1)_ mermaid簡介
Markdown mermaid種草(1)_ mermaid簡介
2022-06-28 19:41: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

边栏推荐
- 腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”
- Figure introduction to neural networks (GNN, GCN)
- redisTemplate
- 图神经网络入门 (GNN, GCN)
- Paper 3 vscode & texlive & sumatrapdf create a perfect tool for writing papers
- SQL calculates daily new users and retention rate indicators
- 《数字经济全景白皮书》消费金融数字化篇 重磅发布
- 阿里开源(EasyExcel)
- Ffmpeg usage in video compression processing
- 团体程序设计天梯赛练习题-持续更新中
猜你喜欢

From design delivery to development, it is easy and efficient!

数字藏品,万字长文,你想知道的大部分问题都讲清楚了从业者必看

H5 sunflower operation

【324. 摆动排序 II】

Bayesian inference problem, MCMC and variational inference

PCL 环境下安装配置CGAL 5.4.1

道路千万条,为什么这家创新存储公司会选这条?

Grafana biaxial graph with your hands

深度学习需要多强的数学基础?

易观分析《2022年中国银行业隐私计算平台供应商实力矩阵分析》研究活动 正式启动
随机推荐
Leetcode 周赛299
PY SQL可以获取到表结构吗?
列表加入计时器(正计时、倒计时)
I just bought the ADB MySQL service. Every time I do an operation, such as creating a table, this problem will pop up. What is the problem?
On the first anniversary of the data security law, which four major changes are coming?
Constrained Delaunay triangulation in MATLAB
How to change the status bar at the bottom of win11 to black? How to change the status bar at the bottom of win11 to black
Rigid error: could not extract PIDs from PS output PIDS: [], Procs: [“bad pid
Time series forecasting based on trend and seasonality
Parallax JS special effect JS carousel map plug-in
Live app system source code, automatically playing when encountering video dynamically
R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题
kettle(六):基于Kettle的数据库全量备份
Variable autoencoders (vaes)
《数据安全法》出台一周年,看哪四大变化来袭?
Priority problem when local variables and global variables in C language have the same name (when local variables and global variables exist at the same time, local variables are preferred to be refer
Double contextual relationship network for polyp segmentation
论文3 VScode&texlive&SumatraPDF打造完美书写论文工具
Why is it not enough to declare the structure alias when using the structure variable of other files in C language, and the proper name must be used? (cannot add struct when using alias)
5G NR MBS架构介绍