mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-08 01:56:42 +02:00
Prettier
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.
|
||||
***
|
||||
|
||||
---
|
||||
|
||||
sort: 3
|
||||
title: Flowchart
|
||||
----------------
|
||||
|
||||
---
|
||||
|
||||
# Flowcharts - Basic Syntax
|
||||
|
||||
@@ -37,17 +39,17 @@ graph LR
|
||||
|
||||
Possible FlowChart orientations are:
|
||||
|
||||
* TB - top to bottom
|
||||
* TD - top-down (same as top to bottom)
|
||||
* BT - bottom to top
|
||||
* RL - right to left
|
||||
* LR - left to right
|
||||
- TB - top to bottom
|
||||
- TD - top-down (same as top to bottom)
|
||||
- BT - bottom to top
|
||||
- RL - right to left
|
||||
- LR - left to right
|
||||
|
||||
## Flowcharts
|
||||
|
||||
This renders a flowchart that allows for features such as: more arrow types, multi directional arrows, and linking to and from subgraphs.
|
||||
|
||||
Apart from the graph type, the syntax is the same. This is currently experimental. When the beta period is over, both the graph and flowchart keywords will render in this new way. At this point it is OK to start beta testing flowcharts.
|
||||
Apart from the graph type, the syntax is the same. This is currently experimental. When the beta period is over, both the graph and flowchart keywords will render in this new way. At this point it is OK to start beta testing flowcharts.
|
||||
|
||||
> **Important note** Do not type the word "end" as a Flowchart node. Capitalize all or any one the letters to keep the flowchart from breaking, i.e, "End" or "END". Or you can apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897).\*\*
|
||||
|
||||
@@ -157,7 +159,7 @@ graph LR
|
||||
id1>This is the text in the box]
|
||||
```
|
||||
|
||||
Currently it is only possible to render the shape above, and not its mirror. *This might change with future releases.*
|
||||
Currently it is only possible to render the shape above, and not its mirror. _This might change with future releases._
|
||||
|
||||
### A node (rhombus)
|
||||
|
||||
@@ -449,8 +451,8 @@ orientation), based on the nodes to which it is linked. By default, links
|
||||
can span any number of ranks, but you can ask for any link to be longer
|
||||
than the others by adding extra dashes in the link definition.
|
||||
|
||||
In the following example, two extra dashes are added in the link from node *B*
|
||||
to node *E*, so that it spans two more ranks than regular links:
|
||||
In the following example, two extra dashes are added in the link from node _B_
|
||||
to node _E_, so that it spans two more ranks than regular links:
|
||||
|
||||
```mermaid-example
|
||||
graph TD
|
||||
@@ -498,12 +500,12 @@ graph TD
|
||||
For dotted or thick links, the characters to add are equals signs or dots,
|
||||
as summed up in the following table:
|
||||
|
||||
| Length | 1 | 2 | 3 |
|
||||
|-------------------|:------:|:-------:|:--------:|
|
||||
| Normal | `---` | `----` | `-----` |
|
||||
| Normal with arrow | `-->` | `--->` | `---->` |
|
||||
| Thick | `===` | `====` | `=====` |
|
||||
| Thick with arrow | `==>` | `===>` | `====>` |
|
||||
| Length | 1 | 2 | 3 |
|
||||
| ----------------- | :----: | :-----: | :------: |
|
||||
| Normal | `---` | `----` | `-----` |
|
||||
| Normal with arrow | `-->` | `--->` | `---->` |
|
||||
| Thick | `===` | `====` | `=====` |
|
||||
| Thick with arrow | `==>` | `===>` | `====>` |
|
||||
| Dotted | `-.-` | `-..-` | `-...-` |
|
||||
| Dotted with arrow | `-.->` | `-..->` | `-...->` |
|
||||
|
||||
@@ -634,14 +636,14 @@ A node can have click events bound that lead to either a JavaScript callback or
|
||||
click nodeId callback
|
||||
click nodeId call callback()
|
||||
|
||||
* nodeId is the id of the node
|
||||
* `callback` is the name of a JavaScript function defined on the page displaying the graph. The function will be called with the nodeId as an incoming parameter.
|
||||
- nodeId is the id of the node
|
||||
- `callback` is the name of a JavaScript function defined on the page displaying the graph. The function will be called with the nodeId as an incoming parameter.
|
||||
|
||||
```html
|
||||
<script>
|
||||
var callback = function (nodeId) {
|
||||
alert('A callback was triggered on ' + nodeId);
|
||||
};
|
||||
var callback = function (nodeId) {
|
||||
alert('A callback was triggered on ' + nodeId);
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
@@ -705,38 +707,33 @@ Beginner's tip—here's a full example of using interactive links in HTML:
|
||||
|
||||
```html
|
||||
<body>
|
||||
<div class="mermaid">
|
||||
graph LR;
|
||||
A-->B;
|
||||
B-->C;
|
||||
C-->D;
|
||||
click A callback "Tooltip"
|
||||
click B "https://www.github.com" "This is a link"
|
||||
click C call callback() "Tooltip"
|
||||
click D href "https://www.github.com" "This is a link"
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
graph LR; A-->B; B-->C; C-->D; click A callback "Tooltip" click B "https://www.github.com"
|
||||
"This is a link" click C call callback() "Tooltip" click D href "https://www.github.com"
|
||||
"This is a link"
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var callback = function () {
|
||||
alert('A callback was triggered');
|
||||
};
|
||||
var config = {
|
||||
startOnLoad: true,
|
||||
flowchart: {
|
||||
useMaxWidth: true,
|
||||
htmlLabels: true,
|
||||
curve: 'cardinal'
|
||||
},
|
||||
securityLevel: 'loose'
|
||||
};
|
||||
mermaid.initialize(config);
|
||||
</script>
|
||||
<script>
|
||||
var callback = function () {
|
||||
alert('A callback was triggered');
|
||||
};
|
||||
var config = {
|
||||
startOnLoad: true,
|
||||
flowchart: {
|
||||
useMaxWidth: true,
|
||||
htmlLabels: true,
|
||||
curve: 'cardinal',
|
||||
},
|
||||
securityLevel: 'loose',
|
||||
};
|
||||
mermaid.initialize(config);
|
||||
</script>
|
||||
</body>
|
||||
```
|
||||
|
||||
### Comments
|
||||
|
||||
Comments can be entered within a flow diagram, which will be ignored by the parser. Comments need to be on their own line, and must be prefaced with `%%` (double percent signs). Any text until the next newline will be treated as a comment, including all punctuation and any flow syntax.
|
||||
Comments can be entered within a flow diagram, which will be ignored by the parser. Comments need to be on their own line, and must be prefaced with `%%` (double percent signs). Any text until the next newline will be treated as a comment, including all punctuation and any flow syntax.
|
||||
|
||||
```mmd
|
||||
graph LR
|
||||
@@ -825,8 +822,8 @@ It is also possible to predefine classes in css styles that can be applied from
|
||||
|
||||
```css
|
||||
.cssClass > rect {
|
||||
fill: #FF0000;
|
||||
stroke: #FFFF00;
|
||||
fill: #ff0000;
|
||||
stroke: #ffff00;
|
||||
stroke-width: 4px;
|
||||
}
|
||||
```
|
||||
@@ -855,7 +852,7 @@ If a class is named `default` it will be assigned to all nodes that do not have
|
||||
|
||||
## Basic support for fontawesome
|
||||
|
||||
It is possible to add icons from fontawesome. These are accessed via the syntax fa:#icon-class-name#.
|
||||
It is possible to add icons from fontawesome. These are accessed via the syntax fa:#icon-class-name#.
|
||||
|
||||
```mermaid-example
|
||||
graph TD
|
||||
@@ -875,9 +872,9 @@ graph TD
|
||||
|
||||
## Graph declarations with spaces between vertices and link and without semicolon
|
||||
|
||||
* After release 0.2.16, graph declaration statements do not need to end with a semicolon. (And they can continue to have the ending semicolon—it has now just become optional.) So the below graph declaration is valid along with the old declarations.
|
||||
- After release 0.2.16, graph declaration statements do not need to end with a semicolon. (And they can continue to have the ending semicolon—it has now just become optional.) So the below graph declaration is valid along with the old declarations.
|
||||
|
||||
* A single space is allowed between vertices and the link, however there should not be any space between a vertex and its text, or a link and its text. The old syntax of graph declarations will also work, so this new feature is optional and is introduced to improve readability.
|
||||
- A single space is allowed between vertices and the link, however there should not be any space between a vertex and its text, or a link and its text. The old syntax of graph declarations will also work, so this new feature is optional and is introduced to improve readability.
|
||||
|
||||
Below is an example of the new way to declare graph edges. This is valid alongside any old-style declarations of graph edges.
|
||||
|
||||
@@ -906,6 +903,6 @@ In Javascript config parameters can be set by using `mermaid.flowchartConfig`:
|
||||
|
||||
```javascript
|
||||
mermaid.flowchartConfig = {
|
||||
width: '100%'
|
||||
}
|
||||
width: '100%',
|
||||
};
|
||||
```
|
||||
|
Reference in New Issue
Block a user