swimlane / ngx-graph

Graph visualization library for angular
https://swimlane.github.io/ngx-graph
MIT License
932 stars 285 forks source link

fix: correct translation on parent components #530

Closed domMayhew closed 7 months ago

domMayhew commented 11 months ago

The translation applied to cluster and compound nodes was calculated incorrectly. This commit correctly centers parent components over their children.

What kind of change does this PR introduce? (check one with "x")

What is the current behavior? (You can also link to an open issue here) Parent nodes (cluster nodes and compound nodes) are too far to the right relative to their children, when centerNodesOnPositionChange==true.

Cluster nodes are not centered on their children

What is the new behavior? Parent nodes are centered on their children. Screenshot 2023-11-08 220027

Does this PR introduce a breaking change? (check one with "x")

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

sweeneki commented 10 months ago

It would be great if this one is approved!

Many thanks.

On 9 Nov 2023, at 07:03, Dominic Mayhew @.***> wrote:

The translation applied to cluster and compound nodes was calculated incorrectly. This commit correctly centers parent components over their children.

What kind of change does this PR introduce? (check one with "x")

Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Other... Please describe: What is the current behavior? (You can also link to an open issue here) Parent nodes (cluster nodes and compound nodes) are too far to the right relative to their children, when centerNodesOnPositionChange==true.

https://user-images.githubusercontent.com/58090753/281629707-18fce342-47fa-4272-9f15-7e5d704066ef.png What is the new behavior? Parent nodes are centered on their children. https://user-images.githubusercontent.com/58090753/281631821-e898da33-1e26-4e1a-b654-d801bf957ff4.png Does this PR introduce a breaking change? (check one with "x")

Yes No If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

You can view, comment on, or merge this pull request online at:

https://github.com/swimlane/ngx-graph/pull/530

Commit Summary

c45c855 https://github.com/swimlane/ngx-graph/pull/530/commits/c45c855df2670662a8b0763f34b51403a5fcfcbb fix: correct translation on parent components File Changes (1 file https://github.com/swimlane/ngx-graph/pull/530/files) M projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts https://github.com/swimlane/ngx-graph/pull/530/files#diff-e500ec710d86f32d459d34a450582fe79dcb541617240d848fa6319a389fa46a (21) Patch Links:

https://github.com/swimlane/ngx-graph/pull/530.patch https://github.com/swimlane/ngx-graph/pull/530.diff — Reply to this email directly, view it on GitHub https://github.com/swimlane/ngx-graph/pull/530, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH4CXYZK6EIQKAPMVFFDDDYDRWZTAVCNFSM6AAAAAA7EAEXRKVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DIOBZG4ZTMOA. You are receiving this because you are subscribed to this thread.