diff --git a/.changeset/beige-peas-shave.md b/.changeset/beige-peas-shave.md
deleted file mode 100644
index c405f3dcc..000000000
--- a/.changeset/beige-peas-shave.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@mermaid-js/mermaid-zenuml': patch
----
-
-Fixed a critical bug that the ZenUML diagram is not rendered.
diff --git a/.changeset/large-mirrors-cheer.md b/.changeset/large-mirrors-cheer.md
deleted file mode 100644
index 4e3903039..000000000
--- a/.changeset/large-mirrors-cheer.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': patch
----
-
-fix: Update casing of ID in requirement diagram
diff --git a/.changeset/lemon-masks-unite.md b/.changeset/lemon-masks-unite.md
deleted file mode 100644
index 306ff1cce..000000000
--- a/.changeset/lemon-masks-unite.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': minor
----
-
-feat: Added support for per link curve styling in flowchart diagram using edge ids
diff --git a/.changeset/light-flowers-judge.md b/.changeset/light-flowers-judge.md
deleted file mode 100644
index 6378a9b0a..000000000
--- a/.changeset/light-flowers-judge.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': patch
----
-
-fix: Make flowchart elk detector regex match less greedy
diff --git a/.changeset/lovely-queens-own.md b/.changeset/lovely-queens-own.md
deleted file mode 100644
index edc8dda2d..000000000
--- a/.changeset/lovely-queens-own.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-'mermaid': patch
----
-
-fix(block): overflowing blocks no longer affect later lines
-
-This may change the layout of block diagrams that have overflowing lines
-(i.e. block diagrams that use up more columns that the `columns` specifier).
diff --git a/.changeset/ninety-roses-turn.md b/.changeset/ninety-roses-turn.md
deleted file mode 100644
index a69a6e7a0..000000000
--- a/.changeset/ninety-roses-turn.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'mermaid': patch
----
-
-fix: log warning for blocks exceeding column width
-
-This update adds a validation check that logs a warning message when a block's width exceeds the defined column layout.
diff --git a/.changeset/silver-eyes-build.md b/.changeset/silver-eyes-build.md
deleted file mode 100644
index 76f0a0125..000000000
--- a/.changeset/silver-eyes-build.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': patch
----
-
-chore: migrate to class-based ArchitectureDB implementation
diff --git a/.changeset/smart-humans-cover.md b/.changeset/smart-humans-cover.md
deleted file mode 100644
index 4408e0a9c..000000000
--- a/.changeset/smart-humans-cover.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': patch
----
-
-fix: Update flowchart direction TD's behavior to be the same as TB
diff --git a/.changeset/vast-buses-see.md b/.changeset/vast-buses-see.md
deleted file mode 100644
index fc2a0e6c6..000000000
--- a/.changeset/vast-buses-see.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'mermaid': patch
----
-
-chore: Update packet diagram to use new class-based database structure
diff --git a/.cspell/contributors.txt b/.cspell/contributors.txt
index 80f4df22a..a95f8654e 100644
--- a/.cspell/contributors.txt
+++ b/.cspell/contributors.txt
@@ -2,6 +2,7 @@
Ashish Jain
cpettitt
Dong Cai
+fourcube
knsv
Knut Sveidqvist
Nikolay Rozhkov
diff --git a/.github/lychee.toml b/.github/lychee.toml
index fbe7a71a2..06b3aa707 100644
--- a/.github/lychee.toml
+++ b/.github/lychee.toml
@@ -59,6 +59,7 @@ exclude = [
"https://huehive.co",
"https://foswiki.org",
"https://www.gnu.org",
+"https://redmine.org",
"https://mermaid-preview.com"
]
diff --git a/.github/workflows/e2e-timings.yml b/.github/workflows/e2e-timings.yml
index ef009fa2b..2bbfa8412 100644
--- a/.github/workflows/e2e-timings.yml
+++ b/.github/workflows/e2e-timings.yml
@@ -58,7 +58,7 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT
- name: Commit and create pull request
- uses: peter-evans/create-pull-request@07cbaebb4bfc9c5d7db426ea5a5f585df29dd0a0
+ uses: peter-evans/create-pull-request@cb4d3bfce175d44325c6b7697f81e0afe8a79bdf
with:
add-paths: |
cypress/timings.json
diff --git a/cypress/helpers/util.ts b/cypress/helpers/util.ts
index 81b7036af..ab4bbef64 100644
--- a/cypress/helpers/util.ts
+++ b/cypress/helpers/util.ts
@@ -14,7 +14,7 @@ interface CodeObject {
mermaid: CypressMermaidConfig;
}
-const utf8ToB64 = (str: string): string => {
+export const utf8ToB64 = (str: string): string => {
return Buffer.from(decodeURIComponent(encodeURIComponent(str))).toString('base64');
};
@@ -22,7 +22,7 @@ const batchId: string =
'mermaid-batch-' +
(Cypress.env('useAppli')
? Date.now().toString()
- : Cypress.env('CYPRESS_COMMIT') || Date.now().toString());
+ : (Cypress.env('CYPRESS_COMMIT') ?? Date.now().toString()));
export const mermaidUrl = (
graphStr: string | string[],
@@ -61,9 +61,7 @@ export const imgSnapshotTest = (
sequence: {
...(_options.sequence ?? {}),
actorFontFamily: 'courier',
- noteFontFamily: _options.sequence?.noteFontFamily
- ? _options.sequence.noteFontFamily
- : 'courier',
+ noteFontFamily: _options.sequence?.noteFontFamily ?? 'courier',
messageFontFamily: 'courier',
},
};
diff --git a/cypress/integration/other/xss.spec.js b/cypress/integration/other/xss.spec.js
index 1e51d2f23..35a493850 100644
--- a/cypress/integration/other/xss.spec.js
+++ b/cypress/integration/other/xss.spec.js
@@ -1,4 +1,4 @@
-import { mermaidUrl } from '../../helpers/util.ts';
+import { imgSnapshotTest, mermaidUrl, utf8ToB64 } from '../../helpers/util.ts';
describe('XSS', () => {
it('should handle xss in tags', () => {
const str =
@@ -141,4 +141,37 @@ describe('XSS', () => {
cy.wait(1000);
cy.get('#the-malware').should('not.exist');
});
+
+ it('should sanitize icon labels in architecture diagrams', () => {
+ const str = JSON.stringify({
+ code: `architecture-beta
+ group api(cloud)[API]
+ service db "" [Database] in api`,
+ });
+ imgSnapshotTest(utf8ToB64(str), {}, true);
+ cy.wait(1000);
+ cy.get('#the-malware').should('not.exist');
+ });
+
+ it('should sanitize katex blocks', () => {
+ const str = JSON.stringify({
+ code: `sequenceDiagram
+ participant A as Alice
$$\\text{Alice}$$
+ A->>John: Hello John, how are you?`,
+ });
+ imgSnapshotTest(utf8ToB64(str), {}, true);
+ cy.wait(1000);
+ cy.get('#the-malware').should('not.exist');
+ });
+
+ it('should sanitize labels', () => {
+ const str = JSON.stringify({
+ code: `erDiagram
+ "
" ||--|| ENTITY2 : "
"
+ `,
+ });
+ imgSnapshotTest(utf8ToB64(str), {}, true);
+ cy.wait(1000);
+ cy.get('#the-malware').should('not.exist');
+ });
});
diff --git a/cypress/integration/rendering/block.spec.js b/cypress/integration/rendering/block.spec.js
index f01d59375..27e23cd91 100644
--- a/cypress/integration/rendering/block.spec.js
+++ b/cypress/integration/rendering/block.spec.js
@@ -16,7 +16,7 @@ describe('Block diagram', () => {
it('BL2: should handle columns statement in sub-blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
id1["Hello"]
block
columns 3
@@ -32,7 +32,7 @@ describe('Block diagram', () => {
it('BL3: should align block widths and handle columns statement in sub-blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
block
columns 1
id1
@@ -48,7 +48,7 @@ describe('Block diagram', () => {
it('BL4: should align block widths and handle columns statements in deeper sub-blocks then 1 level', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 1
block
columns 1
@@ -68,7 +68,7 @@ describe('Block diagram', () => {
it('BL5: should align block widths and handle columns statements in deeper sub-blocks then 1 level (alt)', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 1
block
id1
@@ -87,7 +87,7 @@ describe('Block diagram', () => {
it('BL6: should handle block arrows and spece statements', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
space:3
ida idb idc
@@ -106,7 +106,7 @@ describe('Block diagram', () => {
it('BL7: should handle different types of edges', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
A space:5
A --o B
@@ -119,7 +119,7 @@ describe('Block diagram', () => {
it('BL8: should handle sub-blocks without columns statements', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 2
C A B
block
@@ -133,7 +133,7 @@ describe('Block diagram', () => {
it('BL9: should handle edges from blocks in sub blocks to other blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
B space
block
@@ -147,7 +147,7 @@ describe('Block diagram', () => {
it('BL10: should handle edges from composite blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
B space
block BL
@@ -161,7 +161,7 @@ describe('Block diagram', () => {
it('BL11: should handle edges to composite blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
B space
block BL
@@ -175,7 +175,7 @@ describe('Block diagram', () => {
it('BL12: edges should handle labels', () => {
imgSnapshotTest(
- `block-beta
+ `block
A
space
A -- "apa" --> E
@@ -186,7 +186,7 @@ describe('Block diagram', () => {
it('BL13: should handle block arrows in different directions', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
space blockArrowId1<["down"]>(down) space
blockArrowId2<["right"]>(right) blockArrowId3<["Sync"]>(x, y) blockArrowId4<["left"]>(left)
@@ -199,7 +199,7 @@ describe('Block diagram', () => {
it('BL14: should style statements and class statements', () => {
imgSnapshotTest(
- `block-beta
+ `block
A
B
classDef blue fill:#66f,stroke:#333,stroke-width:2px;
@@ -212,7 +212,7 @@ describe('Block diagram', () => {
it('BL15: width alignment - D and E should share available space', () => {
imgSnapshotTest(
- `block-beta
+ `block
block
D
E
@@ -225,7 +225,7 @@ describe('Block diagram', () => {
it('BL16: width alignment - C should be as wide as the composite block', () => {
imgSnapshotTest(
- `block-beta
+ `block
block
A("This is the text")
B
@@ -238,7 +238,7 @@ describe('Block diagram', () => {
it('BL17: width alignment - blocks should be equal in width', () => {
imgSnapshotTest(
- `block-beta
+ `block
A("This is the text")
B
C
@@ -249,7 +249,7 @@ describe('Block diagram', () => {
it('BL18: block types 1 - square, rounded and circle', () => {
imgSnapshotTest(
- `block-beta
+ `block
A["square"]
B("rounded")
C(("circle"))
@@ -260,7 +260,7 @@ describe('Block diagram', () => {
it('BL19: block types 2 - odd, diamond and hexagon', () => {
imgSnapshotTest(
- `block-beta
+ `block
A>"rect_left_inv_arrow"]
B{"diamond"}
C{{"hexagon"}}
@@ -271,7 +271,7 @@ describe('Block diagram', () => {
it('BL20: block types 3 - stadium', () => {
imgSnapshotTest(
- `block-beta
+ `block
A(["stadium"])
`,
{}
@@ -280,7 +280,7 @@ describe('Block diagram', () => {
it('BL21: block types 4 - lean right, lean left, trapezoid and inv trapezoid', () => {
imgSnapshotTest(
- `block-beta
+ `block
A[/"lean right"/]
B[\"lean left"\]
C[/"trapezoid"\]
@@ -292,7 +292,7 @@ describe('Block diagram', () => {
it('BL22: block types 1 - square, rounded and circle', () => {
imgSnapshotTest(
- `block-beta
+ `block
A["square"]
B("rounded")
C(("circle"))
@@ -303,7 +303,7 @@ describe('Block diagram', () => {
it('BL23: sizing - it should be possible to make a block wider', () => {
imgSnapshotTest(
- `block-beta
+ `block
A("rounded"):2
B:2
C
@@ -314,7 +314,7 @@ describe('Block diagram', () => {
it('BL24: sizing - it should be possible to make a composite block wider', () => {
imgSnapshotTest(
- `block-beta
+ `block
block:2
A
end
@@ -326,7 +326,7 @@ describe('Block diagram', () => {
it('BL25: block in the middle with space on each side', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
space
middle["In the middle"]
@@ -337,7 +337,7 @@ describe('Block diagram', () => {
});
it('BL26: space and an edge', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 5
A space B
A --x B
@@ -347,7 +347,7 @@ describe('Block diagram', () => {
});
it('BL27: block sizes for regular blocks', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
a["A wide one"] b:2 c:2 d
`,
@@ -356,7 +356,7 @@ describe('Block diagram', () => {
});
it('BL28: composite block with a set width - f should use the available space', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
a:3
block:e:3
@@ -370,7 +370,7 @@ describe('Block diagram', () => {
it('BL29: composite block with a set width - f and g should split the available space', () => {
imgSnapshotTest(
- `block-beta
+ `block
columns 3
a:3
block:e:3
@@ -393,6 +393,17 @@ describe('Block diagram', () => {
overflow:3
short:1
also_overflow:2
+`,
+ {}
+ );
+ });
+
+ it('BL31: edge without arrow syntax should render with no arrowheads', () => {
+ imgSnapshotTest(
+ `block-beta
+ a
+ b
+ a --- b
`,
{}
);
diff --git a/cypress/integration/rendering/classDiagram.spec.js b/cypress/integration/rendering/classDiagram.spec.js
index f66a2d6f3..bd2a96b34 100644
--- a/cypress/integration/rendering/classDiagram.spec.js
+++ b/cypress/integration/rendering/classDiagram.spec.js
@@ -512,4 +512,17 @@ describe('Class diagram', () => {
);
});
});
+
+ it('should handle backticks for namespace and class names', () => {
+ imgSnapshotTest(
+ `
+ classDiagram
+ namespace \`A::B\` {
+ class \`IPC::Sender\`
+ }
+ RenderProcessHost --|> \`IPC::Sender\`
+ `,
+ {}
+ );
+ });
});
diff --git a/cypress/integration/rendering/flowchart-elk.spec.js b/cypress/integration/rendering/flowchart-elk.spec.js
index 27af2c40c..312e1d5b4 100644
--- a/cypress/integration/rendering/flowchart-elk.spec.js
+++ b/cypress/integration/rendering/flowchart-elk.spec.js
@@ -1053,6 +1053,21 @@ flowchart LR
});
});
});
+
+ it('6647-elk: should keep node order when using elk layout unless it would add crossings', () => {
+ imgSnapshotTest(
+ `---
+config:
+ layout: elk
+---
+ flowchart TB
+ a --> a1 & a2 & a3 & a4
+ b --> b1 & b2
+ b2 --> b3
+ b1 --> b4
+ `
+ );
+ });
});
describe('Title and arrow styling #4813', () => {
diff --git a/cypress/integration/rendering/flowchart-v2.spec.js b/cypress/integration/rendering/flowchart-v2.spec.js
index d67e7a28c..5ef32c269 100644
--- a/cypress/integration/rendering/flowchart-v2.spec.js
+++ b/cypress/integration/rendering/flowchart-v2.spec.js
@@ -1113,6 +1113,37 @@ end
);
});
});
+ describe('Flowchart Node Shape Rendering', () => {
+ it('should render a stadium-shaped node', () => {
+ imgSnapshotTest(
+ `flowchart TB
+ A(["Start"]) --> n1["Untitled Node"]
+ A --> n2["Untitled Node"]
+ `,
+ {}
+ );
+ });
+ it('should render a diamond-shaped node using shape config', () => {
+ imgSnapshotTest(
+ `flowchart BT
+ n2["Untitled Node"] --> n1["Diamond"]
+ n1@{ shape: diam}
+ `,
+ {}
+ );
+ });
+ it('should render a rounded rectangle and a normal rectangle', () => {
+ imgSnapshotTest(
+ `flowchart BT
+ n2["Untitled Node"] --> n1["Rounded Rectangle"]
+ n3["Untitled Node"] --> n1
+ n1@{ shape: rounded}
+ n3@{ shape: rect}
+ `,
+ {}
+ );
+ });
+ });
it('6617: Per Link Curve Styling using edge Ids', () => {
imgSnapshotTest(
@@ -1134,6 +1165,28 @@ end
);
});
+ describe('when rendering unsuported markdown', () => {
+ const graph = `flowchart TB
+ mermaid{"What is\nyourmermaid version?"} --> v10["<11"] --"\`<**1**1\`"--> fine["No bug"]
+ mermaid --> v11[">= v11"] -- ">= v11" --> broken["Affected by https://github.com/mermaid-js/mermaid/issues/5824"]
+ subgraph subgraph1["\`How to fix **fix**\`"]
+ broken --> B["B"]
+ end
+ githost["Github, Gitlab, BitBucket, etc."]
+ githost2["\`Github, Gitlab, BitBucket, etc.\`"]
+ a["1."]
+ b["- x"]
+ `;
+
+ it('should render raw strings', () => {
+ imgSnapshotTest(graph);
+ });
+
+ it('should render raw strings with htmlLabels: false', () => {
+ imgSnapshotTest(graph, { htmlLabels: false });
+ });
+ });
+
it('V2 - 17: should apply class def colour to edge label', () => {
imgSnapshotTest(
` graph LR
diff --git a/cypress/integration/rendering/gantt.spec.js b/cypress/integration/rendering/gantt.spec.js
index 2cc67918c..32dbcb4d9 100644
--- a/cypress/integration/rendering/gantt.spec.js
+++ b/cypress/integration/rendering/gantt.spec.js
@@ -565,6 +565,18 @@ describe('Gantt diagram', () => {
);
});
+ it('should render only the day when using dateFormat D', () => {
+ imgSnapshotTest(
+ `
+ gantt
+ title Test
+ dateFormat D
+ A :a, 1, 1d
+ `,
+ {}
+ );
+ });
+
// TODO: fix it
//
// This test is skipped deliberately
@@ -647,6 +659,49 @@ describe('Gantt diagram', () => {
);
});
+ it('should render a gantt diagram excluding a specific date in YYYY-MM-DD HH:mm:ss format', () => {
+ imgSnapshotTest(
+ `
+ gantt
+ dateFormat YYYY-MM-DD HH:mm:ss
+ excludes 2025-07-07
+ section Section
+ A task :a1, 2025-07-04 20:30:30, 2025-07-08 10:30:30
+ Another task:after a1, 20h
+ `,
+ {}
+ );
+ });
+
+ it('should render a gantt diagram excluding saturday and sunday in YYYY-MM-DD HH:mm:ss format', () => {
+ imgSnapshotTest(
+ `
+ gantt
+ dateFormat YYYY-MM-DD HH:mm:ss
+ excludes weekends
+ weekend saturday
+ section Section
+ A task :a1, 2025-07-04 20:30:30, 2025-07-08 10:30:30
+ Another task:after a1, 20h
+ `,
+ {}
+ );
+ });
+ it('should render a gantt diagram excluding friday and saturday in YYYY-MM-DD HH:mm:ss format', () => {
+ imgSnapshotTest(
+ `
+ gantt
+ dateFormat YYYY-MM-DD HH:mm:ss
+ excludes weekends
+ weekend friday
+ section Section
+ A task :a1, 2025-07-04 20:30:30, 2025-07-08 10:30:30
+ Another task:after a1, 20h
+ `,
+ {}
+ );
+ });
+
it("should render when there's a semicolon in the title", () => {
imgSnapshotTest(
`
diff --git a/cypress/integration/rendering/pie.spec.ts b/cypress/integration/rendering/pie.spec.ts
index 171a83057..8f6ef7de3 100644
--- a/cypress/integration/rendering/pie.spec.ts
+++ b/cypress/integration/rendering/pie.spec.ts
@@ -82,4 +82,13 @@ describe('pie chart', () => {
`
);
});
+ it('should render pie slices only for non-zero values but shows all legends', () => {
+ imgSnapshotTest(
+ ` pie title Pets adopted by volunteers
+ "Dogs" : 386
+ "Cats" : 85
+ "Rats" : 1
+ `
+ );
+ });
});
diff --git a/cypress/integration/rendering/sankey.spec.ts b/cypress/integration/rendering/sankey.spec.ts
index ad0d75f18..b9940d998 100644
--- a/cypress/integration/rendering/sankey.spec.ts
+++ b/cypress/integration/rendering/sankey.spec.ts
@@ -15,7 +15,7 @@ describe('Sankey Diagram', () => {
describe('when given a linkColor', function () {
this.beforeAll(() => {
cy.wrap(
- `sankey-beta
+ `sankey
a,b,10
`
).as('graph');
@@ -62,7 +62,7 @@ describe('Sankey Diagram', () => {
this.beforeAll(() => {
cy.wrap(
`
- sankey-beta
+ sankey
a,b,8
b,c,8
diff --git a/cypress/integration/rendering/stateDiagram-v2.spec.js b/cypress/integration/rendering/stateDiagram-v2.spec.js
index 83190dbc7..e5a0cedd0 100644
--- a/cypress/integration/rendering/stateDiagram-v2.spec.js
+++ b/cypress/integration/rendering/stateDiagram-v2.spec.js
@@ -602,6 +602,231 @@ State1 --> [*]
--
55
}
+`,
+ {}
+ );
+ });
+ it('should render edge labels correctly', () => {
+ imgSnapshotTest(
+ `---
+title: On The Way To Something Something DarkSide
+config:
+ look: default
+ theme: default
+---
+
+stateDiagram-v2
+
+ state State1_____________
+ {
+ c0
+ }
+
+ state State2_____________
+ {
+ c1
+ }
+
+ state State3_____________
+ {
+ c7
+ }
+
+ state State4_____________
+ {
+ c2
+ }
+
+ state State5_____________
+ {
+ c3
+ }
+
+ state State6_____________
+ {
+ c4
+ }
+
+ state State7_____________
+ {
+ c5
+ }
+
+ state State8_____________
+ {
+ c6
+ }
+
+
+[*] --> State1_____________
+State1_____________ --> State2_____________ : Transition1_____
+State2_____________ --> State4_____________ : Transition2_____
+State2_____________ --> State3_____________ : Transition3_____
+State3_____________ --> State2_____________
+State4_____________ --> State2_____________ : Transition5_____
+State4_____________ --> State5_____________ : Transition6_____
+State5_____________ --> State6_____________ : Transition7_____
+State6_____________ --> State4_____________ : Transition8_____
+State2_____________ --> State7_____________ : Transition4_____
+State4_____________ --> State7_____________ : Transition4_____
+State5_____________ --> State7_____________ : Transition4_____
+State6_____________ --> State7_____________ : Transition4_____
+State7_____________ --> State1_____________ : Transition9_____
+State5_____________ --> State8_____________ : Transition10____
+State8_____________ --> State5_____________ : Transition11____
+`,
+ {}
+ );
+ });
+ it('should render edge labels correctly with multiple transitions', () => {
+ imgSnapshotTest(
+ `---
+title: Multiple Transitions
+config:
+ look: default
+ theme: default
+---
+
+stateDiagram-v2
+
+ state State1_____________
+ {
+ c0
+ }
+
+ state State2_____________
+ {
+ c1
+ }
+
+ state State3_____________
+ {
+ c7
+ }
+
+ state State4_____________
+ {
+ c2
+ }
+
+ state State5_____________
+ {
+ c3
+ }
+
+ state State6_____________
+ {
+ c4
+ }
+
+ state State7_____________
+ {
+ c5
+ }
+
+ state State8_____________
+ {
+ c6
+ }
+
+ state State9_____________
+ {
+ c9
+ }
+
+[*] --> State1_____________
+State1_____________ --> State2_____________ : Transition1_____
+State2_____________ --> State4_____________ : Transition2_____
+State2_____________ --> State3_____________ : Transition3_____
+State3_____________ --> State2_____________
+State4_____________ --> State2_____________ : Transition5_____
+State4_____________ --> State5_____________ : Transition6_____
+State5_____________ --> State6_____________ : Transition7_____
+State6_____________ --> State4_____________ : Transition8_____
+State2_____________ --> State7_____________ : Transition4_____
+State4_____________ --> State7_____________ : Transition4_____
+State5_____________ --> State7_____________ : Transition4_____
+State6_____________ --> State7_____________ : Transition4_____
+State7_____________ --> State1_____________ : Transition9_____
+State5_____________ --> State8_____________ : Transition10____
+State8_____________ --> State5_____________ : Transition11____
+State9_____________ --> State8_____________ : Transition12____
+`,
+ {}
+ );
+ });
+
+ it('should render edge labels correctly with multiple states', () => {
+ imgSnapshotTest(
+ `---
+title: Multiple States
+config:
+ look: default
+ theme: default
+---
+
+stateDiagram-v2
+
+ state State1_____________
+ {
+ c0
+ }
+
+ state State2_____________
+ {
+ c1
+ }
+
+ state State3_____________
+ {
+ c7
+ }
+
+ state State4_____________
+ {
+ c2
+ }
+
+ state State5_____________
+ {
+ c3
+ }
+
+ state State6_____________
+ {
+ c4
+ }
+
+ state State7_____________
+ {
+ c5
+ }
+
+ state State8_____________
+ {
+ c6
+ }
+
+ state State9_____________
+ {
+ c9
+ }
+
+ state State10_____________
+ {
+ c10
+ }
+
+[*] --> State1_____________
+State1_____________ --> State2_____________ : Transition1_____
+State2_____________ --> State3_____________ : Transition2_____
+State3_____________ --> State4_____________ : Transition3_____
+State4_____________ --> State5_____________ : Transition4_____
+State5_____________ --> State6_____________ : Transition5_____
+State6_____________ --> State7_____________ : Transition6_____
+State7_____________ --> State8_____________ : Transition7_____
+State8_____________ --> State9_____________ : Transition8_____
+State9_____________ --> State10_____________ : Transition9_____
`,
{}
);
diff --git a/cypress/integration/rendering/xyChart.spec.js b/cypress/integration/rendering/xyChart.spec.js
index a582355e8..d54086fa7 100644
--- a/cypress/integration/rendering/xyChart.spec.js
+++ b/cypress/integration/rendering/xyChart.spec.js
@@ -1,7 +1,7 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('XY Chart', () => {
- it('should render the simplest possible chart', () => {
+ it('should render the simplest possible xy-beta chart', () => {
imgSnapshotTest(
`
xychart-beta
@@ -10,10 +10,19 @@ describe('XY Chart', () => {
{}
);
});
+ it('should render the simplest possible xy chart', () => {
+ imgSnapshotTest(
+ `
+ xychart
+ line [10, 30, 20]
+ `,
+ {}
+ );
+ });
it('Should render a complete chart', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -26,7 +35,7 @@ describe('XY Chart', () => {
it('Should render a chart without title', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
@@ -38,7 +47,7 @@ describe('XY Chart', () => {
it('y-axis title not required', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
@@ -50,7 +59,7 @@ describe('XY Chart', () => {
it('Should render a chart without y-axis with different range', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
bar [5000, 6000, 7500, 8200, 9500, 10500, 14000, 3200, 9200, 9900, 3400, 6000]
line [2000, 7000, 6500, 9200, 9500, 7500, 11000, 10200, 3200, 8500, 7000, 8800]
@@ -61,7 +70,7 @@ describe('XY Chart', () => {
it('x axis title not required', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
bar [5000, 6000, 7500, 8200, 9500, 10500, 14000, 3200, 9200, 9900, 3400, 6000]
line [2000, 7000, 6500, 9200, 9500, 7500, 11000, 10200, 3200, 8500, 7000, 8800]
@@ -72,7 +81,7 @@ describe('XY Chart', () => {
it('Multiple plots can be rendered', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
line [23, 46, 77, 34]
line [45, 32, 33, 12]
bar [87, 54, 99, 85]
@@ -86,7 +95,7 @@ describe('XY Chart', () => {
it('Decimals and negative numbers are supported', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
y-axis -2.4 --> 3.5
line [+1.3, .6, 2.4, -.34]
`,
@@ -104,7 +113,7 @@ describe('XY Chart', () => {
height: 20
plotReservedSpacePercent: 100
---
- xychart-beta
+ xychart
line [5000, 9000, 7500, 6200, 9500, 5500, 11000, 8200, 9200, 9500, 7000, 8800]
`,
{}
@@ -130,7 +139,7 @@ describe('XY Chart', () => {
showTick: false
showAxisLine: false
---
- xychart-beta
+ xychart
bar [5000, 9000, 7500, 6200, 9500, 5500, 11000, 8200, 9200, 9500, 7000, 8800]
`,
{}
@@ -140,7 +149,7 @@ describe('XY Chart', () => {
imgSnapshotTest(
`
%%{init: {"xyChart": {"width": 1000, "height": 600, "titlePadding": 5, "titleFontSize": 10, "xAxis": {"labelFontSize": "20", "labelPadding": 10, "titleFontSize": 30, "titlePadding": 20, "tickLength": 10, "tickWidth": 5}, "yAxis": {"labelFontSize": "20", "labelPadding": 10, "titleFontSize": 30, "titlePadding": 20, "tickLength": 10, "tickWidth": 5}, "plotBorderWidth": 5, "chartOrientation": "horizontal", "plotReservedSpacePercent": 60 }}}%%
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -181,7 +190,7 @@ describe('XY Chart', () => {
plotReservedSpacePercent: 60
showDataLabel: true
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -202,7 +211,7 @@ describe('XY Chart', () => {
yAxis:
showTitle: false
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -223,7 +232,7 @@ describe('XY Chart', () => {
yAxis:
showLabel: false
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -244,7 +253,7 @@ describe('XY Chart', () => {
yAxis:
showTick: false
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -265,7 +274,7 @@ describe('XY Chart', () => {
yAxis:
showAxisLine: false
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -294,7 +303,7 @@ describe('XY Chart', () => {
xAxisLineColor: "#87ceeb"
plotColorPalette: "#008000, #faba63"
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -307,7 +316,7 @@ describe('XY Chart', () => {
it('should use the correct distances between data points', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
x-axis 0 --> 2
line [0, 1, 0, 1]
bar [1, 0, 1, 0]
@@ -325,7 +334,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -344,7 +353,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -357,7 +366,7 @@ describe('XY Chart', () => {
it('should render vertical bar chart without labels by default', () => {
imgSnapshotTest(
`
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -375,7 +384,7 @@ describe('XY Chart', () => {
xyChart:
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
@@ -393,7 +402,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Multiple Bar Plots"
x-axis Categories [A, B, C]
y-axis "Values" 0 --> 100
@@ -412,7 +421,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Multiple Bar Plots"
x-axis Categories [A, B, C]
y-axis "Values" 0 --> 100
@@ -430,7 +439,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Single Bar Chart"
x-axis Categories [A]
y-axis "Value" 0 --> 100
@@ -449,7 +458,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Single Bar Chart"
x-axis Categories [A]
y-axis "Value" 0 --> 100
@@ -467,7 +476,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Decimal and Negative Values"
x-axis Categories [A, B, C]
y-axis -10 --> 10
@@ -486,7 +495,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Decimal and Negative Values"
x-axis Categories [A, B, C]
y-axis -10 --> 10
@@ -504,7 +513,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan,b,c]
y-axis "Revenue (in $)" 4000 --> 12000
@@ -561,7 +570,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan,b,c]
y-axis "Revenue (in $)" 4000 --> 12000
@@ -615,7 +624,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s]
y-axis "Revenue (in $)" 4000 --> 12000
@@ -672,7 +681,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s]
y-axis "Revenue (in $)" 4000 --> 12000
@@ -726,7 +735,7 @@ describe('XY Chart', () => {
xyChart:
showDataLabel: true
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan]
y-axis "Revenue (in $)" 3000 --> 12000
@@ -783,7 +792,7 @@ describe('XY Chart', () => {
showDataLabel: true
chartOrientation: horizontal
---
- xychart-beta
+ xychart
title "Sales Revenue"
x-axis Months [jan]
y-axis "Revenue (in $)" 3000 --> 12000
diff --git a/cypress/platform/darshan.html b/cypress/platform/darshan.html
new file mode 100644
index 000000000..df5994d7d
--- /dev/null
+++ b/cypress/platform/darshan.html
@@ -0,0 +1,35 @@
+
+
+
+ pie title Default text position: Animal adoption + accTitle: simple pie char demo + accDescr: pie chart with 3 sections: dogs, cats, rats. Most are dogs. + "dogs" : -60.67 + "rats" : 40.12 ++ +
+--- +config: + layout: elk + elk: + mergeEdges: false + forceNodeModelOrder: false + considerModelOrder: NONE + +--- + flowchart TB + a --> a1 & a2 & a3 & a4 + b --> b1 & b2 + b2 --> b3 + b1 --> b4+
treemap "Section 1" "Leaf 1.1": 12 diff --git a/cypress/platform/sidv.html b/cypress/platform/sidv.html index b0a1699da..1651b0737 100644 --- a/cypress/platform/sidv.html +++ b/cypress/platform/sidv.html @@ -41,10 +41,6 @@ graph TB const { svg } = await mermaid.render('d22', value); console.log(svg); el.innerHTML = svg; - // mermaid.test1('first_slow', 1200).then((r) => console.info(r)); - // mermaid.test1('second_fast', 200).then((r) => console.info(r)); - // mermaid.test1('third_fast', 200).then((r) => console.info(r)); - // mermaid.test1('forth_slow', 1200).then((r) => console.info(r));