Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown.
Generate diagrams from markdown-like text.
📖 Documentation | 🚀 Getting Started | 🌐 CDN | 🙌 Join Us
Try Live Editor previews of future releases: Develop | Next
🏆 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! 🙏
Table of content
Expand contents
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]
Release
For those who have the permission to do so:
Update version number in package.json
.
npm publish
The above command generates files into the dist
folder and publishes them to https://www.npmjs.com.
Related projects
Contributors
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!
from https://github.com/mermaid-js/mermaid
--------
开源的JavaScript图表工具-Mermaid
Mermaid是一款受到 Markdown 语法启发而诞生的 开源JavaScript 图表工具,由开发者 Knut Sveidqvist 开发维护。Mermaid通过解析类 Markdown 的文本语法来实现图表的创建和动态修改。Mermaid目标是让文档的更新能够及时跟上开发进度。遵守MIT开源协议。
Mermaid 通过允许用户创建便于修改的图表,可以作为生产脚本(或其他代码)的一部分。 Mermaid 甚至能让非程序员也能通过 Mermaid Live Editor 轻松创建详细的图表。
源代码:https://github.com/mermaid-js/mermaid
中文文档:https://github.com/mermaid-js/mermaid/blob/develop/README.zh-CN.md
No comments:
Post a Comment