-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
fix(architecture): expand group bounding box to include child sizes (fix #7175) #7190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix(architecture): expand group bounding box to include child sizes (fix #7175) #7190
Conversation
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@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 #7190 +/- ##
==========================================
- Coverage 3.55% 3.54% -0.01%
==========================================
Files 473 473
Lines 47500 47556 +56
Branches 731 731
==========================================
Hits 1687 1687
- Misses 45813 45869 +56
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 ↗︎
|
📑 Summary
Fixes #7175 — group boxes in
architecturediagrams could overlap or not expand correctly when group names are long or children have wide rendered sizes. This patch changes how group bounding boxes are computed so the group rectangle is derived from children's rendered widths/heights (when available) plus padding.Resolves #7175
📏 Design Decisions
element.node().getBBox()(viadb.getElementById(id)) and fall back to cytoscape child data width/height.cy.boundingBox()as before.drawGroupsinpackages/mermaid/src/diagrams/architecture/svgDraw.ts.📋 Tasks
drawGroupsbehavior (packages/mermaid/src/diagrams/architecture/svgDraw.spec.ts).cypress/integration/rendering/architecture-group-sizing.spec.js).pnpm changeset).Files changed (high level)
packages/mermaid/src/diagrams/architecture/svgDraw.ts— compute group bbox from children + paddingpackages/mermaid/src/diagrams/architecture/svgDraw.spec.ts— TypeScript unit tests (mockingcreateTextto avoid heavy DOM emulation)cypress/integration/rendering/architecture-group-sizing.spec.js— E2E image snapshot testLocal verification
pnpm test— All unit tests passed locally (Test Files 104 passed | 1 skipped; Tests 3684 passed | 12 skipped | 2 todo).CI notes & follow-ups
drawGroups.If you'd like, I can:
Thanks! Please let me know which follow-up you'd prefer.