fix(Funnel): prevent NaN coordinate layout crash when all values are zero#7184
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe funnel trapezoid computation now guards against zero Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7184 +/- ##
=======================================
Coverage 89.06% 89.06%
=======================================
Files 539 539
Lines 41011 41011
Branches 5553 5552 -1
=======================================
Hits 36527 36527
Misses 4476 4476
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 231 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-treeshaking-cartesianAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
|
|
Thanks for the review, Please let me know if any further changes are needed. |
Summary
Fixes a division-by-zero issue in Funnel when all values are
0, which causedNaNcoordinates and broke rendering.Fix
x,upperWidth, andlowerWidthwhenmaxValue === 0x = offsetX, widths =0Tests
Added regression test to ensure:
NaNvaluesxand zero widthsImpact
No effect on normal datasets; prevents crashes for all-zero data.
Summary by CodeRabbit
Bug Fixes
Tests