knsv 78d8ee01ac #Adjustments of init - **could break some integrations!!**
* Configuration are picked up from the mermaid object and is not passed as arguments. Same handling for all diagram types, sequenceDiagrams were handled in a different way before this commit.

When init is called with:

* 0 arguments - all mermaid divs are processed
* 1 argument - this is interpreted as a definition of what nodes to process
* 2 arguments - for (some) backwards compatability the second argument is interpreted as the definition of nodes to process. The first argument (prrobably a sequence config is ignored)

A definition of nodes to process can be

* a css selector for what elements to be processed
* a list of nodes as in the result of a command like the one below

```
document.querySelectorAll('.tbProcessed');
```
2015-03-29 11:54:54 +02:00
2014-12-20 17:18:38 -08:00
2014-11-13 19:51:05 +01:00
2015-03-15 14:55:16 +01:00
2014-11-13 19:53:31 +01:00
2015-03-22 18:36:17 +01:00
2014-12-27 20:05:15 -05:00
2015-03-07 12:28:52 +01:00
2014-11-02 00:52:32 +01:00
2015-03-15 14:55:16 +01:00

mermaid Build Status Code Climate

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.

The code below would render the following image

CodeRendered diagram

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

Example 1

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!

Example 2

Further reading

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.

Knut has not done all work by him self, here is the full list of the projects contributors.

Description
Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
Readme MIT 367 MiB
Languages
TypeScript 47.8%
JavaScript 38%
HTML 9%
Yacc 4%
Mermaid 0.6%
Other 0.4%