mermaid
Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
Last updated 7 years ago by tylerlong .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install mermaid 
SYNC missed versions from official npm registry.

mermaid

Build Status Coverage Status Join the chat at https://gitter.im/knsv/mermaid

banner

Generation of diagrams and flowcharts from text in a similar manner as markdown.

Ever wanted to simplify documentation and avoid heavy tools like Visio when explaining your code?

This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript.

Flowchart

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

Flowchart

Sequence diagram

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!

Sequence diagram

Gantt diagram

gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram to mermaid

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

Gantt diagram

Class diagram - :exclamation: experimental

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

Class diagram

Git graph - :exclamation: experimental

gitGraph:
options
{
    "nodeSpacing": 150,
    "nodeRadius": 10
}
end
commit
branch newbranch
checkout newbranch
commit
commit
checkout master
commit
commit
merge newbranch

Git graph

Installation

CDN

https://unpkg.com/mermaid@<version>/dist/

Replace <version> with expected version number.

Example: https://unpkg.com/mermaid@7.1.0/dist/

Node.js

yarn add mermaid

Documentation

https://mermaidjs.github.io

Sibling projects

Request for assistance

Things are piling up and I have hard time keeping up. To remedy this it would be great if we could form a core team of developers to cooperate with the future development mermaid.

As part of this team you would get write access to the repository and would represent the project when answering questions and issues.

Together we could continue the work with things like:

  • adding more typers of diagrams like mindmaps, ert digrams etc
  • improving existing diagrams

Don't hesitate to contact me if you want to get involved.

For contributors

Setup

Make sure you have Chrome browser installed, this project uses Chrome headless to running tests.

yarn install

Build

yarn build:watch

Lint

yarn lint

We use JavaScript Standard Style. We recommend you installing editor plugins so you can get real time lint result.

Test

yarn test

Manual test in browser:

open dist/index.html

Release

For those who have the permission to do so:

Update version number in package.json.

npm publish

Command above generates files into the dist folder and publishes them to npmjs.org.

Credits

Many thanks to the d3 and dagre-d3 projects for providing the graphical layout and drawing libraries!

Thanks also to the js-sequence-diagram project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering.

Mermaid was created by Knut Sveidqvist for easier documentation.

Tyler Long has became a collaborator since April 2017.

Here is the full list of the projects contributors.

Current Tags

  • 11.0.0-alpha.7                                ...           alpha (8 months ago)
  • 10.9.1                                ...           latest (6 months ago)
  • 10.9.0-rc.2                                ...           next (9 months ago)

224 Versions

  • 10.9.1                                ...           6 months ago
  • 11.0.0-alpha.7                                ...           8 months ago
  • 10.9.0                                ...           8 months ago
  • 10.9.0-rc.2                                ...           9 months ago
  • 10.9.0-rc.1                                ...           9 months ago
  • 10.8.0                                ...           9 months ago
  • 10.7.0                                ...           10 months ago
  • 10.6.2-rc.3                                ...           10 months ago
  • 10.6.2-rc.2                                ...           a year ago
  • 11.0.0-alpha.6                                ...           a year ago
  • 10.6.2-rc.1                                ...           a year ago
  • 11.0.0-alpha.5                                ...           a year ago
  • 10.6.1                                ...           a year ago
  • 10.6.0                                ...           a year ago
  • 10.5.1                                ...           a year ago
  • 10.5.0                                ...           a year ago
  • 10.5.0-rc.3                                ...           a year ago
  • 10.5.0-rc.1                                ...           a year ago
  • 10.5.0-alpha.1                                ...           a year ago
  • 10.4.0                                ...           a year ago
  • 11.0.0-alpha.4                                ...           a year ago
  • 11.0.0-alpha.3                                ...           a year ago
  • 11.0.0-alpha.2                                ...           a year ago
  • 11.0.0-alpha.1                                ...           a year ago
  • 10.3.1                                ...           a year ago
  • 10.3.0                                ...           a year ago
  • 10.3.0-rc.1                                ...           a year ago
  • 10.2.4                                ...           a year ago
  • 10.2.4-rc.1                                ...           a year ago
  • 10.2.3                                ...           a year ago
  • 10.2.3-rc.1                                ...           a year ago
  • 10.2.2                                ...           a year ago
  • 10.2.1                                ...           a year ago
  • 10.2.1-rc.1                                ...           a year ago
  • 10.2.0                                ...           a year ago
  • 10.2.0-rc.4                                ...           a year ago
  • 10.2.0-rc.3                                ...           2 years ago
  • 10.2.0-rc.2                                ...           2 years ago
  • 10.2.0-rc.1                                ...           2 years ago
  • 10.1.0                                ...           2 years ago
  • 10.1.0-rc.1                                ...           2 years ago
  • 9.4.3                                ...           2 years ago
  • 9.4.2                                ...           2 years ago
  • 10.0.3-alpha.1                                ...           2 years ago
  • 10.0.2                                ...           2 years ago
  • 10.0.2-rc.1                                ...           2 years ago
  • 10.0.1                                ...           2 years ago
  • 10.0.1-rc.5                                ...           2 years ago
  • 10.0.1-rc.4                                ...           2 years ago
  • 9.4.2-rc.2                                ...           2 years ago
  • 10.0.1-rc.3                                ...           2 years ago
  • 10.0.1-rc.2                                ...           2 years ago
  • 10.0.1-rc.1                                ...           2 years ago
  • 10.0.0                                ...           2 years ago
  • 10.0.0-rc.4                                ...           2 years ago
  • 10.0.0-rc.3                                ...           2 years ago
  • 10.0.0-rc.2                                ...           2 years ago
  • 10.0.0-rc.1                                ...           2 years ago
  • 9.4.2-rc.1                                ...           2 years ago
  • 9.4.0                                ...           2 years ago
  • 9.4.0-rc.2                                ...           2 years ago
  • 9.4.0-rc.1                                ...           2 years ago
  • 9.3.0                                ...           2 years ago
  • 9.3.0-rc.7                                ...           2 years ago
  • 9.3.0-rc.6                                ...           2 years ago
  • 9.3.0-rc.5                                ...           2 years ago
  • 9.3.0-rc.4                                ...           2 years ago
  • 9.3.0-rc.3                                ...           2 years ago
  • 9.3.0-rc.2                                ...           2 years ago
  • 9.3.0-rc.1                                ...           2 years ago
  • 9.2.3-rc.1                                ...           2 years ago
  • 9.2.2                                ...           2 years ago
  • 9.2.2-rc.2                                ...           2 years ago
  • 9.2.1                                ...           2 years ago
  • 9.2.0                                ...           2 years ago
  • 9.2.0-rc10                                ...           2 years ago
  • 9.2.0-rc9                                ...           2 years ago
  • 9.2.0-rc8                                ...           2 years ago
  • 9.2.0-rc7                                ...           2 years ago
  • 9.2.0-rc6                                ...           2 years ago
  • 9.2.0-rc5                                ...           2 years ago
  • 9.2.0-rc4                                ...           2 years ago
  • 9.2.0-rc3                                ...           2 years ago
  • 9.2.0-rc2                                ...           2 years ago
  • 9.1.7                                ...           2 years ago
  • 9.2.0-rc1                                ...           2 years ago
  • 9.1.6                                ...           2 years ago
  • 9.1.5                                ...           2 years ago
  • 9.1.4                                ...           2 years ago
  • 9.1.3                                ...           2 years ago
  • 9.1.2                                ...           2 years ago
  • 9.1.1                                ...           3 years ago
  • 9.1.0                                ...           3 years ago
  • 9.0.1                                ...           3 years ago
  • 9.0.0                                ...           3 years ago
  • 8.14.0                                ...           3 years ago
  • 8.14.0-rc1                                ...           3 years ago
  • 8.13.10                                ...           3 years ago
  • 8.13.9                                ...           3 years ago
  • 8.13.8                                ...           3 years ago
  • 8.13.7                                ...           3 years ago
  • 8.13.6                                ...           3 years ago
  • 8.13.5                                ...           3 years ago
  • 8.13.4                                ...           3 years ago
  • 8.13.3                                ...           3 years ago
  • 8.13.2                                ...           3 years ago
  • 8.13.1                                ...           3 years ago
  • 8.13.0                                ...           3 years ago
  • 8.12.1                                ...           3 years ago
  • 8.12.0                                ...           3 years ago
  • 8.11.5                                ...           3 years ago
  • 8.11.4                                ...           3 years ago
  • 8.11.3                                ...           3 years ago
  • 8.11.2                                ...           3 years ago
  • 8.11.1                                ...           3 years ago
  • 8.11.0                                ...           3 years ago
  • 8.10.2                                ...           3 years ago
  • 8.10.1                                ...           4 years ago
  • 8.9.3                                ...           4 years ago
  • 8.9.2                                ...           4 years ago
  • 8.9.1                                ...           4 years ago
  • 8.9.0                                ...           4 years ago
  • 8.8.4                                ...           4 years ago
  • 8.8.3                                ...           4 years ago
  • 8.8.2                                ...           4 years ago
  • 8.8.1                                ...           4 years ago
  • 8.8.0                                ...           4 years ago
  • 8.7.0                                ...           4 years ago
  • 8.6.4                                ...           4 years ago
  • 8.6.3                                ...           4 years ago
  • 8.6.2                                ...           4 years ago
  • 8.6.1                                ...           4 years ago
  • 8.6.0                                ...           4 years ago
  • 8.5.2                                ...           4 years ago
  • 8.5.1                                ...           4 years ago
  • 8.5.0                                ...           5 years ago
  • 8.4.8                                ...           5 years ago
  • 8.4.7                                ...           5 years ago
  • 8.4.6                                ...           5 years ago
  • 8.4.5                                ...           5 years ago
  • 8.4.4                                ...           5 years ago
  • 8.4.3                                ...           5 years ago
  • 8.4.2                                ...           5 years ago
  • 8.4.1                                ...           5 years ago
  • 8.4.0                                ...           5 years ago
  • 8.3.1                                ...           5 years ago
  • 8.3.0                                ...           5 years ago
  • 8.2.6                                ...           5 years ago
  • 8.2.5                                ...           5 years ago
  • 8.2.4                                ...           5 years ago
  • 8.2.3                                ...           5 years ago
  • 8.2.2                                ...           5 years ago
  • 8.2.1                                ...           5 years ago
  • 8.1.0                                ...           5 years ago
  • 8.0.0                                ...           6 years ago
  • 8.0.0-rc.8                                ...           7 years ago
  • 8.0.0-rc.7                                ...           7 years ago
  • 8.0.0-rc.6                                ...           7 years ago
  • 8.0.0-rc.5                                ...           7 years ago
  • 8.0.0-rc.4                                ...           7 years ago
  • 8.0.0-rc.3                                ...           7 years ago
  • 8.0.0-rc.2                                ...           7 years ago
  • 8.0.0-rc.1                                ...           7 years ago
  • 8.0.0-beta.9                                ...           7 years ago
  • 8.0.0-beta.8                                ...           7 years ago
  • 8.0.0-beta.7                                ...           7 years ago
  • 8.0.0-beta.6                                ...           7 years ago
  • 8.0.0-beta.5                                ...           7 years ago
  • 8.0.0-beta.4                                ...           7 years ago
  • 8.0.0-beta.3                                ...           7 years ago
  • 8.0.0-beta.2                                ...           7 years ago
  • 8.0.0-beta.1                                ...           7 years ago
  • 8.0.0-alpha.9                                ...           7 years ago
  • 8.0.0-alpha.8                                ...           7 years ago
  • 8.0.0-alpha.6                                ...           7 years ago
  • 8.0.0-alpha.5                                ...           7 years ago
  • 8.0.0-alpha.4                                ...           7 years ago
  • 8.0.0-alpha.3                                ...           7 years ago
  • 8.0.0-alpha.2                                ...           7 years ago
  • 8.0.0-alpha.1                                ...           7 years ago
  • 7.1.2                                ...           7 years ago
  • 7.1.1                                ...           7 years ago
  • 7.1.0                                ...           7 years ago
  • 7.0.18                                ...           7 years ago
  • 7.0.17                                ...           7 years ago
  • 7.0.16                                ...           7 years ago
  • 7.0.15                                ...           7 years ago
  • 7.0.14                                ...           7 years ago
  • 7.0.13                                ...           7 years ago
  • 7.0.12                                ...           7 years ago
  • 7.0.11                                ...           7 years ago
  • 7.0.10                                ...           7 years ago
  • 7.0.9                                ...           7 years ago
  • 7.0.8                                ...           7 years ago
  • 7.0.7                                ...           7 years ago
  • 7.0.6                                ...           7 years ago
  • 7.0.5                                ...           7 years ago
  • 7.0.4                                ...           7 years ago
  • 7.0.3                                ...           7 years ago
  • 7.0.2                                ...           7 years ago
  • 7.0.1                                ...           7 years ago
  • 7.0.0                                ...           8 years ago
  • 6.0.0                                ...           8 years ago
  • 0.5.8                                ...           9 years ago
  • 0.5.7                                ...           9 years ago
  • 0.5.6                                ...           9 years ago
  • 0.5.5                                ...           9 years ago
  • 0.5.4                                ...           9 years ago
  • 0.5.3                                ...           9 years ago
  • 0.5.2                                ...           9 years ago
  • 0.5.1                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.0                                ...           10 years ago
  • 0.3.5                                ...           10 years ago
  • 0.3.4                                ...           10 years ago
  • 0.3.3                                ...           10 years ago
  • 0.3.2                                ...           10 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.16                                ...           10 years ago
  • 0.2.15                                ...           10 years ago
  • 0.2.14                                ...           10 years ago
  • 0.2.13                                ...           10 years ago
  • 0.2.12                                ...           10 years ago
  • 0.2.11                                ...           10 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (20)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE