You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mermaidAPI.md
+94-83Lines changed: 94 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
This is the api to be used when optionally handling the integration with the web page, instead of using the default integration provided by mermaid.js.
6
6
7
-
The core of this api is the [**render**](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#render) function which, given a graph definition as text, renders the graph/diagram and returns an svg element for the graph.
7
+
The core of this api is the [**render**][1] function which, given a graph
8
+
definition as text, renders the graph/diagram and returns an svg element for the graph.
8
9
9
10
It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different.
10
11
@@ -13,50 +14,54 @@ In addition to the render function, a number of behavioral configuration options
13
14
## Configuration
14
15
15
16
These are the default options which can be overridden with the initialization call like so:
16
-
17
-
*Example 1:*
18
-
19
-
mermaid.initialize({
20
-
flowchart:{
21
-
htmlLabels: false
22
-
}
23
-
});
24
-
25
-
*Example 2:*
26
-
```
27
-
<script>
28
-
var config = {
29
-
startOnLoad:true,
30
-
flowchart:{
31
-
useMaxWidth:true,
32
-
htmlLabels:true,
33
-
curve:'cardinal',
34
-
},
35
-
36
-
securityLevel:'loose',
37
-
};
38
-
mermaid.initialize(config);
39
-
</script>
40
-
```
17
+
**Example 1:**
18
+
19
+
<pre>
20
+
mermaid.initialize({
21
+
flowchart:{
22
+
htmlLabels: false
23
+
}
24
+
});
25
+
</pre>
26
+
27
+
**Example 2:**
28
+
29
+
<pre>
30
+
<script>
31
+
var config = {
32
+
startOnLoad:true,
33
+
flowchart:{
34
+
useMaxWidth:true,
35
+
htmlLabels:true,
36
+
curve:'cardinal',
37
+
},
38
+
39
+
securityLevel:'loose',
40
+
};
41
+
mermaid.initialize(config);
42
+
</script>
43
+
44
+
</pre>
41
45
A summary of all options and their defaults is found [here](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#mermaidapi-configuration-defaults). A description of each option follows below.
42
46
43
-
44
47
## theme
45
48
46
49
theme , the CSS style sheet
47
50
48
51
**theme** - Choose one of the built-in themes:
49
-
- default
50
-
- forest
51
-
- dark
52
-
- neutral
53
52
54
-
To disable any pre-defined mermaid theme, use "null".
53
+
- default
54
+
- forest
55
+
- dark
56
+
- neutral.
57
+
To disable any pre-defined mermaid theme, use "null".
55
58
56
59
**themeCSS** - Use your own CSS. This overrides **theme**.
57
60
58
-
"theme": "forest",
59
-
"themeCSS": ".node rect { fill: red; }"
61
+
<pre>
62
+
"theme": "forest",
63
+
"themeCSS": ".node rect { fill: red; }"
64
+
</pre>
60
65
61
66
## logLevel
62
67
@@ -98,10 +103,11 @@ on the edges.
98
103
99
104
### curve
100
105
101
-
How mermaid renders curves for flowcharts. Possibel values are
102
-
- basis
103
-
- linear (**default**)
104
-
- cardinal
106
+
How mermaid renders curves for flowcharts. Possible values are
107
+
108
+
- basis
109
+
- linear **default**
110
+
- cardinal
105
111
106
112
## sequence
107
113
@@ -231,7 +237,6 @@ The number of alternating section styles.
231
237
### axisFormat
232
238
233
239
Datetime format of the axis. This might need adjustment to match your locale and preferences
234
-
235
240
**Default value '%Y-%m-%d'**.
236
241
237
242
## render
@@ -260,50 +265,56 @@ mermaidAPI.initialize({
260
265
provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
> A pie chart (or a circle chart) is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. In a pie chart, the arc length of each slice (and consequently its central angle and area), is proportional to the quantity it represents. While it is named for its resemblance to a pie which has been sliced, there are variations on the way it can be presented. The earliest known pie chart is generally credited to William Playfair's Statistical Breviary of 1801
4
+
5
+
Mermaid can render Pie Chart diagrams.
6
+
7
+
```
8
+
pie
9
+
"Dogs" : 386
10
+
"Cats" : 85
11
+
"Rats" : 15
12
+
```
13
+
```mermaid
14
+
pie title Pets adopted by volunteers
15
+
"Dogs" : 386
16
+
"Cats" : 85
17
+
"Rats" : 35
18
+
```
19
+
20
+
21
+
## Syntax
22
+
23
+
```
24
+
pie
25
+
"DataKey1" : Positive numeric value (upto two decimal places)
0 commit comments