首页 > 其他分享 >一个强大的作图工具Mermaid入门

一个强大的作图工具Mermaid入门

时间:2023-03-03 10:55:25浏览次数:58  
标签:Me 入门 title 作图 Alice -- commit John Mermaid

一个强大的作图工具Mermaid入门

参考网站:

https://mermaid.live/edit 在线编辑器

https://mermaid.js.org/intro/ 官网

使用方法

  • 在typora中选择```mermaid即可,复杂的功能需要收费版可以显示
  • 类似于plantuml这种
  • 功能貌似强大一点
  • 有些未实现的(实验性质的)或者你没有收费的typora的,那你可以用在线作图或者直接用Mermaid-js(npm或者其他工具安装即可)

DEMO

FlowChart

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
graph TD; A-->B; A-->C; B-->D; C-->D;

sequenceDiagram

sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!
sequenceDiagram Alice->>+John: Hello John, how are you? Alice->>+John: John, can you hear me? John-->>-Alice: Hi Alice, I can hear you! John-->>-Alice: I feel great!
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!

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!

Gantt Diagram

gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10

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

  • md中显示不出来,收费的能显示
gantt dateFormat YYYY-MM-DD title Adding GANTT diagram to mermaid excludes weekdays 2014-01-10 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
  • 官网效果如下

1677807931625

Class Diagram

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

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

Git graph

    gitGraph
       commit
       commit
       branch develop
       commit
       commit
       commit
       checkout main
       commit
       commit

gitGraph commit commit branch develop commit commit commit checkout main commit commit

ER Diagram

erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses


erDiagram CUSTOMER ||--o{ ORDER : places ORDER ||--|{ LINE-ITEM : contains CUSTOMER }|..|{ DELIVERY-ADDRESS : uses

User Journey Diagram

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

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

Pie Diagram

pie title Pets adopted by volunteers
    "Dogs" : 386
    "Cats" : 85
    "Rats" : 15

pie title Pets adopted by volunteers "Dogs" : 386 "Cats" : 85 "Rats" : 15

Mindmaps

mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
      On effectiveness<br/>and features
      On Automatic creation
        Uses
            Creative techniques
            Strategic planning
            Argument mapping
    Tools
      Pen and paper
      Mermaid


mindmap root((mindmap)) Origins Long history ::icon(fa fa-book) Popularisation British popular psychology author Tony Buzan Research On effectiveness<br/>and features On Automatic creation Uses Creative techniques Strategic planning Argument mapping Tools Pen and paper Mermaid

Basic FR

graph LR
    A[Square Rect] -- Link text --> B((Circle))
    A --> C(Round Rect)
    B --> D{Rhombus}
    C --> D

graph LR A[Square Rect] -- Link text --> B((Circle)) A --> C(Round Rect) B --> D{Rhombus} C --> D graph LR A["[]矩形"]-->|"-->箭头"|B("()圆角") B---|"---连线"|C(("双(())圆形")) C==>|==粗线|D{"{}菱形"} C-->E>">]为非对称"]

Timeline

  • 当前用的收费版本都未实现
  • 实验性质的图例,关注下(反而是我比较喜欢的一个功能)
  • 你要使用该功能,可以去https://mermaid.live/edit,在线编辑
timeline
    title History of Social Media Platform
    2002 : LinkedIn
    2004 : Facebook
         : Google
    2005 : Youtube
    2006 : Twitter

timeline title History of Social Media Platform 2002 : LinkedIn 2004 : Facebook : Google 2005 : Youtube 2006 : Twitter

标签:Me,入门,title,作图,Alice,--,commit,John,Mermaid
From: https://www.cnblogs.com/wuxianfeng023/p/17174441.html

相关文章

  • Web安全入门与靶场实战二(2)- 实例解释HTTP状态码
    在HTTP响应头中有一部分非常重要的信息就是响应行中的状态码。状态码都是由三位数字组成,比如状态码200表示请求成功。状态码主要分为5个大类: 1xx:100-101,指示信息。这种状......
  • LESS 快速使用入门指南简介
    LessCSS是一个使用广泛的CSS预处理器,通过简单的语法和变量对CSS进行扩展,可减少很多CSS的代码量。LESS将CSS赋予了动态语言的特性,如变量、继承、运算、函数......
  • Solidity极简入门#27. ABI编码解码
    ABI(ApplicationBinaryInterface,应用二进制接口)是与Ethereum智能合约交互的标准。数据基于他们的类型编码;并且由于编码后不包含类型信息,解码时需要注明它们的类型。Soli......
  • Servlet-thymeleaf入门与渲染index页面
    资料来源于:B站尚硅谷JavaWeb教程(全新技术栈,全程实战),本人才疏学浅,记录笔记以供日后回顾由于是多个视频内容混合在一起,因此只放了第一个链接视频链接知识点Thymel......
  • 真的,Web安全入门看这个就够了!
    一、HTTP协议1、HTTP什么是HTTP?超文本传输协议,HTTP是基于B/S架构进行通信的,而HTTP的服务器端实现程序有httpd、nginx等,其客户端的实现程序主要是Web浏览器,例如Firefox、......
  • 真的,Web安全入门看这个就够了!
    一、HTTP协议1、HTTP什么是HTTP?超文本传输协议,HTTP是基于B/S架构进行通信的,而HTTP的服务器端实现程序有httpd、nginx等,其客户端的实现程序主要是Web浏览器,例如Firefox、I......
  • Python 入门的基本语法规则
    官方对Python的介绍如下:Python是一款易于学习且功能强大的编程语言。它具有高效率的数据结构,能够简单又有效地实现面向对象编程。Python有着非广泛的应用,几乎所有大......
  • Jmeter(五十二) - 从入门到精通高级篇 - jmeter之跨线程组传递参数(详解教程)
    ------------------------------------------------------------------- 转载自:北京-宏哥https://www.cnblogs.com/du-hong/p/13667219.html -------------------------......
  • 爆肝200+小时,总结出的 Creator 3.x 入门修炼指南!全免费
    大家好,我是晓衡!为了写这篇文章,给支持公众号的读者们一个交代,我准备了200+小时,公众号断更11天。我决定,不再选择逃避,不想再欺骗自己了。2023新年开工,不到十天时间,接二连三......
  • springMVC快速入门
    创建控制层继承org.springframework.web.servlet.mvc.ControllerpublicclassMyControllerimplementsController{@OverridepublicModelAndViewhandleReq......