From 2260948b7bda08f00616c2ce678bed1da69eb96c Mon Sep 17 00:00:00 2001 From: anderium <33520919+anderium@users.noreply.github.com> Date: Wed, 13 Aug 2025 14:39:09 +0200 Subject: [PATCH] Add changeset and integration test --- .changeset/spicy-ties-see.md | 5 +++++ .../integration/rendering/flowchart-elk.spec.js | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .changeset/spicy-ties-see.md diff --git a/.changeset/spicy-ties-see.md b/.changeset/spicy-ties-see.md new file mode 100644 index 000000000..25fc643e0 --- /dev/null +++ b/.changeset/spicy-ties-see.md @@ -0,0 +1,5 @@ +--- +'@mermaid-js/layout-elk': patch +--- + +Make elk not force node model order, but strongly consider it instead 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', () => {