2023-02-09 08:16:05 +01:00
< p align = "center" >
< img src = "https://raw.githubusercontent.com/mermaid-js/mermaid/develop/docs/public/favicon.svg" height = "150" >
< / p >
< h1 align = "center" >
Mermaid
< / h1 >
< p align = "center" >
Generate diagrams from markdown-like text.
< p >
< p align = "center" >
2023-02-22 08:03:50 +01:00
< a href = "https://www.npmjs.com/package/mermaid" > < img src = "https://img.shields.io/npm/v/mermaid?color=ff3670&label=" > < / a >
2023-02-09 08:16:05 +01:00
< p >
2020-02-25 22:11:08 +01:00
2023-02-09 08:16:05 +01:00
< p align = "center" >
< a href = "https://mermaid.live/" > < b > Live Editor!< / b > < / a >
< / p >
< p align = "center" >
2024-01-23 08:56:44 +01:00
< a href = "https://mermaid.js.org" > 📖 Documentation< / a > | < a href = "https://mermaid.js.org/intro/" > 🚀 Getting Started< / a > | < a href = "https://www.jsdelivr.com/package/npm/mermaid" > 🌐 CDN< / a > | < a href = "https://discord.gg/wwtabKgp8y" title = "Discord invite" > 🙌 Join Us< / a >
2023-02-09 08:16:05 +01:00
< / p >
< p align = "center" >
< a href = "./README.zh-CN.md" > 简体中文< / a >
< / p >
2023-09-15 10:23:07 +02:00
< p align = "center" >
2023-09-24 07:43:50 +02:00
Try Live Editor previews of future releases: < a href = "https://develop.git.mermaid.live/" title = "Try the mermaid version from the develop branch." > Develop< / a > | < a href = "https://next.git.mermaid.live/" title = "Try the mermaid version from the next branch." > Next< / a >
2023-09-15 10:23:07 +02:00
< / p >
2023-02-09 08:16:05 +01:00
< br >
< br >
2022-10-08 03:27:19 +02:00
2023-02-10 08:01:14 +01:00
[![NPM ](https://img.shields.io/npm/v/mermaid )](https://www.npmjs.com/package/mermaid)
[![Build CI Status ](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml/badge.svg )](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml)
[![npm minified gzipped bundle size ](https://img.shields.io/bundlephobia/minzip/mermaid )](https://bundlephobia.com/package/mermaid)
2023-06-17 16:29:43 +02:00
[![Coverage Status ](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg )](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
2023-02-10 08:01:14 +01:00
[![CDN Status ](https://img.shields.io/jsdelivr/npm/hm/mermaid )](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads ](https://img.shields.io/npm/dm/mermaid )](https://www.npmjs.com/package/mermaid)
2024-01-23 08:56:44 +01:00
[![Join our Discord! ](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord )](https://discord.gg/wwtabKgp8y)
2023-10-07 10:38:29 +02:00
[![Twitter Follow ](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X )](https://twitter.com/mermaidjs_)
2021-10-02 18:02:40 +02:00
2022-04-06 20:05:33 +02:00
< img src = "./img/header.png" alt = "" / >
2020-07-31 09:38:03 +02:00
2020-09-24 23:38:37 +02:00
:trophy: **Mermaid was nominated and won the [JS Open Source Awards (2019)](https://osawards.com/javascript/2019) in the category "The most exciting use of technology"!!!**
2020-07-31 09:38:03 +02:00
2021-04-25 14:05:42 +02:00
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
2020-07-31 09:38:03 +02:00
2022-12-15 20:07:37 +01:00
< a href = "https://mermaid-js.github.io/mermaid/landing/" > < img src = "https://github.com/mermaid-js/mermaid/blob/master/docs/intro/img/book-banner-post-release.jpg" alt = "Explore Mermaid.js in depth, with real-world examples, tips & tricks from the creator... The first official book on Mermaid is available for purchase. Check it out!" > < / a >
2021-08-11 18:28:35 +02:00
2023-10-19 22:48:49 +02:00
## Table of content
< details >
< summary > Expand contents< / summary >
- [About ](#about )
- [Examples ](#examples )
- [Release ](#release )
- [Related projects ](#related-projects )
- [Contributors ](#contributors )
- [Security and safe diagrams ](#security-and-safe-diagrams )
- [Reporting vulnerabilities ](#reporting-vulnerabilities )
- [Appreciation ](#appreciation )
< / details >
2020-08-15 15:10:09 +02:00
## About
2021-01-28 21:29:40 +01:00
<!-- <Main description> -->
2022-09-04 21:30:47 +02:00
Mermaid is a JavaScript-based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
2020-02-22 06:11:21 +01:00
2020-08-15 14:59:34 +02:00
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
2020-07-31 09:55:01 +02:00
2020-08-15 15:10:09 +02:00
Diagramming and documentation costs precious developer time and gets outdated quickly.
2022-02-28 09:01:03 +01:00
But not having diagrams or docs ruins productivity and hurts organizational learning.< br / >
2022-09-04 21:30:47 +02:00
Mermaid addresses this problem by enabling users to create easily modifiable diagrams. It can also be made part of production scripts (and other pieces of code).< br / >
< br / >
2022-05-02 07:49:30 +02:00
2022-06-24 07:41:22 +02:00
Mermaid allows even non-programmers to easily create detailed diagrams through the [Mermaid Live Editor ](https://mermaid.live/ ).< br />
2024-01-04 02:07:21 +01:00
For video tutorials, visit our [Tutorials ](./docs/ecosystem/tutorials.md ) page.
2023-09-29 08:52:53 +02:00
Use Mermaid with your favorite applications, check out the list of [Integrations and Usages of Mermaid ](./docs/ecosystem/integrations-community.md ).
2020-07-31 09:38:03 +02:00
2023-09-29 08:52:53 +02:00
You can also use Mermaid within [GitHub ](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/ ) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid ](./docs/ecosystem/integrations-community.md ).
2020-07-31 09:38:03 +02:00
2024-01-04 02:07:21 +01:00
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide ](./docs/intro/getting-started.md ), [Usage ](./docs/config/usage.md ) and [Tutorials ](./docs/ecosystem/tutorials.md ).
2020-07-31 09:38:03 +02:00
2022-05-10 20:33:55 +02:00
In our release process we rely heavily on visual regression tests using [applitools ](https://applitools.com/ ). Applitools is a great service which has been easy to use and integrate with our tests.
< a href = "https://applitools.com/" >
< svg width = "170" height = "32" viewBox = "0 0 170 32" fill = "none" xmlns = "http://www.w3.org/2000/svg" > < mask id = "a" maskUnits = "userSpaceOnUse" x = "27" y = "0" width = "143" height = "32" > < path fill-rule = "evenodd" clip-rule = "evenodd" d = "M27.732.227h141.391v31.19H27.733V.227z" fill = "#fff" > < / path > < / mask > < g mask = "url(#a)" > < path fill-rule = "evenodd" clip-rule = "evenodd" d = "M153.851 22.562l1.971-3.298c1.291 1.219 3.837 2.402 5.988 2.402 1.971 0 2.903-.753 2.903-1.829 0-2.832-10.253-.502-10.253-7.313 0-2.904 2.51-5.45 7.099-5.45 2.904 0 5.234 1.004 6.955 2.367l-1.829 3.226c-1.039-1.075-3.011-2.008-5.126-2.008-1.65 0-2.725.717-2.725 1.685 0 2.546 10.289.395 10.289 7.386 0 3.19-2.724 5.52-7.528 5.52-3.012 0-5.916-1.003-7.744-2.688zm-5.7 2.259h4.553V.908h-4.553v23.913zm-6.273-8.676c0-2.689-1.578-5.02-4.446-5.02-2.832 0-4.409 2.331-4.409 5.02 0 2.724 1.577 5.055 4.409 5.055 2.868 0 4.446-2.33 4.446-5.055zm-13.588 0c0-4.912 3.442-9.07 9.142-9.07 5.736 0 9.178 4.158 9.178 9.07 0 4.911-3.442 9.106-9.178 9.106-5.7 0-9.142-4.195-9.142-9.106zm-5.628 0c0-2.689-1.577-5.02-4.445-5.02-2.832 0-4.41 2.331-4.41 5.02 0 2.724 1.578 5.055 4.41 5.055 2.868 0 4.445-2.33 4.445-5.055zm-13.587 0c0-4.912 3.441-9.07 9.142-9.07 5.736 0 9.178 4.158 9.178 9.07 0 4.911-3.442 9.106-9.178 9.106-5.701 0-9.142-4.195-9.142-9.106zm-8.425 4.338v-8.999h-2.868v-3.98h2.868V2.773h4.553v4.733h3.514v3.979h-3.514v7.78c0 1.111.574 1.936 1.578 1.936.681 0 1.326-.251 1.577-.538l.968 3.478c-.681.609-1.9 1.11-3.8 1.11-3.191 0-4.876-1.648-4.876-4.767zm-8.962 4.338h4.553V7.505h-4.553V24.82zm-.43-21.905a2.685 2.685 0 012.688-2.69c1.506 0 2.725 1.184 2.725 2.69a2.724 2.724 0 01-2.725 2.724c-1.47 0-2.688-1.219-2.688-2.724zM84.482 24.82h4.553V.908h-4.553v23.913zm-6.165-8.676c0-2.976-1.793-5.02-4.41-5.02-1.47 0-3.119.825-3.908 1.973v6.094c.753 1.111 2.438 2.008 3.908 2.008 2.617 0 4.41-2.044 4.41-5.055zm-8.318 6.453v8.82h-4.553V7.504H70v2.187c1.327-1.685 3.227-2.618 5.342-2.618 4.446 0 7.672 3.299 7.672 9.07 0 5.773-3.226 9.107-7.672 9.107-2.043 0-3.907-.86-5.342-2.653zm-10.718-6.453c0-2.976-1.793-5.02-4.41-5.02-1.47 0-3.119.825-3.908 1.973v6.094c.753 1.111 2.438 2.008 3.908 2.008 2.617 0 4.41-2.044 4.41-5.055zm-8.318 6.453v8.82H46.41V7.504h4.553v2.187c1.327-1.685 3.227-2.618 5.342-2.618 4.446 0 7.672 3.299 7.672 9.07 0 5.773-3.226 9.107-7.672 9.107-2.043 0-3.908-.86-5.342-2.653zm-11.758-1.936V18.51c-.753-1.004-2.187-1.542-3.657-1.542-1.793 0-3.263.968-3.263 2.617 0 1.65 1.47 2.582 3.263 2.582 1.47 0 2.904-.502 3.657-1.506zm0 4.159v-1.829c-1.183 1.434-3.227 2.259-5.485 2.259-2.761 0-5.988-1.864-5.988-5.736 0-4.087 3.227-5.593 5.988-5.593 2.33 0 4.337.753 5.485 2.115V13.85c0-1.756-1.506-2.904-3.8-2.904-1.829 0-3.55.717-4.984 2.044L28.63 9.8c2.115-1.901 4.84-2.726 7.564-2.726 3.98 0 7.6 1.578 7.6 6.561v11.186h-4.588z" fill = "#00A298" > < / path > < / g > < path fill-rule = "evenodd" clip-rule = "evenodd" d = "M14.934 16.177c0 1.287-.136 2.541-.391 3.752-1.666-1.039-3.87-2.288-6.777-3.752 2.907-1.465 5.11-2.714 6.777-3.753.255 1.211.39 2.466.39 3.753m4.6-7.666V4.486a78.064 78.064 0 01-4.336 3.567c-1.551-2.367-3.533-4.038-6.14-5.207C11.1 4.658 12.504 6.7 13.564 9.262 5.35 15.155 0 16.177 0 16.177s5.35 1.021 13.564 6.915c-1.06 2.563-2.463 4.603-4.507 6.415 2.607-1.169 4.589-2.84 6.14-5.207a77.978 77.978 0 014.336 3.568v-4.025s-.492-.82-2.846-2.492c.6-1.611.93-3.354.93-5.174a14.8 14.8 0 00-.93-5.174c2.354-1.673 2.846-2.492 2.846-2.492" fill = "#00A298" > < / path > < / svg >
< / a >
2019-11-01 18:38:00 +01:00
<!-- </Main description> -->
2020-08-15 14:59:34 +02:00
## Examples
2022-09-04 21:30:47 +02:00
**The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here to jump into the [text syntax ](https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference ).**
2019-11-01 18:38:00 +01:00
<!-- <Flowchart> -->
2022-01-28 09:49:07 +01:00
2022-06-24 07:41:22 +02:00
### Flowchart [<a href="https://mermaid-js.github.io/mermaid/#/flowchart">docs</a> - <a href="https://mermaid.live/edit#pako:eNpNkMtqwzAQRX9FzKqFJK7t1km8KDQP6KJQSLOLvZhIY1tgS0GWmgbb_165IaFaiXvOFTPqgGtBkEJR6zOv0Fj2scsU8-ft8I5G5Gw6fe339GN7tnrYaafE45WvRsLW3Ya4bKVWwzVe_xU-FfVsc9hR62rLwvw_2591z7Y3FuUwgYZMg1L4ObrRzMBW1FAGqb8KKtCLGWRq8Ko7CbS0FdJqA2mBdUsTQGf110VxSK1xdJM2EkuDzd2qNQrypQ7s5TQuXcrW-ie5VoUsx9yZ2seVtac2DYIRz0ppK3eccd0ErRTjD1XfyyRIomSBUUzJPMaXOBb8GC4XRfQcFmL-FEYIwzD8AggvcHE">live editor</a>]
2022-01-28 09:49:07 +01:00
```
2022-05-10 20:33:55 +02:00
flowchart LR
2022-04-18 07:04:31 +02:00
2019-11-01 18:38:00 +01:00
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
2022-01-28 09:49:07 +01:00
```
2022-09-04 21:30:47 +02:00
2022-01-28 09:49:07 +01:00
```mermaid
flowchart LR
2022-04-18 07:03:34 +02:00
2022-01-28 09:49:07 +01:00
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
```
2022-06-24 07:41:22 +02:00
### Sequence diagram [<a href="https://mermaid-js.github.io/mermaid/#/sequenceDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNo9kMluwjAQhl_F-AykQMuSA1WrbuLQQ3v1ZbAnsVXHkzrjVhHi3etQwKfRv4w-z0FqMihL2eF3wqDxyUEdoVHhwTuNk-12RzaU4g29JzHMY2HpV0BE0VO6V8ETtdkGz1Zb1F8qiPyG5LX84mrLAmpwoWNh-5a0pWCiAxUwGBXeiVHEU4oq8V_6AHYUwAu2lLLTjVQ4bc1rT2yleI0IfJG320faZ9ABbk-Jz3hZnFxBduR9L2oiM5Jj2WBswJn8-cMArSRbbFDJMo8GK0ielVThmKOpNcD4bBxTlGUFvsOxhMT02QctS44JL6HzAS-iJzCYOwfJfTscunYd542aQuXqQU_RZ9kyt11ZFIM9rR3btJ9qaorOGQuR7c9mWSznyzXMF7hcLeBusTB6P9usq_ntrDKrm9kc5PF4_AMJE56Z">live editor</a>]
2022-01-28 10:26:10 +01:00
2022-01-28 10:39:48 +01:00
```
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2016-07-27 13:31:21 +02:00
sequenceDiagram
2019-11-01 18:38:00 +01:00
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
2022-01-28 10:26:10 +01:00
```
2022-06-24 07:41:22 +02:00
### Gantt chart [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNp90cGOgyAQBuBXIZxtFbG29bbZ3fsmvXKZylhJEAyOTZrGd1_sto3xsHMBhu-HBO689hp5xS_giJQbsCbjHTv9jcp9-q63SKhZpb3DhMXSOIiE5ZkoNpnYZGXynh6U-4jBK7JnVfBYJo9QvgjtEya1cj8QwFq0TMz4lZqxTBg0hOF5m1jifI2Lf7Bc490CyxUu1rhc4GLGPOEdhg6Mjq92V44xxanFDhWv4lRjA6MlxZWbIh17DYTf2pAPvGrADphwGMmfbq7mFYURX-jLwCVA91bWg8YYunO69Y8vMgPFI2vvGnOZ-2Owsd0S9UOVpvP29mKoHc_b2nfpYHQLgdrrsUzLvDxALrHcS9hJqeuzOB6avBCN3mciBz5N0y_wxZ0J">live editor</a>]
2022-01-28 10:26:10 +01:00
2022-01-28 10:39:48 +01:00
```
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2017-09-01 10:01:03 +02:00
gantt
2022-01-28 10:26:10 +01:00
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
```
2022-06-24 07:41:22 +02:00
### Class diagram [<a href="https://mermaid-js.github.io/mermaid/#/classDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkTFPwzAQhf-K5QlQ2zQJJG1UBaGWDYmBgYEwXO1LYuTEwXYqlZL_jt02asXm--690zvfgTLFkWaUSTBmI6DS0BTt2lfzkKx-p1PytEO9f1FtdaQkI2ulZNGuVqK1qEtgmOfk7BitSzKdOhg59XuNGgk0RDxed-_IOr6uf8cZ6UhTZ8bvHqS5ub1mr9svZPbjk6DEBlu7AQuXyBkx4gcvDk9cUMJq0XT_YaW0kNK5j-ufAoRzcihaQvLcoN4Jv50vvVxw_xrnD3RCG9QNCO4-8OgpqK1dpoJm7smxhF7agp6kfcfB4jMXVmmalW4tnFDorXrbt4xmVvc4is53GKFUwNF5DtTuO3-sShjrJjLVlqLyvNfS4drazmRB4NuzSti6386YagIjeA3a1rtlEiRRsoAoxiSN4SGOOduGy0UZ3YclT-dhBHQYhj8dc6_I">live editor</a>]
2022-01-28 10:26:10 +01:00
2022-01-28 10:39:48 +01:00
```
classDiagram
Class01 < |-- AveryLongClass : Cool
< < Interface > > Class01
2022-08-19 18:55:50 +02:00
Class09 --> C2 : Where am I?
2022-01-28 10:39:48 +01:00
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
< < service > >
int id
size()
}
2023-08-28 00:23:59 +02:00
2022-01-28 10:39:48 +01:00
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2016-07-27 13:31:21 +02:00
classDiagram
2022-01-28 10:39:48 +01:00
Class01 < |-- AveryLongClass : Cool
< < Interface > > Class01
2022-08-19 18:55:50 +02:00
Class09 --> C2 : Where am I?
2017-09-16 04:27:17 +02:00
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
2019-10-04 23:49:58 +02:00
class Class10 {
2022-01-28 10:39:48 +01:00
< < service > >
2019-10-04 23:49:58 +02:00
int id
size()
}
2023-08-28 00:23:59 +02:00
2022-01-28 10:26:10 +01:00
```
2022-06-24 07:41:22 +02:00
### State diagram [<a href="https://mermaid-js.github.io/mermaid/#/stateDiagram">docs</a> - <a href="https://mermaid.live/edit#pako:eNpdkEFvgzAMhf8K8nEqpYSNthx22Xbcqcexg0sCiZQQlDhIFeK_L8A6TfXp6fOz9ewJGssFVOAJSbwr7ByadGR1n8T6evpO0vQ1uZDSekOrXGFsPqJPO6q-2-imH8f_0TeHXm50lfelsAMjnEHFY6xpMdRAUhhRQxUlFy0GTTXU_RytYeAx-AdXZB1ULWovdoCB7OXWN1CRC-Ju-r3uz6UtchGHJqDbsPygU57iysb2reoWHpyOWBINvsqypb3vFMlw3TfWZF5xiY7keC6zkpUnZIUojwW-FAVvrvn51LLnvOXHQ84Q5nn-AVtLcwk">live editor</a>]
2022-09-04 21:30:47 +02:00
2022-01-28 10:39:48 +01:00
```
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2020-10-14 17:23:10 +02:00
stateDiagram-v2
2019-11-01 18:38:00 +01:00
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
2022-01-28 10:26:10 +01:00
```
2022-06-24 07:41:22 +02:00
### Pie chart [<a href="https://mermaid-js.github.io/mermaid/#/pie">docs</a> - <a href="https://mermaid.live/edit#pako:eNo9jsFugzAMhl8F-VzBgEEh13Uv0F1zcYkTIpEEBadShXj3BU3dzf_n77e8wxQUgYDVkvQSbsFsEgpRtEN_5i_kvzx05XiC-xvUHVzAUXRoVe7v0heFBJ7JkQSRR0Ua08ISpD-ymlaFTN_KcoggNC4bXQATh5-Xn0BwTPSWbhZNRPdvLQEV5dIO_FrPZ43dOJ-cgtfWnDzFJeOZed1EVZ3r0lie06Ocgqs2q2aMPD_HvuqbfsCmpf7aYte2anrU46Cbz1qr60fdIBzH8QvW9lkl">live editor</a>]
2022-01-28 10:26:10 +01:00
2022-01-28 10:39:48 +01:00
```
pie
"Dogs" : 386
2022-06-24 07:41:22 +02:00
"Cats" : 85.9
2022-01-28 10:39:48 +01:00
"Rats" : 15
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2019-11-01 18:38:00 +01:00
pie
"Dogs" : 386
2022-06-24 07:41:22 +02:00
"Cats" : 85.9
2020-04-28 09:28:16 +02:00
"Rats" : 15
2022-01-28 10:26:10 +01:00
```
2022-06-24 07:41:22 +02:00
### Git graph [experimental - <a href="https://mermaid.live/edit#pako:eNqNkMFugzAMhl8F-VyVAR1tOW_aA-zKxSSGRCMJCk6lCvHuNZPKZdM0n-zf3_8r8QIqaIIGMqnB8kfEybQ--y4VnLP8-9RF9Mpkmm40hmlnDKmvkPiH_kfS7nFo_VN0FAf6XwocQGgxa_nGsm1bYEOOWmik1dRjGrmF1q-Cpkkj07u2HCI0PY4zHQATh8-7V9BwTPSE3iwOEd1OjQE1iWkBvk_bzQY7s0Sq4Hs7bHqKo8iGeZqbPN_WR7mpSd1RHpvPVhuMbG7XOq_L-oJlRfW5wteq0qorrpe-PBW9Pr8UJcK6rg-BLYPQ">live editor</a>]
2022-01-28 10:26:10 +01:00
2023-03-31 09:01:28 +02:00
### Bar chart (using gantt chart) [<a href="https://mermaid-js.github.io/mermaid/#/gantt">docs</a> - <a href="https://mermaid.live/edit#pako:eNptkU1vhCAQhv8KIenNugiI4rkf6bmXpvEyFVxJFDYyNt1u9r8X63Z7WQ9m5pknLzieaBeMpQ3dg0dsPUkPOhwteXZIXmJcbCT3xMAxkuh8Z8kIEclyMIB209fqKcwTICFvG4IvFy_oLrZ-g9F26ILfQgvNFN94VaRXQ1iWqpumZBcu1J8p1E1TXDx59eQNr5LyEqjJn6hv5QnGNlxevZJmdLLpy5xJSzut45biYCfb0iaVxvawjNjS1p-TCguG16PvaIPzYjO67e3BwX6GiTY9jPFKH43DMF_hGMDY1J4oHg-_f8hFTJFd8L3br3yZx4QHxENsdrt1nO8dDstH3oVpF50ZYMbhU6ud4qoGLqyqBJRCmO6j0HXPZdGbihUc6Pmc0QP49xD-b5X69ZQv2gjO81IwzWqhC1lKrjJ6pA3nVS7SMiVjrKirWlYp5fs3osgrWeo00lorLWvOzz8JVbXm">live editor</a>]
2023-03-31 08:36:50 +02:00
```
gantt
2023-03-31 09:01:28 +02:00
title Git Issues - days since last update
2023-03-31 08:36:50 +02:00
dateFormat X
axisFormat %s
2023-03-31 09:01:28 +02:00
section Issue19062
2023-03-31 08:36:50 +02:00
71 : 0, 71
2023-03-31 09:01:28 +02:00
section Issue19401
2023-03-31 08:36:50 +02:00
36 : 0, 36
2023-03-31 09:01:28 +02:00
section Issue193
2023-03-31 08:36:50 +02:00
34 : 0, 34
2023-03-31 09:01:28 +02:00
section Issue7441
2023-03-31 08:36:50 +02:00
9 : 0, 9
2023-03-31 09:01:28 +02:00
section Issue1300
2023-03-31 08:36:50 +02:00
5 : 0, 5
```
```mermaid
gantt
2023-03-31 09:01:28 +02:00
title Git Issues - days since last update
2023-03-31 08:36:50 +02:00
dateFormat X
axisFormat %s
2023-03-31 09:01:28 +02:00
section Issue19062
2023-03-31 08:36:50 +02:00
71 : 0, 71
2023-03-31 09:01:28 +02:00
section Issue19401
2023-03-31 08:36:50 +02:00
36 : 0, 36
2023-03-31 09:01:28 +02:00
section Issue193
2023-03-31 08:36:50 +02:00
34 : 0, 34
2023-03-31 09:01:28 +02:00
section Issue7441
2023-03-31 08:36:50 +02:00
9 : 0, 9
2023-03-31 09:01:28 +02:00
section Issue1300
2023-03-31 08:36:50 +02:00
5 : 0, 5
```
2022-06-24 07:41:22 +02:00
### User Journey diagram [<a href="https://mermaid-js.github.io/mermaid/#/user-journey">docs</a> - <a href="https://mermaid.live/edit#pako:eNplkMFuwjAQRH9l5TMiTVIC-FqqnjhxzWWJN4khsSN7XRSh_HsdKBVt97R6Mzsj-yoqq0hIAXCywRkaSwNxWHNHsB_hYt1ZmwYUfiueKtbWwIcFtjf5zgH2eCZgQgkrCXt64GgMg2fUzkvIn5Xd_V5COtMFvCH_62ht_5yk7MU8sn61HDTfxD8VYiF6cj1qFd94nWkpuKWYKWRcFdUYOi5FaaZoDYNCpnel2Toha-w8LQQGtofRVEKyC_Qw7TQ2DvsfV2dRUTy6Ch6H-UMb7TlGVtbUupl5cF3ELfPgZZLM8rLR3IbjsrJ94rVq0XH7uS2SIis2mOVUrHNc5bmqjul2U2evaa3WL2mGYpqmL2BGiho">live editor</a>]
2022-09-04 21:30:47 +02:00
2022-01-28 10:39:48 +01:00
```
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: 3: Me
```
2022-09-04 21:30:47 +02:00
2022-01-28 10:26:10 +01:00
```mermaid
2020-04-04 17:38:30 +02:00
journey
2020-04-28 09:42:43 +02:00
title My working day
2020-04-04 17:38:30 +02:00
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: 3: Me
2022-01-28 10:26:10 +01:00
```
2019-11-01 18:38:00 +01:00
2022-06-20 10:04:30 +02:00
### C4 diagram [<a href="https://mermaid-js.github.io/mermaid/#/c4c">docs</a>]
```
C4Context
title System Context diagram for Internet Banking System
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
Person(customerB, "Banking Customer B")
Person_Ext(customerC, "Banking Customer C")
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
Person(customerD, "Banking Customer D", "A customer of the bank, < br / > with personal bank accounts.")
Enterprise_Boundary(b1, "BankBoundary") {
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
System_Boundary(b2, "BankBoundary2") {
System(SystemA, "Banking System A")
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts.")
}
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
Boundary(b3, "BankBoundary3", "boundary") {
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank, with personal bank accounts.")
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
}
}
BiRel(customerA, SystemAA, "Uses")
BiRel(SystemAA, SystemE, "Uses")
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
Rel(SystemC, customerA, "Sends e-mails to")
```
2022-09-04 21:30:47 +02:00
2022-06-20 10:04:30 +02:00
```mermaid
C4Context
title System Context diagram for Internet Banking System
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
Person(customerB, "Banking Customer B")
Person_Ext(customerC, "Banking Customer C")
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
Person(customerD, "Banking Customer D", "A customer of the bank, < br / > with personal bank accounts.")
Enterprise_Boundary(b1, "BankBoundary") {
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
System_Boundary(b2, "BankBoundary2") {
System(SystemA, "Banking System A")
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts.")
}
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
Boundary(b3, "BankBoundary3", "boundary") {
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank, with personal bank accounts.")
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
}
}
BiRel(customerA, SystemAA, "Uses")
BiRel(SystemAA, SystemE, "Uses")
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
Rel(SystemC, customerA, "Sends e-mails to")
```
2022-04-06 20:05:33 +02:00
## Release
2022-02-24 19:23:44 +01:00
For those who have the permission to do so:
Update version number in `package.json` .
```sh
npm publish
```
2023-06-26 17:21:09 +02:00
The above command generates files into the `dist` folder and publishes them to < https: // www . npmjs . com > .
2022-02-24 19:23:44 +01:00
2020-04-28 09:28:16 +02:00
## Related projects
2019-11-01 18:38:00 +01:00
2020-06-25 16:24:45 +02:00
- [Command Line Interface ](https://github.com/mermaid-js/mermaid-cli )
2019-11-01 18:38:00 +01:00
- [Live Editor ](https://github.com/mermaid-js/mermaid-live-editor )
2020-04-15 20:29:17 +02:00
- [HTTP Server ](https://github.com/TomWright/mermaid-server )
2019-11-01 18:38:00 +01:00
2021-12-05 22:10:41 +01:00
## Contributors [![Good first issue](https://img.shields.io/github/labels/mermaid-js/mermaid/Good%20first%20issue%21)](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+issue%21%22) [![Contributors](https://img.shields.io/github/contributors/mermaid-js/mermaid)](https://github.com/mermaid-js/mermaid/graphs/contributors) [![Commits](https://img.shields.io/github/commit-activity/m/mermaid-js/mermaid)](https://github.com/mermaid-js/mermaid/graphs/contributors)
2019-11-01 18:38:00 +01:00
Mermaid is a growing community and is always accepting new contributors. There's a lot of different ways to help out and we're always looking for extra hands! Look at [this issue ](https://github.com/mermaid-js/mermaid/issues/866 ) if you want to know where to start helping out.
Detailed information about how to contribute can be found in the [contribution guide ](CONTRIBUTING.md )
2022-02-17 18:20:43 +01:00
## Security and safe diagrams
2023-06-26 17:21:09 +02:00
For public sites, it can be precarious to retrieve text from users on the internet, storing that content for presentation in a browser at a later stage. The reason is that the user content can contain embedded malicious scripts that will run when the data is presented. For Mermaid this is a risk, specially as mermaid diagrams contain many characters that are used in html which makes the standard sanitation unusable as it also breaks the diagrams. We still make an effort to sanitize the incoming code and keep refining the process but it is hard to guarantee that there are no loop holes.
2022-02-17 18:20:43 +01:00
2022-09-04 21:30:47 +02:00
As an extra level of security for sites with external users we are happy to introduce a new security level in which the diagram is rendered in a sandboxed iframe preventing javascript in the code from being executed. This is a great step forward for better security.
2022-02-17 18:20:43 +01:00
2022-09-04 21:30:47 +02:00
_Unfortunately you can not have a cake and eat it at the same time which in this case means that some of the interactive functionality gets blocked along with the possible malicious code._
2022-02-17 18:20:43 +01:00
2022-01-18 08:39:26 +01:00
## Reporting vulnerabilities
2022-09-04 21:30:47 +02:00
2023-06-17 16:29:43 +02:00
To report a vulnerability, please e-mail < security @ mermaid . live > with a description of the issue, the steps you took to create the issue, affected versions, and if known, mitigations for the issue.
2022-01-18 08:39:26 +01:00
2020-08-15 14:59:34 +02:00
## Appreciation
2022-09-04 21:30:47 +02:00
2019-11-01 18:38:00 +01:00
A quick note from Knut Sveidqvist:
2022-09-04 21:30:47 +02:00
2022-10-28 21:26:01 +02:00
> _Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries!_
>
> _Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering._
>
> _Thank you to [Tyler Long](https://github.com/tylerlong) who has been a collaborator since April 2017._
2019-11-01 18:38:00 +01:00
>
2022-09-04 21:30:47 +02:00
> _Thank you to the ever-growing list of [contributors](https://github.com/knsv/mermaid/graphs/contributors) that brought the project this far!_
2019-11-01 18:38:00 +01:00
---
2014-12-12 19:05:27 +01:00
2022-09-04 21:30:47 +02:00
_Mermaid was created by Knut Sveidqvist for easier documentation._