2024-03-23 11:39:02 +05:30
|
|
|
<!doctype html>
|
2022-10-02 13:51:25 -07:00
|
|
|
<html lang="en">
|
2022-09-05 00:48:36 +05:30
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
|
|
<title>Mermaid Quick Test Page</title>
|
|
|
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
|
|
|
<style>
|
|
|
|
div.mermaid {
|
|
|
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
|
|
|
font-family: 'Courier New', Courier, monospace !important;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
2022-03-17 16:18:10 +00:00
|
|
|
|
2022-09-05 00:48:36 +05:30
|
|
|
<body>
|
2022-10-02 13:51:25 -07:00
|
|
|
<h1>Sequence diagram demos</h1>
|
2022-09-05 00:48:36 +05:30
|
|
|
<pre class="mermaid">
|
2023-07-08 11:39:37 +09:00
|
|
|
sequenceDiagram
|
|
|
|
accTitle: test the accTitle
|
|
|
|
accDescr: Test a description
|
2022-09-26 18:16:36 -07:00
|
|
|
|
|
|
|
participant Alice
|
|
|
|
participant Bob
|
|
|
|
participant John as John<br />Second Line
|
2023-12-22 11:25:26 -03:00
|
|
|
link Alice: Dashboard @ https://dashboard.contoso.com/alice
|
|
|
|
link Alice: Wiki @ https://wiki.contoso.com/alice
|
|
|
|
link John: Dashboard @ https://dashboard.contoso.com/john
|
|
|
|
link John: Wiki @ https://wiki.contoso.com/john
|
2022-09-26 18:16:36 -07:00
|
|
|
autonumber 10 10
|
|
|
|
rect rgb(200, 220, 100)
|
|
|
|
rect rgb(200, 255, 200)
|
|
|
|
|
2023-07-08 11:39:37 +09:00
|
|
|
Alice ->> Bob: Hello Bob, how are you?
|
|
|
|
Bob-->>John: How about you John?
|
|
|
|
end
|
2022-09-26 18:16:36 -07:00
|
|
|
|
2023-07-08 11:39:37 +09:00
|
|
|
Bob--x Alice: I am good thanks!
|
|
|
|
Bob-x John: I am good thanks!
|
|
|
|
Note right of John: John thinks a long<br />long time, so long<br />that the text does<br />not fit on a row.
|
2022-09-26 18:16:36 -07:00
|
|
|
|
2023-07-08 11:39:37 +09:00
|
|
|
Bob-->Alice: Checking with John...
|
|
|
|
Note over John:wrap: John looks like he's still thinking, so Bob prods him a bit.
|
|
|
|
Bob-x John: Hey John - we're still waiting to know<br />how you're doing
|
|
|
|
Note over John:nowrap: John's trying hard not to break his train of thought.
|
|
|
|
Bob-x John:wrap: John! Are you still debating about how you're doing? How long does it take??
|
|
|
|
Note over John: After a few more moments, John<br />finally snaps out of it.
|
|
|
|
end
|
2022-09-26 18:16:36 -07:00
|
|
|
|
2023-07-08 11:39:37 +09:00
|
|
|
autonumber off
|
|
|
|
alt either this
|
|
|
|
Alice->>+John: Yes
|
|
|
|
John-->>-Alice: OK
|
|
|
|
else or this
|
|
|
|
autonumber
|
|
|
|
Alice->>John: No
|
|
|
|
else or this will happen
|
|
|
|
Alice->John: Maybe
|
|
|
|
end
|
|
|
|
autonumber 200
|
|
|
|
par this happens in parallel
|
|
|
|
Alice -->> Bob: Parallel message 1
|
|
|
|
and
|
|
|
|
Alice -->> John: Parallel message 2
|
|
|
|
end
|
|
|
|
</pre>
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
2023-12-22 11:25:26 -03:00
|
|
|
---
|
|
|
|
title: With forced menus
|
|
|
|
config:
|
|
|
|
sequence:
|
|
|
|
forceMenus: true
|
|
|
|
---
|
|
|
|
sequenceDiagram
|
|
|
|
participant Alice
|
|
|
|
participant John
|
|
|
|
link Alice: Dashboard @ https://dashboard.contoso.com/alice
|
|
|
|
link Alice: Wiki @ https://wiki.contoso.com/alice
|
|
|
|
link John: Dashboard @ https://dashboard.contoso.com/john
|
|
|
|
link John: Wiki @ https://wiki.contoso.com/john
|
|
|
|
Alice->>John: Hello John, how are you?
|
|
|
|
John-->>Alice: Great!
|
|
|
|
Alice-)John: See you later!
|
|
|
|
</pre
|
|
|
|
>
|
|
|
|
<hr />
|
|
|
|
<pre class="mermaid">
|
2022-09-26 18:16:36 -07:00
|
|
|
sequenceDiagram
|
|
|
|
accTitle: Sequence diagram title is here
|
|
|
|
accDescr: Hello friends
|
|
|
|
|
|
|
|
participant Alice
|
|
|
|
participant Bob
|
|
|
|
participant John as John<br />Second Line
|
|
|
|
rect rgb(200, 220, 100)
|
|
|
|
rect rgb(200, 255, 200)
|
|
|
|
Alice ->> Bob: Hello Bob, how are you?
|
|
|
|
Bob-->>John: How about you John?
|
|
|
|
end
|
|
|
|
Bob--x Alice: I am good thanks!
|
|
|
|
Bob-x John: I am good thanks!
|
|
|
|
Note right of John: John thinks a long<br />long time, so long<br />that the text does<br />not fit on a row.
|
|
|
|
Bob-->Alice: Checking with John...
|
|
|
|
Note over John:wrap: John looks like he's still thinking, so Bob prods him a bit.
|
|
|
|
Bob-x John: Hey John - we're still waiting to know<br />how you're doing
|
|
|
|
Note over John:nowrap: John's trying hard not to break his train of thought.
|
|
|
|
Bob-x John:wrap: John! Are you still debating about how you're doing? How long does it take??
|
|
|
|
Note over John: After a few more moments, John<br />finally snaps out of it.
|
|
|
|
end
|
|
|
|
alt either this
|
|
|
|
Alice->>John: Yes
|
|
|
|
else or this
|
|
|
|
Alice->>John: No
|
|
|
|
else or this will happen
|
|
|
|
Alice->John: Maybe
|
|
|
|
end
|
|
|
|
par this happens in parallel
|
|
|
|
Alice -->> Bob: Parallel message 1
|
|
|
|
and
|
|
|
|
Alice -->> John: Parallel message 2
|
|
|
|
end
|
|
|
|
</pre>
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
participant 1 as multiline<br>using #lt;br#gt;
|
|
|
|
participant 2 as multiline<br />using #lt;br/#gt;
|
|
|
|
participant 3 as multiline<br />using #lt;br /#gt;
|
|
|
|
participant 4 as multiline<br />using #lt;br /#gt;
|
|
|
|
1->>2: multiline<br>using #lt;br#gt;
|
|
|
|
note right of 2: multiline<br>using #lt;br#gt;
|
|
|
|
2->>3: multiline<br />using #lt;br/#gt;
|
|
|
|
note right of 3: multiline<br />using #lt;br/#gt;
|
|
|
|
3->>4: multiline<br />using #lt;br /#gt;
|
|
|
|
note right of 4: multiline<br />using #lt;br /#gt;
|
|
|
|
4->>1: multiline<br />using #lt;br /#gt;
|
|
|
|
note right of 1: multiline<br />using #lt;br /#gt;
|
|
|
|
</pre>
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
autonumber
|
|
|
|
Alice->>John: Hello John,<br>how are you?
|
|
|
|
autonumber 50 10
|
|
|
|
Alice->>John: John,<br />can you hear me?
|
|
|
|
John-->>Alice: Hi Alice,<br />I can hear you!
|
|
|
|
autonumber off
|
|
|
|
John-->>Alice: I feel great!
|
|
|
|
</pre>
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
2022-09-26 18:16:36 -07:00
|
|
|
|
2023-01-05 15:40:40 +01:00
|
|
|
<pre class="mermaid">
|
2023-05-06 17:19:31 +09:00
|
|
|
sequenceDiagram
|
|
|
|
box lightgreen Alice & John
|
|
|
|
participant A
|
|
|
|
participant J
|
|
|
|
end
|
|
|
|
box Another Group very very long description not wrapped
|
|
|
|
participant B
|
|
|
|
end
|
|
|
|
A->>J: Hello John, how are you?
|
|
|
|
J->>A: Great!
|
|
|
|
A->>B: Hello Bob, how are you ?
|
|
|
|
</pre
|
2023-01-05 15:40:40 +01:00
|
|
|
>
|
|
|
|
<hr />
|
|
|
|
|
2023-05-03 22:15:59 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
participant Alice
|
|
|
|
participant Bob
|
|
|
|
participant John
|
|
|
|
par_over Section title
|
|
|
|
Alice ->> Bob: Message 1<br>Second line
|
|
|
|
Bob ->> John: Message 2
|
|
|
|
end
|
|
|
|
par_over Two line<br>section title
|
|
|
|
Note over Alice: Alice note
|
|
|
|
Note over Bob: Bob note<br>Second line
|
|
|
|
Note over John: John note
|
|
|
|
end
|
|
|
|
par_over Mixed section
|
|
|
|
Alice ->> Bob: Message 1
|
|
|
|
Note left of Bob: Alice/Bob Note
|
|
|
|
end
|
|
|
|
</pre>
|
2024-02-14 12:12:49 +05:30
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
actor Alice
|
|
|
|
actor John
|
|
|
|
Alice-xJohn: Hello John, how are you?
|
|
|
|
John--xAlice: Great!
|
|
|
|
</pre>
|
2023-05-03 22:15:59 -07:00
|
|
|
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
|
|
|
|
2022-09-26 18:16:36 -07:00
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
2023-05-06 17:19:31 +09:00
|
|
|
participant 1 as $$\frac{\lim_{x\rightarrow0}{\frac{1}{x}}}{\frac{-b\pm\sqrt{b^2-4ac}}{2a}}$$
|
|
|
|
participant 2 as $$\beta$$
|
|
|
|
participant 3 as $$\delta$$
|
|
|
|
participant 4 as $$\frac{\frac{\lim_{x\rightarrow0}{\frac{1}{x}}}{\frac{-b\pm\sqrt{b^2-4ac}}{2a}}}{\frac{\text{d}}{\text{d}x}{x^2}}$$
|
|
|
|
1->>2: $$\sqrt{2}$$
|
|
|
|
note right of 2: $$\frac{1+\frac{1+\frac{1+\frac{1}{2}}{2}}{2}}{2}+\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$
|
|
|
|
2->>3: $$\frac{\lim_{x\rightarrow0}{\frac{1}{x}}}{\frac{-b\pm\sqrt{b^2-4ac}}{2a}}$$
|
|
|
|
note right of 3: $$\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$
|
|
|
|
3->>4: $$\lim_{x\rightarrow0}{\frac{1}{x}}$$;
|
|
|
|
note right of 4: multiline
|
|
|
|
4->>1: multiline<br />using #lt;br /#gt;
|
|
|
|
note right of 1: multiline<br />$$\frac{1}{2}$$<br />3rd line
|
2022-09-26 18:16:36 -07:00
|
|
|
</pre>
|
2022-10-02 13:51:25 -07:00
|
|
|
<hr />
|
2023-01-05 15:40:40 +01:00
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
2023-05-06 17:19:31 +09:00
|
|
|
autonumber
|
|
|
|
participant 1 as $$\alpha$$lex
|
|
|
|
participant 2 as $$\beta$$ob
|
|
|
|
participant 3 as $$\theta$$iffany
|
|
|
|
1->>2: Hello John, does $$\frac{1}{2}+1=2$$?
|
|
|
|
loop $$\frac{1}{2}+1=2$$
|
|
|
|
2->>2: $$\frac{1}{2}+1=\frac{3}{2}$$
|
2023-01-05 15:40:40 +01:00
|
|
|
end
|
2023-05-06 17:19:31 +09:00
|
|
|
Note right of 2: $$x = \begin{cases} 1 &\text{if } \frac{1}{2}+1=2 \\ 0 &\text{if } \frac{1}{2}+1\ne2 \end{cases}$$
|
|
|
|
2-->>1: $$\frac{1}{2}+1\ne2\implies 1$$
|
|
|
|
2->>3: $$\frac{\text{d}}{\text{d}x}{3x^2+2x+1}$$
|
|
|
|
3-->>2: $$6x+2$$
|
|
|
|
</pre>
|
2023-05-31 17:39:34 +09:00
|
|
|
|
2023-12-07 00:01:01 +05:30
|
|
|
<hr />
|
|
|
|
|
2023-11-06 18:47:38 +05:30
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
actor Alice
|
|
|
|
actor John
|
|
|
|
Alice-xJohn: Hello John, how are you?
|
|
|
|
John--xAlice: Great!
|
|
|
|
</pre>
|
2024-06-21 14:16:21 +00:00
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
<pre class="mermaid">
|
|
|
|
sequenceDiagram
|
|
|
|
participant Alice
|
|
|
|
participant Bob
|
|
|
|
Alice<<->>Bob: Hello!
|
|
|
|
Alice<<->>Bob: Wow, we said that at the same time!
|
|
|
|
Bob<<-->>Alice: Bidirectional Arrows are so cool
|
|
|
|
</pre>
|
2023-02-19 14:03:11 +05:30
|
|
|
<script type="module">
|
|
|
|
import mermaid from './mermaid.esm.mjs';
|
2022-09-05 00:48:36 +05:30
|
|
|
mermaid.initialize({
|
2022-09-26 18:16:36 -07:00
|
|
|
theme: 'base',
|
2022-09-05 00:48:36 +05:30
|
|
|
// themeCSS: '.node rect { fill: red; }',
|
|
|
|
logLevel: 3,
|
|
|
|
securityLevel: 'loose',
|
|
|
|
flowchart: { curve: 'basis' },
|
|
|
|
gantt: { axisFormat: '%m/%d/%Y' },
|
|
|
|
sequence: { actorMargin: 50 },
|
2023-11-06 19:55:53 +05:30
|
|
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
2022-09-05 00:48:36 +05:30
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
2022-04-01 19:06:45 +02:00
|
|
|
</html>
|