fix(elk): scope rounded edge curve to ELK layout only - #7454
Conversation
Reverts the global flowchart curve default from 'rounded' back to 'basis' and instead sets edge.curve = 'rounded' on each ELK edge right before insertEdge. This ensures ELK's orthogonal routes render with right-angle segments and rounded corners, without changing the default for non-ELK layouts. Fixes #7213 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7454 +/- ##
=========================================
- Coverage 3.59% 3.53% -0.06%
=========================================
Files 475 493 +18
Lines 47191 49010 +1819
Branches 735 769 +34
=========================================
+ Hits 1696 1734 +38
- Misses 45495 47276 +1781
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ashishjain0512
left a comment
There was a problem hiding this comment.
[sisyphus-bot]
Clean, focused fix — this is exactly the right scope for the ELK edge curve issue.
Note: PR targets master. This appears to be an intentional hotfix by the maintainer. Also note that PR #7452 covers this same fix bundled with other changes — worth clarifying which PR supersedes the other.
What's working well
🎉 [praise] Excellent scoping — the fix is isolated to just 3 files with no collateral changes. Reverting the global default to basis in config.schema.yaml:2160 and setting edge.curve = 'rounded' only in the ELK render path (render.ts:1073) is the cleanest possible approach.
🎉 [praise] Good explanatory comment on the edge.curve = 'rounded' line — "ELK produces orthogonal edge routes" explains the why, not just the what.
🎉 [praise] The changeset correctly scopes to both mermaid and @mermaid-js/mermaid-layout-elk packages with patch bumps. The description clearly communicates what changed and what's unaffected.
Things to address
🟡 [important] The PR checklist shows unchecked items for Cypress e2e snapshots and CI. Since this changes the rendering behavior of ELK edges, visual regression verification is important — especially to confirm that the original issue (#7213, curved ELK edges) is resolved and that non-ELK flowcharts are visually unchanged. It would be great to confirm CI passes cleanly before merge.
💡 [suggestion] Consider adding a Cypress e2e test case using the reproduction diagram from issue #7213 (the flowchart with subgraphs G1/G2 and repeated N11 --- N22 edges). This would prevent regression of this specific fix and serve as documentation that ELK edge routing is intentionally orthogonal.
Security
No XSS or injection issues. This PR only modifies a config default value and sets a string property (edge.curve) on an internal edge object. No user input handling, DOM manipulation, or sanitization changes.
Self-check
- At least one 🎉 [praise] item exists (3)
- No duplicate comments
- Severity tally: 0 🔴 blocking / 1 🟡 important / 0 🟢 nit / 1 💡 suggestion / 3 🎉 praise
- Verdict: COMMENT (1 🟡 — e2e verification pending)
- Not a draft PR
- No inline comments used
- Tone check: constructive, appreciative
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
@knsv-bot, Thank you for the contribution! |
* 'master' of https://github.com/mermaid-js/mermaid: fix(gantt): restore readable outside-text for done tasks in dark mode (#7456) fix(elk): scope rounded edge curve to ELK layout only (#7454)
* changeset-release/master: fix pnpm lock file Fix: ER diagram edge label positioning (#7453) chore: Update coupon fix(gantt): restore readable outside-text for done tasks in dark mode (#7456) fix(elk): scope rounded edge curve to ELK layout only (#7454) Version Packages fix: plausible build chore: Update plausible chore: Update release version in docs chore: Track editor picker selection fix: update broken docsy link and exclude bot-blocked domains from link checker chore: replace MERMAID_RELEASE_VERSION placeholders with current version fix: correct package name in changeset slow-lemons-know Updated Hero text Version Packages Fixed issue with hero text chore: Update banner with coupon Update link with source Updating the Hero on the docs side # Conflicts: # .changeset/rounded-edge-curves.md # .changeset/weak-tools-pay.md # cypress/integration/rendering/flowchart-v2.spec.js # packages/mermaid/CHANGELOG.md # packages/mermaid/src/rendering-util/createText.ts # packages/mermaid/src/rendering-util/rendering-elements/edges.js # packages/tiny/CHANGELOG.md # pnpm-lock.yaml
* master: (24 commits) Version Packages (#7561) Release candidate 11.14.0 (#7526) chore: Editor Picker V2 (#7497) Setting the link to Get started to the correct on Version Packages (#7466) fix: use correct package name for elk dummy commit Fix: ER diagram edge label positioning (#7453) chore: Update coupon fix(gantt): restore readable outside-text for done tasks in dark mode (#7456) fix(elk): scope rounded edge curve to ELK layout only (#7454) fix: plausible build chore: Update plausible chore: Update release version in docs chore: Track editor picker selection fix: update broken docsy link and exclude bot-blocked domains from link checker chore: replace MERMAID_RELEASE_VERSION placeholders with current version fix: correct package name in changeset slow-lemons-know Updated Hero text Version Packages ... # Conflicts: # .changeset/weak-tools-pay.md # docs/syntax/architecture.md # docs/syntax/timeline.md # docs/syntax/treeView.md # docs/syntax/wardley.md # docs/syntax/xyChart.md # packages/examples/CHANGELOG.md # packages/examples/package.json # packages/mermaid/CHANGELOG.md # packages/mermaid/package.json # packages/mermaid/src/diagrams/git/gitGraphRenderer.ts # packages/mermaid/src/docs/.vitepress/components/EditorSelectionModal.vue # packages/mermaid/src/docs/syntax/architecture.md # packages/mermaid/src/docs/syntax/timeline.md # packages/mermaid/src/docs/syntax/treeView.md # packages/mermaid/src/docs/syntax/wardley.md # packages/mermaid/src/docs/syntax/xyChart.md # packages/mermaid/src/rendering-util/rendering-elements/shapes/requirementBox.ts # packages/parser/CHANGELOG.md # packages/parser/package.json # packages/tiny/CHANGELOG.md # packages/tiny/package.json

Summary
Scopes the fix from #7425 (issue #7213) so that the
roundedcurve is only applied when the ELK layout algorithm is used, rather than changing the global default for all flowcharts.flowchart.curvedefault from'rounded'back to'basis'edge.curve = 'rounded'on each ELK edge right beforeinsertEdge, ensuring ELK's orthogonal routes render with right-angle segments and rounded cornersResolves #7213
Test plan
🤖 Generated with Claude Code