AG-15850 TC10 Fix setState({active}) on gauges#6098
Conversation
| for (const dataArray of [scaleData, nodeData]) { | ||
| for (const datum of dataArray) { | ||
| const x0 = datum.clipX0 ?? datum.x0; | ||
| const x1 = datum.clipX1 ?? datum.x1; | ||
| const y0 = datum.clipY0 ?? datum.y0; | ||
| const y1 = datum.clipY1 ?? datum.y1; | ||
| datum.midPoint = { x: (x0 + x1) / 2, y: (y0 + y1) / 2 }; | ||
| } |
There was a problem hiding this comment.
The new midpoint calculation prefers clipX0/clipX1 and clipY0/clipY1 when present. For segmented gauges these clip values are set to the full scale bounds, so the computed midpoint collapses to the centre of the whole gauge instead of the specific segment. This breaks active item positioning for segmented bars. Use the actual x0/x1/y0/y1 values for midpoint (or only fall back to clip when it reduces the bounds).
There was a problem hiding this comment.
The clip preference is correct. Tested on segmented linear gauge.
https://github.com/user-attachments/assets/65ab1a5e-47b2-4418-ab68-37258a51b640
|
❌ Codex review complete; 1 issue found (P0: 0 | P1: 1 | P2: 0 | P3: 0) View full reviewAG-15850 TC10 Fix
|
|
Snapshots automatically updated, please review before merge: |
|
Snapshots automatically updated, please review before merge: |
…ox()`" This reverts commit b1106d7.
|
Snapshots automatically updated, please review before merge: |
…es_gauges Update test:e2e (shard 1) snapshots.
Conflicts: packages/ag-charts-website/e2e/gallery-examples.spec.ts-snapshots/gallery-customised-radial-gauge-chromium-linux.png (regenerated, but running e2e test) As mentioned in AG-15850, the keynav tooltip has moved a little bit, as side-effect of fixing the tooltip positioning for `initialState.active`
https://ag-grid.atlassian.net/browse/AG-15850