Expose and document chart layout hooks and layout types in public API#7265
Conversation
PavelVanecek
left a comment
There was a problem hiding this comment.
Please also export the return types from index.ts as they are now part of the public API (LayoutType + CartesianLayout + PolarLayout). I believe that omnidoc should notify you of the same (npm run omnidoc && npm run test-omnidoc)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7265 +/- ##
==========================================
+ Coverage 89.07% 89.08% +0.01%
==========================================
Files 538 541 +3
Lines 41020 41069 +49
Branches 5563 5564 +1
==========================================
+ Hits 36538 36586 +48
- Misses 4474 4475 +1
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
Done in 4d77215. I exported |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
Bundle ReportChanges will increase total bundle size by 6.2kB (0.12%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-treeshaking-sankeyAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-treemapAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-treeshaking-cartesianAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-sunburstAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-polarAssets Changed:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
Description
This updates the public API surface to include chart layout introspection hooks and their return types, and ensures they are documented/validated by omnidoc.
useChartLayout,useCartesianChartLayout, andusePolarChartLayoutare exported fromrecharts, and now the related layout types are exported too:LayoutType,CartesianLayout, andPolarLayout.Public API exports
src/index.tsfor:useChartLayoutuseCartesianChartLayoutusePolarChartLayoutsrc/index.tsfor:LayoutTypeCartesianLayoutPolarLayoutHook documentation source
src/context/chartLayoutContext.tsxfor all three hooks so omnidoc can generate API pages with return semantics.Tests
test/context/chartLayoutContext.spec.tsxwith focused coverage for:undefined)../../srcto validate public export usage.Docs wiring
www/src/docs/apiCates.ts.www/src/docs/apiExamples/index.tsxfor:useChartLayout,useCartesianChartLayout,usePolarChartLayoutLayoutType,CartesianLayout,PolarLayoutRelated Issue
Export & document layout hooks:
useChartLayoutuseCartesianChartLayoutusePolarChartLayoutMotivation and Context
These hooks already existed internally but were not part of the package entrypoint/docs surface. Once the hooks became public, their return types also needed to be publicly exported to keep the API complete and type-safe for consumers. This change makes both hooks and their related layout types first-class public API.
How Has This Been Tested?
test/context/chartLayoutContext.spec.tsxfor public hook behavior across chart contexts.npm run omnidocnpm run test-omnidocnpm run check-types-libScreenshots (if appropriate):
N/A (API/docs surface change)
Types of changes
Checklist: