Clarification in the docs regarding directions in the subgraps for flowcharts.

This commit is contained in:
Knut Sveidqvist 2022-09-28 12:32:58 +02:00
parent 503cbedc96
commit fe8df78322
3 changed files with 25 additions and 17 deletions

View File

@ -38,13 +38,17 @@
</style>
</head>
<body>
<pre class="mermaid2" style="width: 50%">
flowchart LR
a ---
</pre>
<pre class="mermaid" style="width: 50%">
flowchart LR
a2 ---
subgraph one
direction LR
A[myClass1] --> B[default]
subgraph two
direction BT
C[myClass2] --> D[default]
end
end
</pre>
<pre class="mermaid2" style="width: 50%">
flowchart LR
@ -79,7 +83,7 @@ flowchart TD
end
end
</pre>
<pre class="mermaid" style="width: 50%">
<pre class="mermaid2" style="width: 50%">
flowchart TD
release-branch[Create Release Branch]:::relClass
@ -131,7 +135,7 @@ flowchart TD
class A someclass;
class C someclass;
</pre>
<pre class="mermaid" style="width: 50%">
<pre class="mermaid2" style="width: 50%">
sequenceDiagram
title: My Sequence Diagram Title
accTitle: My Acc Sequence Diagram
@ -141,14 +145,14 @@ flowchart TD
John-->>Alice: Great!
Alice-)John: See you later!
</pre>
<pre class="mermaid" style="width: 50%">
<pre class="mermaid2" style="width: 50%">
graph TD
A -->|000| B
B -->|111| C
linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
journey
accTitle: My User Journey Diagram
accDescr: My User Journey Diagram Description
@ -162,10 +166,10 @@ graph TD
Go downstairs: 5: Me
Sit down: 5: Me
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
info
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
requirementDiagram
accTitle: My req Diagram
accDescr: My req Diagram Description
@ -206,7 +210,7 @@ requirementDiagram
test_req - contains -> test_req3
test_req <- copies - test_entity2
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
@ -238,7 +242,7 @@ gantt
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
stateDiagram
state Active {
Idle
@ -266,7 +270,7 @@ stateDiagram
end
B ->> A: Return
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
classDiagram
accTitle: My class diagram
accDescr: My class diagram Description
@ -291,7 +295,7 @@ class Class10 {
A->>Bob: Hola
Bob-->A: Pasten !
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
gitGraph
commit id: "ZERO"
branch develop
@ -320,7 +324,7 @@ flowchart TD
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
classDiagram
Animal "1" <|-- Duck
Animal <|-- Fish
@ -343,7 +347,7 @@ flowchart TD
+run()
}
</pre>
<pre class="mermaid" style="width: 100%">
<pre class="mermaid2" style="width: 100%">
erDiagram
CAR ||--o{ NAMED-DRIVER : allows
CAR {

View File

@ -679,6 +679,8 @@ flowchart LR
B1 --> B2
```
**A clarification is in order here.** The direction statement affects the layout of a subgraph but only as long as it does not have any links leading in or out of it. The reason for this is that if you have links in or out then the graph of nodes is not longer the set of nodes in the subgraph but actually the set of nodes of the parent including the ones in the subgraph. One can see it as that the direction of the container gets injected in the subgraph with a link.
## Interaction
It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. **Note**: This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`.

View File

@ -424,6 +424,8 @@ flowchart LR
B1 --> B2
```
**A clarification is in order here.** The direction statement affects the layout of a subgraph but only as long as it does not have any links leading in or out of it. The reason for this is that if you have links in or out then the graph of nodes is not longer the set of nodes in the subgraph but actually the set of nodes of the parent including the ones in the subgraph. One can see it as that the direction of the container gets injected in the subgraph with a link.
## Interaction
It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. **Note**: This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`.