Repository navigation
fix(tidy-tree): keep mindmap edges connected to a non-circular root - #7639
Merged
Merged
Conversation
The tidy-tree layout's calculateEdgePositions only added intermediate routing points for source/target nodes in the 'left' or 'right' section. For root-sourced edges (section === 'root'), no intermediate point was pushed, so the post-loop intersection recompute used the child's center as the reference and could land the start anchor on the root's top/bottom edge instead of its left/right edge — visually disconnecting the link. The cloud root only appeared correct by coincidence of its rounded shape. Add 'root' branches to both the source and target intermediate-point blocks. The root-side intermediate is placed on the side facing the other node's section. Resolves #7572 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 81be6af The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7639 +/- ##
==========================================
- Coverage 3.31% 3.31% -0.01%
==========================================
Files 539 540 +1
Lines 56664 56699 +35
Branches 824 824
==========================================
Hits 1880 1880
- Misses 54784 54819 +35
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #7572
In the tidy-tree layout,
calculateEdgePositionsonly added an intermediate routing point for source/target nodes whosesectionwas'left'or'right'. For root-sourced edges (section === 'root') no intermediate was pushed, so the post-loop intersection recompute used the child's center as the reference and could land the start anchor on the root's top/bottom edge — visually disconnecting the link from the root. The cloud root only appeared correct by coincidence of its rounded silhouette.'root'branches to both the source and target intermediate-point blocks incalculateEdgePositions. The root-side intermediate is placed on the side of the root facing the other node's section (left → -x,right → +x), aty = root.y.imgSnapshotTestusing the exact reproduction from the issue.Classification
@mermaid-js/layout-tidy-tree)Verification
expected -30 to be 20), passes afterpnpm vitest run packages/mermaid-layout-tidy-tree— 14/14)cypress/integration/rendering/mindmap-tidy-tree.spec.js(5-tidy-tree)comp-review-changes: passed (0 blockers, 0 warnings, 1 info — expected Argos diff for non-circle-root tidy-tree mindmaps; this is the intent of the fix)@mermaid-js/layout-tidy-treeandmermaid🤖 Generated with Claude Code