Skip to content
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

refactor(DirectedGraph): utilize opt.deep for fitToChildren call when resizing clusters #2886

Merged
merged 2 commits into from
Feb 22, 2025

Conversation

MartinKanera
Copy link
Contributor

Description

packages/joint-layout-directed-graph/DirectedGraph.mjs: Modified the cluster resizing logic to filter out top-level clusters and apply the fitToChildren method in reverse-depth order, ensuring that clusters are resized starting from the deepest descendants.

packages/joint-layout-directed-graph/test/index.js: Added a new test to verify that clusters are resized correctly. The test embeds multiple elements within each other, applies the layout, and checks that each parent element is resized to fit its children with the specified padding.

Motivation and Context

Refactor the existing solution, while maintaining the logic and utilizing an existing deep option on the dia.Element.fitToChildren() method.

@kumilingus kumilingus merged commit 72eb5a4 into clientIO:master Feb 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants