Skip to content

Commit

Permalink
Merge branch 'update-requirement-diagram' of github.com:yari-dewalt/m…
Browse files Browse the repository at this point in the history
…ermaid into update-requirement-diagram
  • Loading branch information
yari-dewalt committed Jan 24, 2025
2 parents 42dfa20 + cc2373e commit 23bc25e
Show file tree
Hide file tree
Showing 46 changed files with 2,055 additions and 1,745 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-ads-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

Fixes for consistent edge id creation & handling edge cases for animate edge feature
5 changes: 5 additions & 0 deletions .changeset/chatty-elephants-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

Fix for issue #6195 - allowing @ signs inside node labels
5 changes: 5 additions & 0 deletions .changeset/chilly-years-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: `mermaidAPI.getDiagramFromText()` now returns a new different db for each class diagram
5 changes: 5 additions & 0 deletions .changeset/dull-tips-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: revert state db to resolve getData returning empty nodes and edges
5 changes: 5 additions & 0 deletions .changeset/new-kiwis-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: `mermaidAPI.getDiagramFromText()` now returns a new different db for each flowchart
5 changes: 5 additions & 0 deletions .changeset/stupid-dots-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: Gantt, Sankey and User Journey diagram are now able to pick font-family from mermaid config.
5 changes: 5 additions & 0 deletions .changeset/witty-crews-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

`mermaidAPI.getDiagramFromText()` now returns a new different db for each state diagram
26 changes: 18 additions & 8 deletions cypress/platform/knsv2.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
font-family: monospace;
font-size: 72px;
}

pre {
width: 100%;
}

/* tspan {
font-size: 6px !important;
} */
Expand All @@ -103,16 +105,20 @@
</head>

<body>
<pre id="diagram4" class="mermaid2">
<pre id="diagram4" class="mermaid">
flowchart LR
A --> B
AB["apa@apa@"] --> B(("`apa@apa`"))
</pre>
<pre id="diagram4" class="mermaid">
flowchart
D(("for D"))
</pre>
<pre id="diagram4" class="mermaid">
flowchart LR
A e1@==> B
e1@{ animate: true}
</pre>
<pre id="diagram4" class="mermaid2">
<pre id="diagram4" class="mermaid">
flowchart LR
A e1@--> B
classDef animate stroke-width:2,stroke-dasharray:10\,8,stroke-dashoffset:-180,animation: edge-animation-frame 6s linear infinite, stroke-linecap: round
Expand All @@ -126,7 +132,7 @@ <h2>infinite</h2>
class e1 animate
</pre>
<h2>Mermaid - edge-animation-slow</h2>
<pre id="diagram4" class="mermaid">
<pre id="diagram4" class="mermaid2">
flowchart LR
A e1@--> B
e1@{ animation: fast}
Expand Down Expand Up @@ -428,7 +434,10 @@ <h2>Mermaid - edge-animation-fast</h2>
window.callback = function () {
alert('A callback was triggered');
};
mermaid.initialize({
function callback() {
alert('It worked');
}
await mermaid.initialize({
// theme: 'base',
// theme: 'default',
// theme: 'forest',
Expand All @@ -440,9 +449,11 @@ <h2>Mermaid - edge-animation-fast</h2>
// layout: 'fixed',
// htmlLabels: false,
flowchart: { titleTopMargin: 10 },

// fontFamily: 'Caveat',
// fontFamily: 'Kalam',
// fontFamily: 'courier',
fontFamily: 'arial',
sequence: {
actorFontFamily: 'courier',
noteFontFamily: 'courier',
Expand All @@ -454,10 +465,9 @@ <h2>Mermaid - edge-animation-fast</h2>
fontSize: 12,
logLevel: 0,
securityLevel: 'loose',
callback,
});
function callback() {
alert('It worked');
}

mermaid.parseError = function (err, hash) {
console.error('In parse error:');
console.error(err);
Expand Down
63 changes: 15 additions & 48 deletions cypress/platform/saurabh.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,56 +62,23 @@

<body style="display: flex; gap: 2rem; flex-direction: row">
<pre id="diagram4" class="mermaid">
flowchart LR
A@{ icon: "fa:window-minimize", form: circle }
E@{ icon: "fa:window-minimize", form: circle }
B@{ icon: "fa:bell", form: circle }
B2@{ icon: "fa:bell", form: circle }
C@{ icon: "fa:address-book", form: square }
D@{ icon: "fa:star-half", form: square }
A --> E
B --> B2

flowchart
A --> A
subgraph B
B1 --> B1
end
subgraph C
subgraph C1
C2 --> C2
subgraph D
D1 --> D1
end
D --> D
end
C1 --> C1
end

</pre>
<pre id="diagram4" class="mermaid2">
flowchart TB
A --test2--> B2@{ icon: "fa:bell", form: "rounded", label: "B2 aiduaid uyawduad uaduabd uyduadb", pos: "b" }
B2 --test--> C
D --> B2 --> E
style B2 fill:#f9f,stroke:#333,stroke-width:4px
</pre
>
<pre id="diagram43" class="mermaid2">
flowchart BT
A --test2--> B2@{ icon: "fa:bell", form: "square", label: "B2", pos: "t", h: 40, w: 30 }
B2 --test--> C
D --> B2 --> E
</pre
>
<pre id="diagram4" class="mermaid2">
flowchart BT
A --test2--> B2@{ icon: "fa:bell", label: "B2 awiugdawu uydgayuiwd wuydguy", pos: "b", h: 40, w: 30 }
B2 --test--> C
</pre
>
<pre id="diagram43" class="mermaid2">
flowchart BT
A --test2--> B2@{ icon: "fa:bell", label: "B2 dawuygd ayuwgd uy", pos: "t", h: 40, w: 30 }
B2 --test--> C
</pre
>
<pre id="diagram6" class="mermaid2">
flowchart TB
A --> B2@{ icon: "fa:bell", form: "circle", label: "test augfuyfavf ydvaubfuac", pos: "t", w: 200, h: 100 } --> C
</pre
>
<pre id="diagram6" class="mermaid2">
flowchart TB
A --> B2@{ icon: "fa:bell", form: "circle", label: "test augfuyfavf ydvaubfuac", pos: "b", w: 200, h: 100 } --> C
D --> B2 --> E
</pre
>
<script type="module">
import mermaid from './mermaid.esm.mjs';
import layouts from './mermaid-layout-elk.esm.mjs';
Expand Down
6 changes: 3 additions & 3 deletions docs/config/setup/interfaces/mermaid.LayoutData.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#### Defined in

[packages/mermaid/src/rendering-util/types.ts:147](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L147)
[packages/mermaid/src/rendering-util/types.ts:148](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L148)

---

Expand All @@ -30,7 +30,7 @@

#### Defined in

[packages/mermaid/src/rendering-util/types.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L146)
[packages/mermaid/src/rendering-util/types.ts:147](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L147)

---

Expand All @@ -40,4 +40,4 @@

#### Defined in

[packages/mermaid/src/rendering-util/types.ts:145](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L145)
[packages/mermaid/src/rendering-util/types.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L146)
Loading

0 comments on commit 23bc25e

Please sign in to comment.