Skip to content

fix(interaction): brushXFilter/brushYFilter should not modify the non-filtered axis scale#7280

Draft
Copilot wants to merge 2 commits intov5from
copilot/fix-issue-7272
Draft

fix(interaction): brushXFilter/brushYFilter should not modify the non-filtered axis scale#7280
Copilot wants to merge 2 commits intov5from
copilot/fix-issue-7272

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

brushXFilter was hiding and overwriting the Y axis scale domain (and vice versa for brushYFilter), causing Y axis ticks to change after an X-only brush filter operation.

Root causes

  • BrushFilter defaulted hideY: true for all subclasses, including BrushXFilter — causing the Y axis to flash hide/show during re-render, appearing as a tick change
  • BrushFilter unconditionally set both scale.x.domain and scale.y.domain with nice: false, even when only one axis was being filtered — potentially producing different tick positions than the original scale

Changes

  • brushFilter.ts: Add filterX and filterY boolean params to BrushFilter. Scale domains are only updated for axes where the corresponding flag is true:
    scale: {
      ...(filterX && { x: { domain: domainX, nice: false } }),
      ...(filterY && { y: { domain: domainY, nice: false } }),
    }
  • brushXFilter.ts: Pass hideY: false, filterY: false — Y axis is unaffected when filtering X
  • brushYFilter.ts: Pass hideX: false, filterX: false — X axis is unaffected when filtering Y
  • interaction.spec.ts: Add unit tests asserting Y domain is unchanged after brushXFilter and X domain is unchanged after brushYFilter

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…cks (#7272)

Co-authored-by: moayuisuda <37040897+moayuisuda@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue 7272 fix(interaction): brushXFilter/brushYFilter should not modify the non-filtered axis scale Mar 20, 2026
Copilot AI requested a review from moayuisuda March 20, 2026 10:46
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.

2 participants