当前位置:网站首页>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

边栏推荐
- 华为云OneMeeting告诉你全场景会议这么开!
- 数字藏品,万字长文,你想知道的大部分问题都讲清楚了从业者必看
- 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
- Win11如何给系统盘瘦身?Win11系统盘瘦身方法
- 100人成绩的平均
- R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题
- Can py SQL get the table structure?
- 我是刚购买的adb mysql服务,我每做一个操作,比如建表,都会弹出这个问题,请问这是什么问题?
- C#连接数据库完成增删改查操作
- F(x)构建方程 ,梯度下降求偏导,损失函数确定偏导调整,激活函数处理非线性问题
猜你喜欢

腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”

智能计算系统1 环境搭建

数字经济专家高泽龙:映客更名映宇宙,元宇宙会成为映客下一个增长引擎吗?

团体程序设计天梯赛练习题-持续更新中

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

《数字经济全景白皮书》消费金融数字化篇 重磅发布

视频压缩处理之ffmpeg用法

i人事HR系统上架企业微信ISV,增强企微在服务连锁零售等行业深度应用

Fontawesome icon for color gradient

Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
随机推荐
内核错误怎么解决?Win11系统内核错误解决方法
From design delivery to development, it is easy and efficient!
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
请问下flinkcdc用flinksql提交的话只能一个表提交一个任务吗?那有几千张表的时候还能这么
Rigid error: could not extract PIDs from PS output PIDS: [], Procs: [“bad pid
视差js特效js轮播图插件
Win11如何给系统盘瘦身?Win11系统盘瘦身方法
Try except add auxiliary new column
C language - function knowledge points
matlab 受约束的 Delaunay 三角剖分
Paper notes: universal value function approvers
Can only one task be submitted by one table if the flinkcdc is submitted by flinksql? When there are thousands of watches
Ffmpeg learning summary
为什么C语言用使用其他文件的结构体变量时,声明结构体别名还不行,必须使用本名?(使用别名时不能加struct)
Grafana biaxial graph with your hands
在arm版本rk3399中搭建halo博客
Figure introduction to neural networks (GNN, GCN)
秋招经验分享 | 银行笔面试该怎么准备
秒杀系统设计
视频压缩处理之ffmpeg用法