Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds two new hooks, useXAxisDomain and useYAxisDomain, that allow developers to access the calculated domain values of X and Y axes in Recharts. These hooks provide access to both numerical domains (min/max ranges) and categorical domains (arrays of category values), supporting different axis types and configurations including brush interactions.
- Adds comprehensive domain selection functionality for both X and Y axes
- Includes extensive test coverage for various axis configurations and edge cases
- Provides Storybook integration and documentation for the new hooks
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/hooks/useAxisDomain.spec.tsx |
Comprehensive test suite covering various axis configurations, domain types, and edge cases |
storybook/storybook-addon-recharts/inspectors/YAxisDomainInspector.tsx |
Storybook inspector component for Y-axis domain visualization |
storybook/storybook-addon-recharts/inspectors/XAxisDomainInspector.tsx |
Storybook inspector component for X-axis domain visualization |
storybook/storybook-addon-recharts/inspectors/CartesianChartInspector.tsx |
Integration of new domain inspectors into Storybook |
storybook/stories/API/hooks/useAxisDomain.mdx |
Documentation for the new hooks with usage examples |
src/util/ReactUtils.ts |
Minor comment correction for deprecated function |
src/state/cartesianAxisSlice.ts |
Export of default axis ID constant |
src/hooks.ts |
Implementation of the new useXAxisDomain and useYAxisDomain hooks |
Bundle ReportChanges will increase total bundle size by 4.8kB (0.2%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6201 +/- ##
=======================================
Coverage 96.69% 96.70%
=======================================
Files 221 221
Lines 19870 19880 +10
Branches 4098 4102 +4
=======================================
+ Hits 19214 19224 +10
Misses 650 650
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Includes documentation
Related Issue
#6021
Screenshots (if appropriate):
Types of changes
Checklist: