Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: stevedep
  • License: mit
  • Language: JavaScript
  • Default Branch: main
  • Size: 2.35 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Citation

README.md

Mermaid

Generate diagrams from markdown-like text.

Live Editor!

📖 Documentation | 🚀 Getting Started | 🌐 CDN | 🙌 Join Us

简体中文

Try Live Editor previews of future releases: Develop | Next



NPM Build CI Status npm minified gzipped bundle size Coverage Status CDN Status NPM Downloads Join our Discord! Twitter Follow

:trophy: Mermaid was nominated and won the JS Open Source Awards (2019) in the category "The most exciting use of technology"!!!

Thanks to all involved, people committing pull requests, people answering questions! 🙏

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!

Table of content

Expand contents - [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)

About

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.

Doc-Rot is a Catch-22 that Mermaid helps to solve.

Diagramming and documentation costs precious developer time and gets outdated quickly. But not having diagrams or docs ruins productivity and hurts organizational learning.
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).

Mermaid allows even non-programmers to easily create detailed diagrams through the Mermaid Live Editor.
For video tutorials, visit our Tutorials page. Use Mermaid with your favorite applications, check out the list of Integrations and Usages of Mermaid.

You can also use Mermaid within GitHub as well many of your other favorite applications—check out the list of Integrations and Usages of Mermaid.

For a more detailed introduction to Mermaid and some of its more basic uses, look to the Beginner's Guide, Usage and Tutorials.

In our release process we rely heavily on visual regression tests using applitools. Applitools is a great service which has been easy to use and integrate with our tests.

Examples

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.

Flowchart [docs - live editor]

``` flowchart LR

A[Hard] -->|Text| B(Round) B --> C{Decision} C -->|One| D[Result 1] C -->|Two| E[Result 2] ```

```mermaid flowchart LR

A[Hard] -->|Text| B(Round) B --> C{Decision} C -->|One| D[Result 1] C -->|Two| E[Result 2] ```

Sequence diagram [docs - live editor]

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!

mermaid 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!

Gantt chart [docs - live editor]

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

mermaid 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

Class diagram [docs - live editor]

``` classDiagram Class01 <|-- AveryLongClass : Cool <> Class01 Class09 --> C2 : Where am I? Class09 --* C3 Class09 --|> Class07 Class07 : equals() Class07 : Object[] elementData Class01 : size() Class01 : int chimp Class01 : int gorilla class Class10 { <> int id size() }

```

```mermaid classDiagram Class01 <|-- AveryLongClass : Cool <> Class01 Class09 --> C2 : Where am I? Class09 --* C3 Class09 --|> Class07 Class07 : equals() Class07 : Object[] elementData Class01 : size() Class01 : int chimp Class01 : int gorilla class Class10 { <> int id size() }

```

State diagram [docs - live editor]

stateDiagram-v2 [*] --> Still Still --> [*] Still --> Moving Moving --> Still Moving --> Crash Crash --> [*]

mermaid stateDiagram-v2 [*] --> Still Still --> [*] Still --> Moving Moving --> Still Moving --> Crash Crash --> [*]

Pie chart [docs - live editor]

pie "Dogs" : 386 "Cats" : 85.9 "Rats" : 15

mermaid pie "Dogs" : 386 "Cats" : 85.9 "Rats" : 15

Git graph [experimental - live editor]

Bar chart (using gantt chart) [docs - live editor]

``` gantt title Git Issues - days since last update dateFormat X axisFormat %s

section Issue19062
71   : 0, 71
section Issue19401
36   : 0, 36
section Issue193
34   : 0, 34
section Issue7441
9    : 0, 9
section Issue1300
5    : 0, 5

```

```mermaid gantt title Git Issues - days since last update dateFormat X axisFormat %s

section Issue19062
71   : 0, 71
section Issue19401
36   : 0, 36
section Issue193
34   : 0, 34
section Issue7441
9    : 0, 9
section Issue1300
5    : 0, 5

```

User Journey diagram [docs - live editor]

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

mermaid 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

C4 diagram [docs]

``` 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,
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") ```

```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,
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") ```

Release

For those who have the permission to do so:

Update version number in package.json.

sh npm publish

The above command generates files into the dist folder and publishes them to https://www.npmjs.com.

Related projects

Contributors Good first issue Contributors Commits

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 if you want to know where to start helping out.

Detailed information about how to contribute can be found in the contribution guide

Security and safe diagrams

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.

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.

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.

Reporting vulnerabilities

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.

Appreciation

A quick note from Knut Sveidqvist:

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.

Thank you to Tyler Long who has been a collaborator since April 2017.

Thank you to the ever-growing list of contributors that brought the project this far!


Mermaid was created by Knut Sveidqvist for easier documentation.

Owner

  • Name: Steve de Peijper
  • Login: stevedep
  • Kind: user

Analytics professional with a special interest in Data Science and Office Automation / Productivity.

Citation (CITATION.cff)

cff-version: 1.2.0
title: 'Mermaid: Generate diagrams from markdown-like text'
message: >-
  If you use this software, please cite it using the metadata from this file.
type: software
authors:
  - family-names: Sveidqvist
    given-names: Knut
  - name: 'Contributors to Mermaid'
repository-code: 'https://github.com/mermaid-js/mermaid'
date-released: 2014-12-02
url: 'https://mermaid.js.org/'
abstract: >-
  JavaScript based diagramming and charting tool that renders Markdown-inspired
  text definitions to create and modify diagrams dynamically.
license: MIT

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

.github/workflows/build-docs.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • pnpm/action-setup v2 composite
.github/workflows/build.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • actions/upload-artifact v3 composite
  • pnpm/action-setup v2 composite
.github/workflows/check-readme-in-sync.yml actions
  • actions/checkout v4 composite
.github/workflows/checks.yml actions
  • actions/checkout v4 composite
  • testomatio/check-tests stable composite
.github/workflows/codeql.yml actions
  • actions/checkout v4 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/dependency-review.yml actions
  • actions/checkout v4 composite
  • actions/dependency-review-action v3 composite
.github/workflows/e2e-applitools.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • cypress-io/github-action v4 composite
  • pnpm/action-setup v2 composite
.github/workflows/e2e.yml actions
  • actions/cache v4 composite
  • actions/cache/restore v3 composite
  • actions/cache/save v3 composite
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/setup-node v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v3 composite
  • cypress-io/github-action v4 composite
  • pnpm/action-setup v2 composite
.github/workflows/issue-triage.yml actions
  • andymckay/labeler 1.0.4 composite
.github/workflows/link-checker.yml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • lycheeverse/lychee-action v1.9.3 composite
.github/workflows/lint.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • pnpm/action-setup v2 composite
.github/workflows/pr-labeler.yml actions
  • release-drafter/release-drafter v5 composite
.github/workflows/publish-docs.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v3 composite
  • actions/deploy-pages v2 composite
  • actions/setup-node v4 composite
  • actions/upload-pages-artifact v1 composite
  • pnpm/action-setup v2 composite
.github/workflows/release-draft.yml actions
  • release-drafter/release-drafter v5 composite
.github/workflows/release-preview-publish.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • pnpm/action-setup v2 composite
.github/workflows/release-publish.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • fregante/setup-git-user v2 composite
  • pnpm/action-setup v2 composite
.github/workflows/test.yml actions
  • actions/checkout v4 composite
  • actions/setup-node v4 composite
  • codecov/codecov-action v3 composite
  • pnpm/action-setup v2 composite
.github/workflows/unlock-reopened-issues.yml actions
  • Dunning-Kruger/unlock-issues v1 composite
.github/workflows/update-browserlist.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v4 composite
  • peter-evans/create-pull-request v5 composite
  • pnpm/action-setup v2 composite
Dockerfile docker
  • node 20.11.1-alpine3.19 build
docker-compose.yml docker
  • cypress/included 12.17.4
package.json npm
  • @applitools/eyes-cypress ^3.40.6 development
  • @commitlint/cli ^17.6.1 development
  • @commitlint/config-conventional ^17.6.1 development
  • @cspell/eslint-plugin ^8.3.2 development
  • @cypress/code-coverage ^3.12.18 development
  • @rollup/plugin-typescript ^11.1.1 development
  • @types/cors ^2.8.13 development
  • @types/eslint ^8.37.0 development
  • @types/express ^4.17.17 development
  • @types/js-yaml ^4.0.5 development
  • @types/jsdom ^21.1.1 development
  • @types/lodash ^4.14.194 development
  • @types/mdast ^3.0.11 development
  • @types/node ^20.11.10 development
  • @types/prettier ^2.7.2 development
  • @types/rollup-plugin-visualizer ^4.2.1 development
  • @typescript-eslint/eslint-plugin ^6.7.2 development
  • @typescript-eslint/parser ^6.7.2 development
  • @vitest/coverage-v8 ^0.34.0 development
  • @vitest/spy ^0.34.0 development
  • @vitest/ui ^0.34.0 development
  • ajv ^8.12.0 development
  • concurrently ^8.0.1 development
  • cors ^2.8.5 development
  • cspell ^8.3.2 development
  • cypress ^12.17.4 development
  • cypress-image-snapshot ^4.0.1 development
  • esbuild ^0.20.0 development
  • eslint ^8.47.0 development
  • eslint-config-prettier ^8.8.0 development
  • eslint-plugin-cypress ^2.13.2 development
  • eslint-plugin-html ^7.1.0 development
  • eslint-plugin-jest ^27.2.1 development
  • eslint-plugin-jsdoc ^46.0.0 development
  • eslint-plugin-json ^3.1.0 development
  • eslint-plugin-lodash ^7.4.0 development
  • eslint-plugin-markdown ^3.0.0 development
  • eslint-plugin-no-only-tests ^3.1.0 development
  • eslint-plugin-tsdoc ^0.2.17 development
  • eslint-plugin-unicorn ^47.0.0 development
  • express ^4.18.2 development
  • globby ^13.1.4 development
  • husky ^8.0.3 development
  • jest ^29.5.0 development
  • jison ^0.4.18 development
  • js-yaml ^4.1.0 development
  • jsdom ^22.0.0 development
  • lint-staged ^13.2.1 development
  • nyc ^15.1.0 development
  • path-browserify ^1.0.1 development
  • pnpm ^8.6.8 development
  • prettier ^2.8.8 development
  • prettier-plugin-jsdoc ^0.4.2 development
  • rimraf ^5.0.0 development
  • rollup-plugin-visualizer ^5.9.2 development
  • start-server-and-test ^2.0.0 development
  • tsx ^4.6.2 development
  • typescript ^5.1.3 development
  • vite ^4.5.2 development
  • vite-plugin-istanbul ^4.1.0 development
  • vitest ^0.34.0 development
packages/mermaid/package.json npm
  • @adobe/jsonschema2md ^7.1.4 development
  • @types/cytoscape ^3.19.9 development
  • @types/d3 ^7.4.0 development
  • @types/d3-sankey ^0.12.1 development
  • @types/d3-scale ^4.0.3 development
  • @types/d3-selection ^3.0.5 development
  • @types/d3-shape ^3.1.1 development
  • @types/dompurify ^3.0.2 development
  • @types/jsdom ^21.1.1 development
  • @types/katex ^0.16.7 development
  • @types/lodash-es ^4.17.7 development
  • @types/micromatch ^4.0.2 development
  • @types/prettier ^2.7.2 development
  • @types/stylis ^4.0.2 development
  • @types/uuid ^9.0.1 development
  • @typescript-eslint/eslint-plugin ^5.59.0 development
  • @typescript-eslint/parser ^5.59.0 development
  • ajv ^8.11.2 development
  • chokidar ^3.5.3 development
  • concurrently ^8.0.1 development
  • cpy-cli ^4.2.0 development
  • csstree-validator ^3.0.0 development
  • globby ^13.1.4 development
  • jison ^0.4.18 development
  • js-base64 ^3.7.5 development
  • jsdom ^22.0.0 development
  • json-schema-to-typescript ^11.0.3 development
  • micromatch ^4.0.5 development
  • path-browserify ^1.0.1 development
  • prettier ^2.8.8 development
  • remark ^14.0.2 development
  • remark-frontmatter ^4.0.1 development
  • remark-gfm ^3.0.1 development
  • rimraf ^5.0.0 development
  • start-server-and-test ^2.0.0 development
  • type-fest ^4.1.0 development
  • typedoc ^0.25.0 development
  • typedoc-plugin-markdown ^3.15.2 development
  • typescript ^5.0.4 development
  • unist-util-flatmap ^1.0.0 development
  • unist-util-visit ^4.1.2 development
  • vitepress ^1.0.0-rc.40 development
  • vitepress-plugin-search ^1.0.4-alpha.22 development
  • @braintree/sanitize-url ^6.0.1
  • @types/d3-scale ^4.0.3
  • @types/d3-scale-chromatic ^3.0.0
  • cytoscape ^3.28.1
  • cytoscape-cose-bilkent ^4.1.0
  • d3 ^7.4.0
  • d3-sankey ^0.12.3
  • dagre-d3-es 7.0.10
  • dayjs ^1.11.7
  • dompurify ^3.0.5
  • elkjs ^0.9.0
  • katex ^0.16.9
  • khroma ^2.0.0
  • lodash-es ^4.17.21
  • mdast-util-from-markdown ^1.3.0
  • non-layered-tidy-tree-layout ^2.0.2
  • stylis ^4.1.3
  • ts-dedent ^2.2.0
  • uuid ^9.0.0
  • web-worker ^1.2.0
packages/mermaid/src/docs/package.json npm
  • @iconify-json/carbon ^1.1.16 development
  • @unocss/reset ^0.58.0 development
  • @vite-pwa/vitepress ^0.4.0 development
  • @vitejs/plugin-vue ^4.2.1 development
  • fast-glob ^3.2.12 development
  • https-localhost ^4.7.1 development
  • pathe ^1.1.0 development
  • unocss ^0.58.0 development
  • unplugin-vue-components ^0.26.0 development
  • vite ^4.5.2 development
  • vite-plugin-pwa ^0.19.0 development
  • vitepress 1.0.0-rc.44 development
  • workbox-window ^7.0.0 development
  • @mdi/font ^6.9.96
  • @vueuse/core ^10.1.0
  • font-awesome ^4.7.0
  • jiti ^1.18.2
  • mermaid workspace:^
  • vue ^3.3
packages/mermaid-example-diagram/package.json npm
  • concurrently ^8.0.0 development
  • mermaid workspace:* development
  • rimraf ^5.0.0 development
  • @braintree/sanitize-url ^6.0.1
  • d3 ^7.0.0
  • khroma ^2.0.0
packages/mermaid-zenuml/package.json npm
  • mermaid workspace:^ development
  • @zenuml/core ^3.17.2
pnpm-lock.yaml npm
  • 679 dependencies
tests/webpack/package.json npm
  • webpack ^5.88.2 development
  • webpack-cli ^4.10.0 development
  • webpack-dev-server ^4.11.1 development
  • @mermaid-js/mermaid-example-diagram workspace:*
  • mermaid workspace:*