-
Notifications
You must be signed in to change notification settings - Fork 32
AG-8627 Standardise ZoomManager update flow
#5489
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
Conversation
25f2ae3 to
da8f11c
Compare
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
da8f11c to
1767ec5
Compare
|
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.
|
Snapshots automatically updated, please review before merge: |
|
Snapshots automatically updated, please review before merge: |
|
Snapshots automatically updated, please review before merge: |
|
Snapshots automatically updated, please review before merge: |
73e3730 to
b8de35f
Compare
|
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`.
|
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`".
There was a problem hiding this comment.
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.
alantreadway
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @lsjroberts ?
lsjroberts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! LGTM
https://ag-grid.atlassian.net/browse/AG-8627
Important
All update branches now lead to
ZoomManager.applyUpdateChangesThere were four permutations of ZoomManager updates:
independentAxes: true/update(both X & Y)independentAxes: true/updateAxis(specific AxisID)independentAxes: false/update(both X & Y)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 thiscommit standardises these permutations into one update flow:
The permutations are mapped as follows:
independentAxes: true/update-> AxisIDs = primaryX, primaryYindependentAxes: true/updateAxis-> AxisIDs = single input axisindependentAxes: false/update-> AxisIDs = all axes in internal stateindependentAxes: false/updateAxis-> AxisIDs = all axes in direction of input axis