Mermaid Flowchart - swkim0128/PARA GitHub Wiki
Flowcharts - Basic Syntax
A node (default)
A node with text
Graph
Flowchart Orientation
Node shapes
A node with round edges
A stadium-shaped node
A node in a subroutine shape
A node in a cylindrical shape
A node in the form of a circle
A node in an asymmetric shape
A node (rhombus)
A hexagon node
Parallelogram
Parallelogram alt
Trapezoid
Trapezoid alt
Double circle
Links between nodes
A link with arrow head
An open link
Text on links
A link with arrow head and text
Dotted link
Dotted link with text
Thick link
Thick link with text
An invisible link
Chaining of links
New arrow types
Multi directional arrows
Minimum length of a link
Special characters that break syntax
Entity codes to escape characters
Subgraphs
flowcharts
Direction in subgraphs
Interaction
Comments
Styling and classes
Styling links
Styling line curves
Styling a node
Css classes
Default class
Basic support for fontawesome
Graph declarations with spaces between vertices and link and without semicolon
Configuration
Renderer
Width
λͺ¨λ νλ‘μ°μ°¨νΈλ κΈ°ννμ λͺ¨μμΈ λ Έλμ νμ΄ν λλ μ μΈ μ£μ§λ‘ ꡬμ±λ©λλ€. Mermaid μ½λλ μ΄λ¬ν λ Έλμ μ£μ§κ° λ§λ€μ΄μ§κ³ μνΈ μμ©νλ λ°©μμ μ μν©λλ€.
λν λ€μν νμ΄ν μ ν, λ€μ€ λ°©ν₯ νμ΄ν λ° μλΈκ·Έλνμμμ λ§ν¬ μ°κ²°λ κ°λ₯ν©λλ€.
μ€μ μ¬ν: Flowchart λ Έλλ‘ "end"λΌλ λ¨μ΄λ₯Ό μ λ ₯νμ§ λ§μμμ€. νλ‘μ°μ°¨νΈκ° λ§κ°μ§μ§ μλλ‘ λͺ¨λ λ¬Έμλ₯Ό λλ¬Έμλ‘ μ λ ₯νμμμ€. μλ₯Ό λ€μ΄ "End" λλ "END"μ λλ€. λλ μ΄ ν΄κ²° λ°©λ²μ μ μ©ν μ μμ΅λλ€.
Code:
---
title: Node
---
flowchart LR
id
μμ μμ νμλλ ν μ€νΈμ idκ° λ€λ₯Ό μλ μμ΅λλ€. μ΄ κ²½μ°, μ¬λ¬ λ² μ€μ νλ©΄ λ§μ§λ§ μ μΈλ ν μ€νΈκ° μ¬μ©λ©λλ€. λν, λμ€μ λ Έλμ μ£μ§λ₯Ό μ μν λ ν μ€νΈλ₯Ό μ μνμ§ μμλ λ©λλ€. λ λλ§ν λ μ΄μ μ μ μλ ν μ€νΈκ° μ¬μ©λ©λλ€.
Code:
---
title: Node with text
---
flowchart LR
id1[This is the text in the box]
μ΄ λ¬Έμ₯μ Flowchartμ λ°©ν₯μ μ μΈν©λλ€.
μ΄λ flowchartκ° μμμ μλλ‘ (TD
λλ TB
) λ°©ν₯μΌλ‘ μ λ ¬λμ΄ μλ€λ κ²μ μ μΈν©λλ€.
Code:
flowchart TD
Start --> Stop
μ΄κ²μ νλ‘μ°μ°¨νΈκ° μΌμͺ½μμ μ€λ₯Έμͺ½(LR
)μΌλ‘ μ λ ¬λμ΄ μλ€λ κ²μ μ μΈν©λλ€.
Code:
flowchart LR
Start --> Stop
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
Code:
flowchart LR
id1(This is the text in the box)
Code:
flowchart LR
id1([This is the text in the box])
Code:
flowchart LR
id1[[This is the text in the box]]
Code:
flowchart LR
id1[(Database)]
Code:
flowchart LR
id1((This is the text in the circle))
Code:
flowchart LR
id1>This is the text in the box]
Currently only the shape above is possible and not its mirror. This might change with future releases.
Code:
flowchart LR
id1{This is the text in the box}
Code:
flowchart LR
id1{{This is the text in the box}}
Render:
Code:
flowchart LR
id1{{This is the text in the box}}
Code:
flowchart TD
id1[/This is the text in the box/]
Code:
flowchart TD
id1[\This is the text in the box\]
Code:
flowchart TD
A[/Christmas\]
Code:
flowchart TD
B[\Go shopping/]
Code:
flowchart TD
id1(((This is the text in the circle)))
λ Έλλ λ§ν¬/μ£μ§λ‘ μ°κ²°λ μ μμ΅λλ€. λ€λ₯Έ μ νμ λ§ν¬λ₯Ό κ°μ§ μ μκ±°λ λ§ν¬μ ν μ€νΈ λ¬Έμμ΄μ 첨λΆν μλ μμ΅λλ€.
Code:
flowchart LR
A-->B
Code:
flowchart LR
A --- B
Code:
flowchart LR
A-- This is the text! ---B
or
Code:
flowchart LR
A---|This is the text|B
Code:
flowchart LR
A-->|text|B
or
Code:
flowchart LR
A-- text -->B
Code:
flowchart LR
A-.->B;
Code:
flowchart LR
A-. text .-> B
Code:
flowchart LR
A ==> B
Code:
flowchart LR
A == text ==> B
μ΄λ λ Έλμ κΈ°λ³Έ μμΉλ₯Ό λ³κ²½νλ €λ κ²½μ°μ μ μ©ν λκ΅¬μΌ μ μμ΅λλ€.
Code:
flowchart LR
A ~~~ B
μλμ κ°μ΄ ν μ€μ μ¬λ¬ λ§ν¬λ₯Ό μ μΈν μ μμ΅λλ€:
Code:
flowchart LR
A -- text --> B -- text2 --> C
μλμ κ°μ΄ κ°μ μ€μ μ¬λ¬ λ Έλ λ§ν¬λ₯Ό μ μΈνλ κ²λ κ°λ₯ν©λλ€:
Code:
flowchart LR
a --> b & c--> d
κ·Έλ° λ€μ μλμ ν μ€μ²λΌ λ§€μ° ννλ ₯μκ² μ’ μμ±μ μ€λͺ ν μ μμ΅λλ€:
Code:
flowchart TB
A & B--> C & D
λ§μ½ κΈ°λ³Έ ꡬ문μ μ¬μ©νμ¬ λμΌν λ€μ΄μ΄κ·Έλ¨μ μ€λͺ νλ©΄ 4 μ€μ΄ μμλ©λλ€. μ£Όμν μ μ λ§ν¬λ€μ΄ νμμμ νλ¦λλ₯Ό λ μ΄λ ΅κ² λ§λ€ μ μμ΅λλ€. μ€μ¨λ΄μ΄ λ¨μ΄ 'lagom'μ΄ λ μ€λ¦ λλ€. μ΄λ λ무 λ§μ§λ μκ³ λ무 μ μ§λ μμμ μλ―Έν©λλ€. μ΄κ²μ ννμ μΈ κ΅¬λ¬Έμλ μ μ©λ©λλ€.
Code:
flowchart TB
A --> C
A --> D
B --> C
B --> D
μλμ κ°μ΄ μλ‘μ΄ μ’ λ₯μ νμ΄νκ° μ§μλ©λλ€:
Code:
flowchart LR
A --o B
B --x C
λ€λ°©ν₯ νμ΄νλ₯Ό μ¬μ©ν μ μμ΅λλ€.
Code:
flowchart LR
A o--o B
B <--> C
C x--x D
νλ¦λμ κ° λ Έλλ μ°κ²°λ λ Έλμ κΈ°λ°νμ¬ λ λλ§λ κ·Έλνμμ μ΅μ’ μ μΌλ‘ μμ§ λλ μν λ 벨μ ν λΉλ©λλ€(νλ¦λ λ°©ν₯μ λ°λΌ λ€λ¦ λλ€). κΈ°λ³Έμ μΌλ‘ λ§ν¬λ μ΄λ€ μμ λν¬λ₯Ό κ±°μ³λ μκ΄μμ§λ§, λ§ν¬ μ μμ μΆκ° λμλ₯Ό μΆκ°νμ¬ λ€λ₯Έ λ§ν¬λ³΄λ€ κΈΈκ² μμ²ν μ μμ΅λλ€.
λ€μ μμ μμ λ Έλ _B_μμ λ Έλ _E_λ‘μ λ§ν¬μ μΆκ°λ‘ λ κ°μ λμκ° μΆκ°λμ΄ μΌλ°μ μΈ λ§ν¬λ³΄λ€ λ κ°μ λν¬λ₯Ό λ κ°κ² λ©λλ€:
Code:
flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End]
μ°Έκ³ : λ λλ§ μμ§μ λ€λ₯Έ μμ²μ μμ©νκΈ° μν΄ μμ²ν μμ μλ³΄λ€ λ§ν¬λ₯Ό λ κΈΈκ² λ§λ€ μ μμ΅λλ€.
λ§ν¬ λΌλ²¨μ΄ λ§ν¬ μ€κ°μ μμ±λ λ, μΆκ° λμλ λ§ν¬ μ€λ₯Έμͺ½μ μΆκ°λμ΄μΌ ν©λλ€. λ€μ μμλ μ΄μ μμμ λμΌν©λλ€:
Code:
flowchart TD
A[Start] --> B{Is it?}
B -- Yes --> C[OK]
C --> D[Rethink]
D --> B
B -- No ----> E[End]
μ μ μ΄λ λκΊΌμ΄ λ§ν¬λ₯Ό μν΄μλ, μΆκ°ν΄μΌ ν λ¬Έμλ λ±νΈ λλ μ μΌλ‘ μμ½λ νμ λμ μμ΅λλ€:
Length | 1 | 2 | 3 |
Normal | --- |
---- |
----- |
Normal with arrow | --> |
---> |
----> |
Thick | === |
==== |
===== |
Thick with arrow | ==> |
===> |
====> |
Dotted | -.- |
-..- |
-...- |
Dotted with arrow | -.-> |
-..-> |
-...-> |
λ¬Έμ κ° λλ λ¬Έμλ₯Ό λ λλ§νκΈ° μν΄ λ°μ΄ν μμ ν μ€νΈλ₯Ό λ£μ μ μμ΅λλ€. μλ μμμ κ°μ΄:
Code:
flowchart LR
id1["This is the (text) in the box"]
μ¬κΈ°μμ μ€λͺ λ ꡬ문μ μ¬μ©νμ¬ λ¬Έμλ₯Ό μ΄μ€μΌμ΄νν μ μμ΅λλ€.
Code:
flowchart LR
A["A double quote:\#quot;"] -->B["A dec char:\#9829;"]
μ£Όμ΄μ§ μ«μλ 10μ§λ²μ΄λ―λ‘ #
λ \#35;
μΌλ‘ μΈμ½λ©λ μ μμ΅λλ€. λν HTML λ¬Έμ μ΄λ¦μ μ¬μ©νλ κ²λ μ§μλ©λλ€.
subgraph title
graph definition
end
An example below:
Code:
flowchart TB
c1-->a2
subgraph one
a1-->a2
end
subgraph two
b1-->b2
end
subgraph three
c1-->c2
end
μλΈκ·Έλνμ λͺ μμ μΈ idλ₯Ό μ€μ ν μλ μμ΅λλ€.
Code:
flowchart TB
c1-->a2
subgraph ide1 [one]
a1-->a2
end
κ·Έλν μ ν flowchartλ₯Ό μ¬μ©νλ©΄ μλ flowchartμμμ κ°μ΄ νμ κ·Έλνλ‘λΆν° μμ§λ₯Ό μ€μ ν μλ μμ΅λλ€.
Code:
flowchart TB
c1-->a2
subgraph one
a1-->a2
end
subgraph two
b1-->b2
end
subgraph three
c1-->c2
end
one --> two
three --> two
two --> c2
κ·Έλν μ νμ΄ flowchartsμΈ κ²½μ°μλ direction λ¬Έμ μ¬μ©νμ¬ μλΈκ·Έλνκ° λ λλ§λ λ°©ν₯μ μ€μ ν μ μμ΅λλ€. λ€μ μμμ κ°μ΅λλ€.
Code:
flowchart LR
subgraph TOP
direction TB
subgraph B1
direction RL
i1 -->f1
end
subgraph B2
direction BT
i2 -->f2
end
end
A --> TOP --> B
B1 --> B2
λ
Έλμ ν΄λ¦ μ΄λ²€νΈλ₯Ό λ°μΈλ©νμ¬ μλ°μ€ν¬λ¦½νΈ μ½λ°± λλ μλ‘μ΄ λΈλΌμ°μ νμμ μ΄λ¦¬λ λ§ν¬λ‘ μ΄μ΄μ§ μ μμ΅λλ€. μ°Έκ³ : securityLevel='strict'
λ₯Ό μ¬μ©ν λλ μ΄ κΈ°λ₯μ΄ λΉνμ±νλκ³ , securityLevel='loose'
λ₯Ό μ¬μ©ν λλ νμ±νλ©λλ€.
click nodeId callback
click nodeId call callback()
- nodeIdλ λ Έλμ idμ λλ€.
- callbackμ κ·Έλνλ₯Ό νμνλ νμ΄μ§μμ μ μλ JavaScript ν¨μμ μ΄λ¦μ λλ€. ν΄λΉ ν¨μλ nodeIdλ₯Ό λ§€κ° λ³μλ‘ νΈμΆλ©λλ€.
Examples of tooltip usage below:
<script>
const callback = function () {
alert('A callback was triggered');
};
</script>
ν΄ν ν
μ€νΈλ κ²Ήλ°μ΄νλ‘ λλ¬μΈμ¬ μμ΅λλ€. ν΄νμ μ€νμΌμ .mermaidTooltip
ν΄λμ€λ‘ μ€μ λ©λλ€.
Code:
flowchart LR
A-->B
B-->C
C-->D
click A callback "Tooltip for a callback"
click B "https://www.github.com" "This is a tooltip for a link"
click A call callback() "Tooltip for a callback"
click B href "https://www.github.com" "This is a tooltip for a link"
μ±κ³΅ - λ²μ 0.5.2λΆν° ν΄ν κΈ°λ₯κ³Ό URL λ§ν¬ κΈ°λ₯μ μ¬μ©ν μ μμ΅λλ€.
?> Docsifyκ° JavaScript μ½λ°± ν¨μλ₯Ό μ²λ¦¬νλ λ°©μμ μ νμΌλ‘ μΈν΄, μ μ½λμ λ체 μλ λ°λͺ¨λ **μ΄ jsfiddle**μμ λ³Ό μ μμ΅λλ€.
λ§ν¬λ κΈ°λ³Έμ μΌλ‘ λμΌν λΈλΌμ°μ ν / μ°½μμ μ΄λ¦½λλ€. ν΄λ¦ μ μμ λ§ν¬ λμμ μΆκ°νμ¬ μ΄λ₯Ό λ³κ²½ν μ μμ΅λλ€ (_self, _blank, _parent λ° _topμ΄ μ§μλ¨) :
Code:
flowchart LR
A-->B
B-->C
C-->D
D-->E
click A "https://www.github.com" _blank
click B "https://www.github.com" "Open this in a new tab" _blank
click C href "https://www.github.com" _blank
click D href "https://www.github.com" "Open this in a new tab" _blank
HTML 컨ν μ€νΈμμ λνν λ§ν¬λ₯Ό μ¬μ©νλ μ 체 μμ - μ΄λ³΄μ ν:
<body>
<pre class="mermaid">
flowchart 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"
</pre>
<script>
const callback = function () {
alert('A callback was triggered');
};
const config = {
startOnLoad: true,
flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'cardinal' },
securityLevel: 'loose',
};
mermaid.initialize(config);
</script>
</body>
νλ¦λ λ΄μμ μ£Όμμ μ
λ ₯ν μ μμ΅λλ€. μ΄ μ£Όμμ ꡬ문 λΆμκΈ°μμ 무μλ©λλ€. μ£Όμμ μ체 μ€μ μμ΄μΌνλ©° %%
(μ΄μ€ νΌμΌνΈ κΈ°νΈ)λ‘ μμν΄μΌν©λλ€. μ£Όμ μμλΆν° λ€μ κ°νκΉμ§μ λͺ¨λ ν
μ€νΈλ μ£ΌμμΌλ‘ μ²λ¦¬λλ©°, νλ¦ κ΅¬λ¬Έμ ν¬ν¨νμ¬ λͺ¨λ ν
μ€νΈκ° μ£ΌμμΌλ‘ μ²λ¦¬λ©λλ€.
Code:
flowchart LR
%% this is a comment A -- text --> B{node}
A -- text --> B -- text2 --> C
λ§ν¬λ₯Ό μ€νμΌλ§ ν μ μμ΅λλ€. μλ₯Ό λ€μ΄, νλ¦μ κ±°κΎΈλ‘ κ°λ λ§ν¬λ₯Ό μ€νμΌλ§νκ³ μΆμ μ μμ΅λλ€. λ§ν¬λ λ Έλμ λ§μ°¬κ°μ§λ‘ idκ° μμΌλ―λ‘, λ§ν¬μ μ μ©λ μ€νμΌμ κ²°μ νκΈ° μν λ€λ₯Έ λ°©λ²μ΄ νμν©λλ€. id λμ κ·Έλνμμ λ§ν¬κ° μ μλ μμ λ²νΈλ₯Ό μ¬μ©νκ±°λ, λͺ¨λ λ§ν¬μ μ μ©νλ €λ©΄ κΈ°λ³Έκ°μ μ¬μ©ν©λλ€. μλ μμ μμλ linkStyle λ¬Έμμ μ μλ μ€νμΌμ΄ κ·Έλνμμ λ€ λ²μ§Έ λ§ν¬μ μν©λλ€:
linkStyle 3 stroke:\#ff3,stroke-width:4px,color:red;
κΈ°λ³Έ λ°©λ²μ΄ μꡬ μ¬νμ μΆ©μ‘±νμ§ λͺ»νλ κ²½μ° νλͺ© κ° λΌμΈμ μ¬μ©λλ 곑μ μ νμ μ€νμΌλ§νλ κ²μ΄ κ°λ₯ν©λλ€. μ¬μ© κ°λ₯ν 곑μ μ€νμΌμ basis
, bumpX
, bumpY
, cardinal
, catmullRom
, linear
, monotoneX
, monotoneY
, natural
, step
, stepAfter
λ° stepBefore
κ° μμ΅λλ€.
μ΄ μμμμ μΌμͺ½μμ μ€λ₯Έμͺ½μΌλ‘ κ·Έλ €μ§λ κ·Έλνλ stepBefore
곑μ μ€νμΌμ μ¬μ©ν©λλ€:
%%{ init: { 'flowchart': { 'curve': 'stepBefore' } } }%%
graph LR
μ¬μ© κ°λ₯ν λͺ¨λ 곑μ μ μ 체 λͺ©λ‘ λ° μ¬μ©μ μ§μ 곑μ μ λν μ€λͺ μ ν¬ν¨ν μμΈν λ΄μ©μ d3-shape νλ‘μ νΈμ Shapes λ¬Έμλ₯Ό μ°Έμ‘°νμμμ€.
λ Έλμ λ λκΊΌμ΄ ν λ리λ λ€λ₯Έ λ°°κ²½μκ³Ό κ°μ ꡬ체μ μΈ μ€νμΌμ μ μ©νλ κ²μ΄ κ°λ₯ν©λλ€.
Code:
flowchart LR
id1(Start)-->id2(Stop)
style id1 fill:\#f9f,stroke:\#333,stroke-width:4px
style id2 fill:\#bbf,stroke:\#f66,stroke-width:2px,color:\#fff,stroke-dasharray: 5 5
Classes
λ§€λ² μ€νμΌμ μ μνλ κ²λ³΄λ€λ μ€νμΌ ν΄λμ€λ₯Ό μ μνκ³ λ€λ₯Έ λͺ¨μ΅μ΄ νμν λ Έλμ μ΄ ν΄λμ€λ₯Ό μ μ©νλ κ²μ΄ λ νΈλ¦¬ν©λλ€.
μλ μμμ κ°μ΄ ν΄λμ€ μ μλ λ€μκ³Ό κ°μ΅λλ€:
classDef className fill:\#f9f,stroke:\#333,stroke-width:4px;
λ Έλμ ν΄λμ€λ₯Ό 첨λΆνλ λ°©λ²μ λ€μκ³Ό κ°μ΅λλ€:
class nodeId1 className;
λ Έλ λͺ©λ‘μ ν΄λμ€λ₯Ό ν λ²μ μΆκ°νλ κ²λ κ°λ₯ν©λλ€:
class nodeId1,nodeId2 className;
ν΄λμ€λ₯Ό μΆκ°νλ λ μ§§μ λ°©λ²μ μλμ κ°μ΄ :::
μ°μ°μλ₯Ό μ¬μ©νμ¬ λ
Έλμ ν΄λμ€ μ΄λ¦μ λΆμ΄λ κ²μ
λλ€:
Code:
flowchart LR
A:::someclass --> B
classDef someclass fill:\#f96
css μ€νμΌμμ 미리 μ μλ ν΄λμ€λ₯Ό κ·Έλν μ μμμ μλ μμμ κ°μ΄ μ μ©ν μλ μμ΅λλ€:
Example style
<style>
.cssClass > rect {
fill: \#ff0000;
stroke: \#ffff00;
stroke-width: 4px;
}
</style>
Example definition
Code:
flowchart LR
A-->B[AAA<span>BBB</span>]
B-->D
class A cssClass
λ§μ½ ν΄λμ€μ μ΄λ¦μ΄ "default"μ΄λ©΄, νΉμ ν΄λμ€ μ μ μμ΄ λͺ¨λ ν΄λμ€μ ν λΉλ©λλ€.
classDef default fill:\#f9f,stroke:\#333,stroke-width:4px;
ν°νΈμ΄μΈμμ μμ΄μ½μ μΆκ°ν μ μμ΅λλ€.
μμ΄μ½μ fa:#μμ΄μ½ ν΄λμ€λͺ # ꡬ문μ ν΅ν΄ μ‘μΈμ€λ©λλ€.
Code:
flowchart TD
B["fab:fa-twitter for peace"]
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner)
B-->E(A fa:fa-camera-retro perhaps?)
Mermaidλ Font Awesome λ²μ 4μ 5μλ§ νΈνλ©λλ€. μ¬λ°λ₯Έ λ²μ μ Font Awesomeλ₯Ό μ¬μ© μ€μΈμ§ νμΈνμΈμ.
- κ·Έλν μ μΈμμ λ¬Έμ₯μ΄ μΈλ―Έμ½λ‘ μμ΄ λλ μλ μμ΅λλ€. 0.2.16 λ²μ μ΄νμλ κ·Έλν λ¬Έμ₯μ μΈλ―Έμ½λ‘ μΌλ‘ λλ΄λ κ²μ΄ μ νμ¬νμ λλ€. λ°λΌμ μλ κ·Έλν μ μΈμ μμ μ κ·Έλν μ μΈκ³Ό ν¨κ» μ ν¨νλ©°, μ΄μ ꡬ문λ κ³μ μ¬μ© κ°λ₯ν©λλ€.
- λ Έλμ μ°κ²° μ¬μ΄μλ 곡백μ νλλ§ νμ©ν©λλ€. κ·Έλ¬λ λ Έλμ ν μ€νΈ, μ°κ²°κ³Ό ν μ€νΈ μ¬μ΄μλ κ³΅λ°±μ΄ μμ΄μΌ ν©λλ€. μ΄μ μ κ·Έλν μ μΈ κ΅¬λ¬Έλ κ³μ μλνλ―λ‘, μ΄ μλ‘μ΄ κΈ°λ₯μ μ νμ¬νμ΄λ©° κ°λ μ±μ ν₯μμν€κΈ° μν΄ λμ λμμ΅λλ€.
μλλ κ·Έλν μ£μ§μ μλ‘μ΄ μ μΈ λ°©μμΌλ‘, μ΄μ κ·Έλν μ£μ§μ μ μΈ λ°©μκ³Ό ν¨κ» μ ν¨ν©λλ€.
Code:
flowchart LR
A[Hard edge] -->|Link text| B(Round edge)
B --> C{Decision}
C -->|One| D[Result one]
C -->|Two| E[Result two]
λ€μ΄μ΄κ·Έλ¨ λ μ΄μμμ λ λλ¬λ‘ μ²λ¦¬λ©λλ€. κΈ°λ³Έ λ λλ¬λ dagreμ λλ€.
Mermaid λ²μ 9.4λΆν°λ elkλΌλ λ체 λ λλ¬λ₯Ό μ¬μ©ν μ μμ΅λλ€. elk λ λλ¬λ λ ν¬κ³ /λλ 볡μ‘ν λ€μ΄μ΄κ·Έλ¨μ μ ν©ν©λλ€.
elk λ λλ¬λ μ€νμ μΈ κΈ°λ₯μ λλ€. elk λ λλ¬λ‘ λ³κ²½νλ €λ©΄ λ€μ μ§μλ¬Έμ μΆκ°νλ©΄ λ©λλ€:
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
μ΄ μ¬μ΄νΈμμλ μ΄ κΈ°λ₯μ μ¬μ©νλ €λ©΄ mermaid λ²μ 9.4+λ₯Ό μ¬μ©νκ³ lazy-loading ꡬμ±μμ μ΄ κΈ°λ₯μ νμ±νν΄μΌν©λλ€.
λ λλ§λ νλ‘μ° μ°¨νΈμ λλΉλ₯Ό μ‘°μ νλ κ²μ΄ κ°λ₯ν©λλ€.
μ΄λ mermaid.flowchartConfigλ₯Ό μ μνκ±°λ, CLIλ₯Ό μ¬μ©νμ¬ JSON νμΌλ‘ ꡬμ±μ μ€μ ν¨μΌλ‘μ¨ μνν μ μμ΅λλ€. CLIμ μ¬μ© λ°©λ²μ mermaidCLI νμ΄μ§μμ μ€λͺ λμ΄ μμ΅λλ€. mermaid.flowchartConfigλ κ΅¬μ± λ§€κ° λ³μλ₯Ό ν¬ν¨νλ JSON λ¬Έμμ΄ λλ ν΄λΉ κ°μ²΄λ‘ μ€μ ν μ μμ΅λλ€.
mermaid.flowchartConfig = {
width: 100%
}