Only use the YAxis width oscillation detection if the difference is > 1 pixel#6450
Only use the YAxis width oscillation detection if the difference is > 1 pixel#6450
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the YAxis width oscillation detection to only prevent updates when the width difference is 1 pixel or less, allowing legitimate data changes with larger differences to proceed normally.
- Updates oscillation detection logic to include a 1-pixel threshold check
- Adds comprehensive test coverage for both small oscillations (≤1px) and larger intentional changes (>1px)
- Removes unrelated state management code from AreaChart story
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/state/cartesianAxisSlice.ts | Added 1-pixel threshold condition to oscillation detection logic |
| test/state/selectors/cartesianAxisSlice.spec.ts | Added new test case and updated existing test to verify oscillation behavior with pixel thresholds |
| storybook/stories/API/chart/AreaChart.stories.tsx | Removed unused state management code from story component |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6450 +/- ##
=======================================
Coverage 93.83% 93.83%
=======================================
Files 417 417
Lines 38423 38429 +6
Branches 4502 4506 +4
=======================================
+ Hits 36053 36059 +6
Misses 2353 2353
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 177 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
|
I was wondering, when will a new version 3 be release that includes this fix? Thank you. |
|
I was out for the past two weeks, I will release soon |
Description
The oscillation detector is there for sub-pixel rendering difference but here it was interfering with actual data changes.
Related Issue
Fixes #6424