Skip to content

Conversation

@olegat
Copy link
Contributor

@olegat olegat commented Oct 31, 2025

https://ag-grid.atlassian.net/browse/AG-8627

Important

All update branches now lead to ZoomManager.applyUpdateChanges

There were four permutations of ZoomManager updates:

  1. independentAxes: true / update (both X & Y)
  2. independentAxes: true / updateAxis (specific AxisID)
  3. independentAxes: false / update (both X & Y)
  4. independentAxes: false / updateAxis (specific AxisID)

This is very difficult to maintain, because the number of permutations will grow
exponentially as we add more options like independentAxes. Therefore this
commit standardises these permutations into one update flow:

  1. Update a list of AxisIDs

The permutations are mapped as follows:

  1. independentAxes: true / update -> AxisIDs = primaryX, primaryY
  2. independentAxes: true / updateAxis -> AxisIDs = single input axis
  3. independentAxes: false / update -> AxisIDs = all axes in internal state
  4. independentAxes: false / updateAxis -> AxisIDs = all axes in direction of input axis

Base automatically changed from AG-8627/CartesianAxisLike to latest November 3, 2025 15:15
@olegat olegat force-pushed the AG-8627/standardise_updateZoom branch 3 times, most recently from 25f2ae3 to da8f11c Compare November 4, 2025 10:36
@olegat olegat changed the base branch from latest to AG-8627/use_AxisID November 4, 2025 10:37
There are four permutations of ZoomManager updates:
1.  `independentAxes: true`  / update (both X & Y)
2.  `independentAxes: true`  / updateAxis (specific AxisID)
3.  `independentAxes: false` / update (both X & Y)
4.  `independentAxes: false` / updateAxis (specific AxisID)

This is very difficult to maintain, because the number of permutations will grow
exponentially as we add more options like `independentAxes`. Therefore this
commit standardises these permutations into one update flow:
1.  Update a list of AxisIDs

The permutations are mapped as follows:
1.  `independentAxes: true`  / update       -> AxisIDs = primaryX, primaryY
2.  `independentAxes: true`  / updateAxis   -> AxisIDs = single input axis
3.  `independentAxes: false` / update X & Y -> AxisIDs = all axes in internal state
4.  `independentAxes: false` / update       -> AxisIDs = all axes in direction of input axis
@olegat olegat force-pushed the AG-8627/standardise_updateZoom branch from da8f11c to 1767ec5 Compare November 4, 2025 10:44
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

This is update on manuallyAdjust is redundant (set when `changeType` is
'restoreMemento' or 'reset'), and faulty (it always sets manuallyAdjust to
`true` in all update types, such as wheel events on the series-area.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

@olegat olegat force-pushed the AG-8627/standardise_updateZoom branch from 73e3730 to b8de35f Compare November 4, 2025 16:10
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Snapshots automatically updated, please review before merge:

Code in `zoom.ts` should not call `zoomManager.updateChange` directly, it should
be routed through `Zoom.updateZoom` in which internally calls `constrainZoom`.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

Snapshots automatically updated, please review before merge:

There's still some work required in zoom.ts to fully standardise how we perform
zoom updates. `constrainZoom` needs to be refactor to operate on "changes"
instead of "current `DefinedZoomState`".
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The changes in this file are difficult to follow. See PR description for summary.

@olegat olegat marked this pull request as ready for review November 5, 2025 14:26
@olegat olegat requested a review from alantreadway as a code owner November 5, 2025 14:26
Base automatically changed from AG-8627/use_AxisID to latest November 5, 2025 15:36
Copy link
Member

@alantreadway alantreadway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @lsjroberts ?

Copy link
Member

@lsjroberts lsjroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! LGTM

@alantreadway alantreadway merged commit f581295 into latest Nov 5, 2025
29 checks passed
@alantreadway alantreadway deleted the AG-8627/standardise_updateZoom branch November 5, 2025 16:32
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.

4 participants