Conversation
WalkthroughThis PR makes substantial API and documentation improvements across the library. It adds new public props to chart components (hide for Area/Bar/Line/Scatter/Pie), introduces deprecation metadata support to the omnidoc pipeline, refactors the type system to introduce BaseChartProps and make ExternalMouseEvents handlers optional, expands Legend and LabelList APIs, and migrates API documentation files from .ts to .tsx format while establishing new context consumption/provision annotations. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
www/src/docs/api/TextAPI.tsx (1)
170-171: Consider consistent ordering for union type values.The union type values appear to be in an arbitrary order. Consider alphabetical ordering or placing the default value (
'start') first for consistency with documentation conventions.- type: '"end" | "middle" | "inherit" | "start"', + type: '"start" | "end" | "middle" | "inherit"',src/util/types.ts (1)
1164-1167: Consider using a generic type parameter orunknown[]instead ofany[].Per coding guidelines,
anyshould be avoided. While chart data is intentionally flexible, usingunknown[]or a generic likeBaseChartProps<T = unknown>withdata?: T[]would provide better type safety while preserving flexibility.That said, this appears to be consolidating existing behavior, so this could be addressed in a follow-up.
- /** - * The source data. Each element should be an object. - */ - data?: any[]; + /** + * The source data. Each element should be an object. + */ + data?: unknown[];www/src/docs/api/index.ts (1)
53-54: Inconsistent use of.tsxextension in imports.These imports explicitly include the
.tsxextension, while all other imports in this file omit the extension. Consider removing the extension for consistency:-import { CustomizedAPI } from './CustomizedAPI.tsx'; -import { LabelListAPI } from './LabelListAPI.tsx'; +import { CustomizedAPI } from './CustomizedAPI'; +import { LabelListAPI } from './LabelListAPI';
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (49)
.github/workflows/ci.yml(1 hunks)omnidoc/componentsAndDefaultPropsMap.ts(1 hunks)omnidoc/componentsWithInconsistentCommentsInApiDoc.ts(1 hunks)omnidoc/cross-component-prop-comments.spec.ts(3 hunks)omnidoc/generateApiDoc.ts(5 hunks)omnidoc/omnidoc.spec.ts(3 hunks)omnidoc/readProject.spec.ts(2 hunks)src/cartesian/Area.tsx(1 hunks)src/cartesian/Bar.tsx(1 hunks)src/cartesian/Line.tsx(1 hunks)src/cartesian/Scatter.tsx(3 hunks)src/chart/PieChart.tsx(1 hunks)src/chart/RechartsWrapper.tsx(1 hunks)src/chart/SunburstChart.tsx(2 hunks)src/chart/types.ts(1 hunks)src/component/Customized.tsx(1 hunks)src/component/DefaultLegendContent.tsx(3 hunks)src/component/Label.tsx(2 hunks)src/component/LabelList.tsx(2 hunks)src/component/Legend.tsx(4 hunks)src/component/Tooltip.tsx(1 hunks)src/polar/Pie.tsx(3 hunks)src/polar/PolarAngleAxis.tsx(1 hunks)src/polar/PolarGrid.tsx(1 hunks)src/polar/PolarRadiusAxis.tsx(1 hunks)src/polar/Radar.tsx(1 hunks)src/polar/RadialBar.tsx(1 hunks)src/util/types.ts(2 hunks)storybook/stories/API/props/LabelListProps.ts(0 hunks)test/component/Legend.itemSorter.spec.tsx(2 hunks)test/component/Legend.spec.tsx(2 hunks)www/src/docs/api/AreaAPI.tsx(1 hunks)www/src/docs/api/Customized.ts(0 hunks)www/src/docs/api/CustomizedAPI.tsx(1 hunks)www/src/docs/api/LabelAPI.tsx(2 hunks)www/src/docs/api/LabelList.ts(0 hunks)www/src/docs/api/LabelListAPI.tsx(1 hunks)www/src/docs/api/Legend.ts(0 hunks)www/src/docs/api/LegendAPI.tsx(1 hunks)www/src/docs/api/LineAPI.tsx(1 hunks)www/src/docs/api/Pie.ts(0 hunks)www/src/docs/api/PieAPI.tsx(1 hunks)www/src/docs/api/PieChart.ts(0 hunks)www/src/docs/api/PieChartAPI.tsx(1 hunks)www/src/docs/api/ScatterAPI.tsx(3 hunks)www/src/docs/api/TextAPI.tsx(1 hunks)www/src/docs/api/index.ts(4 hunks)www/src/docs/api/types.ts(2 hunks)www/src/views/APIViewNew.tsx(2 hunks)
💤 Files with no reviewable changes (6)
- www/src/docs/api/PieChart.ts
- www/src/docs/api/Customized.ts
- www/src/docs/api/LabelList.ts
- storybook/stories/API/props/LabelListProps.ts
- www/src/docs/api/Pie.ts
- www/src/docs/api/Legend.ts
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx}: Never useanytype (implicit or explicit) in TypeScript code
Preferunknownoveranyand refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not useastype assertions in TypeScript; the only exception isas const
Files:
www/src/docs/api/CustomizedAPI.tsxsrc/cartesian/Area.tsxsrc/chart/PieChart.tsxsrc/component/Tooltip.tsxwww/src/docs/api/LabelListAPI.tsxsrc/cartesian/Bar.tsxomnidoc/cross-component-prop-comments.spec.tsomnidoc/componentsAndDefaultPropsMap.tssrc/cartesian/Scatter.tsxomnidoc/componentsWithInconsistentCommentsInApiDoc.tssrc/polar/PolarGrid.tsxomnidoc/readProject.spec.tssrc/component/Label.tsxwww/src/docs/api/PieAPI.tsxtest/component/Legend.spec.tsxsrc/component/LabelList.tsxwww/src/docs/api/LegendAPI.tsxsrc/cartesian/Line.tsxsrc/polar/PolarRadiusAxis.tsxwww/src/docs/api/PieChartAPI.tsxsrc/chart/RechartsWrapper.tsxsrc/polar/RadialBar.tsxwww/src/docs/api/TextAPI.tsxsrc/util/types.tssrc/chart/types.tssrc/chart/SunburstChart.tsxwww/src/docs/api/LabelAPI.tsxsrc/polar/PolarAngleAxis.tsxwww/src/docs/api/AreaAPI.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/index.tswww/src/docs/api/types.tstest/component/Legend.itemSorter.spec.tsxwww/src/docs/api/ScatterAPI.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Legend.tsxsrc/component/Customized.tsxomnidoc/omnidoc.spec.tsomnidoc/generateApiDoc.tssrc/polar/Radar.tsxwww/src/views/APIViewNew.tsxsrc/polar/Pie.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Ensure code lints by running
npm run lintand follows Airbnb's Style Guide
Files:
www/src/docs/api/CustomizedAPI.tsxsrc/cartesian/Area.tsxsrc/chart/PieChart.tsxsrc/component/Tooltip.tsxwww/src/docs/api/LabelListAPI.tsxsrc/cartesian/Bar.tsxomnidoc/cross-component-prop-comments.spec.tsomnidoc/componentsAndDefaultPropsMap.tssrc/cartesian/Scatter.tsxomnidoc/componentsWithInconsistentCommentsInApiDoc.tssrc/polar/PolarGrid.tsxomnidoc/readProject.spec.tssrc/component/Label.tsxwww/src/docs/api/PieAPI.tsxtest/component/Legend.spec.tsxsrc/component/LabelList.tsxwww/src/docs/api/LegendAPI.tsxsrc/cartesian/Line.tsxsrc/polar/PolarRadiusAxis.tsxwww/src/docs/api/PieChartAPI.tsxsrc/chart/RechartsWrapper.tsxsrc/polar/RadialBar.tsxwww/src/docs/api/TextAPI.tsxsrc/util/types.tssrc/chart/types.tssrc/chart/SunburstChart.tsxwww/src/docs/api/LabelAPI.tsxsrc/polar/PolarAngleAxis.tsxwww/src/docs/api/AreaAPI.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/index.tswww/src/docs/api/types.tstest/component/Legend.itemSorter.spec.tsxwww/src/docs/api/ScatterAPI.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Legend.tsxsrc/component/Customized.tsxomnidoc/omnidoc.spec.tsomnidoc/generateApiDoc.tssrc/polar/Radar.tsxwww/src/views/APIViewNew.tsxsrc/polar/Pie.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (DEVELOPING.md)
All imports from
rechartsmust use the public API entry point; imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed
Files:
www/src/docs/api/CustomizedAPI.tsxsrc/cartesian/Area.tsxsrc/chart/PieChart.tsxsrc/component/Tooltip.tsxwww/src/docs/api/LabelListAPI.tsxsrc/cartesian/Bar.tsxomnidoc/cross-component-prop-comments.spec.tsomnidoc/componentsAndDefaultPropsMap.tssrc/cartesian/Scatter.tsxomnidoc/componentsWithInconsistentCommentsInApiDoc.tssrc/polar/PolarGrid.tsxomnidoc/readProject.spec.tssrc/component/Label.tsxwww/src/docs/api/PieAPI.tsxtest/component/Legend.spec.tsxsrc/component/LabelList.tsxwww/src/docs/api/LegendAPI.tsxsrc/cartesian/Line.tsxsrc/polar/PolarRadiusAxis.tsxwww/src/docs/api/PieChartAPI.tsxsrc/chart/RechartsWrapper.tsxsrc/polar/RadialBar.tsxwww/src/docs/api/TextAPI.tsxsrc/util/types.tssrc/chart/types.tssrc/chart/SunburstChart.tsxwww/src/docs/api/LabelAPI.tsxsrc/polar/PolarAngleAxis.tsxwww/src/docs/api/AreaAPI.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/index.tswww/src/docs/api/types.tstest/component/Legend.itemSorter.spec.tsxwww/src/docs/api/ScatterAPI.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Legend.tsxsrc/component/Customized.tsxomnidoc/omnidoc.spec.tsomnidoc/generateApiDoc.tssrc/polar/Radar.tsxwww/src/views/APIViewNew.tsxsrc/polar/Pie.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Do not hardcode any strings or formatting choices in library code; users should provide localized strings as desired
Files:
src/cartesian/Area.tsxsrc/chart/PieChart.tsxsrc/component/Tooltip.tsxsrc/cartesian/Bar.tsxsrc/cartesian/Scatter.tsxsrc/polar/PolarGrid.tsxsrc/component/Label.tsxsrc/component/LabelList.tsxsrc/cartesian/Line.tsxsrc/polar/PolarRadiusAxis.tsxsrc/chart/RechartsWrapper.tsxsrc/polar/RadialBar.tsxsrc/util/types.tssrc/chart/types.tssrc/chart/SunburstChart.tsxsrc/polar/PolarAngleAxis.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Legend.tsxsrc/component/Customized.tsxsrc/polar/Radar.tsxsrc/polar/Pie.tsx
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
When running unit tests, prefer to run a single test file using
npm run test -- path/to/TestFile.spec.tsxrather than running all tests withnpm test
Files:
omnidoc/cross-component-prop-comments.spec.tsomnidoc/readProject.spec.tstest/component/Legend.spec.tsxtest/component/Legend.itemSorter.spec.tsxomnidoc/omnidoc.spec.ts
test/**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Aim for 100% unit test code coverage when writing new code
Files:
test/component/Legend.spec.tsxtest/component/Legend.itemSorter.spec.tsx
test/component/**/*.spec.tsx
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use React Testing Library for testing component interactions and behavior upon rendering
Files:
test/component/Legend.spec.tsxtest/component/Legend.itemSorter.spec.tsx
test/**/*.{test,spec}.{ts,tsx}
📄 CodeRabbit inference engine (test/README.md)
test/**/*.{test,spec}.{ts,tsx}: Aim for 100% unit test code coverage when writing new code
Prefer to use thecreateSelectorTestCasehelper function when writing or modifying tests
Use theexpectLastCalledWithhelper function instead ofexpect(spy).toHaveBeenLastCalledWith(...)for better typing and autocompletion
Verify the number of selector calls using the spy object fromcreateSelectorTestCaseto spot unnecessary re-renders and improve performance
MockgetBoundingClientRectin tests using the helper function provided intest/helper/MockGetBoundingClientRect.ts
Usevi.useFakeTimers()in all tests due to Redux autoBatchEnhancer dependency on timers andrequestAnimationFrame
Callvi.runOnlyPendingTimers()to advance timers after renders when not usingcreateSelectorTestCasehelper, and avoidvi.runAllTimers()to prevent infinite loops
UseuserEvent.setup({ advanceTimers: vi.runOnlyPendingTimers })or theuserEventSetuphelper function fromtest/helper/userEventSetup.tswhen creating userEvent instances
When testing tooltips on hover, usevi.runOnlyPendingTimers()after eachuserEvent.hover()call or use theshowTooltiphelper function fromtooltipTestHelpers.tsto account for requestAnimationFrame delays
Files:
test/component/Legend.spec.tsxtest/component/Legend.itemSorter.spec.tsx
🧠 Learnings (15)
📓 Common learnings
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6659
File: www/src/components/GuideView/Performance/index.tsx:232-250
Timestamp: 2025-11-19T14:08:01.728Z
Learning: In Recharts version 3.4.2, object-as-prop optimizations were introduced to reduce unnecessary re-renders when new object references are passed as props. This affects the recommendation for the `react-perf/jsx-no-new-object-as-prop` ESLint rule.
📚 Learning: 2025-12-14T13:58:49.197Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:49.197Z
Learning: In the recharts codebase, hooks like useAppSelector and other hooks (e.g., useChartLayout()) return undefined when used outside Redux Provider context, instead of throwing. This enables components that call these hooks, such as Curve, to operate in standalone mode by falling back to prop values. During code reviews, ensure TSX files gracefully handle undefined results from hooks and implement fallbacks (e.g., via default props or explicit prop-based values) rather than assuming the hook is always within Provider.
Applied to files:
src/cartesian/Area.tsxsrc/chart/PieChart.tsxsrc/component/Tooltip.tsxsrc/cartesian/Bar.tsxsrc/cartesian/Scatter.tsxsrc/polar/PolarGrid.tsxsrc/component/Label.tsxsrc/component/LabelList.tsxsrc/cartesian/Line.tsxsrc/polar/PolarRadiusAxis.tsxsrc/chart/RechartsWrapper.tsxsrc/polar/RadialBar.tsxsrc/chart/SunburstChart.tsxsrc/polar/PolarAngleAxis.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Legend.tsxsrc/component/Customized.tsxsrc/polar/Radar.tsxsrc/polar/Pie.tsx
📚 Learning: 2025-11-23T13:30:10.395Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.
Applied to files:
src/component/Tooltip.tsxwww/src/docs/api/PieChartAPI.tsxsrc/chart/RechartsWrapper.tsxsrc/util/types.tssrc/chart/types.tssrc/chart/SunburstChart.tsxwww/src/docs/api/index.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : When testing tooltips on hover, use `vi.runOnlyPendingTimers()` after each `userEvent.hover()` call or use the `showTooltip` helper function from `tooltipTestHelpers.ts` to account for requestAnimationFrame delays
Applied to files:
src/component/Tooltip.tsx
📚 Learning: 2025-12-14T13:58:58.361Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:58.361Z
Learning: In the recharts codebase, `useAppSelector` and hooks like `useChartLayout()` are designed to return `undefined` when used outside Redux Provider context, rather than throwing errors. This allows components like `Curve` that call these hooks to work standalone by falling back to prop values.
Applied to files:
omnidoc/cross-component-prop-comments.spec.tswww/src/docs/api/LegendAPI.tsxwww/src/docs/api/index.ts
📚 Learning: 2025-12-16T08:12:13.355Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6783
File: test/util/ChartUtils.spec.tsx:15-16
Timestamp: 2025-12-16T08:12:13.355Z
Learning: In the recharts codebase, files in the `test` folder are allowed to import from internal paths (e.g., `../../src/state/cartesianAxisSlice`) and do not need to use the public API entry point (`src/index.ts`). The public API import restriction applies only to non-test code.
Applied to files:
omnidoc/cross-component-prop-comments.spec.tsomnidoc/readProject.spec.tswww/src/docs/api/PieChartAPI.tsxsrc/util/types.tswww/src/docs/api/index.ts
📚 Learning: 2025-11-19T14:08:01.728Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6659
File: www/src/components/GuideView/Performance/index.tsx:232-250
Timestamp: 2025-11-19T14:08:01.728Z
Learning: In Recharts version 3.4.2, object-as-prop optimizations were introduced to reduce unnecessary re-renders when new object references are passed as props. This affects the recommendation for the `react-perf/jsx-no-new-object-as-prop` ESLint rule.
Applied to files:
omnidoc/cross-component-prop-comments.spec.tssrc/chart/RechartsWrapper.tsxsrc/util/types.tssrc/chart/SunburstChart.tsxsrc/component/Customized.tsx
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to test/component/**/*.spec.tsx : Use React Testing Library for testing component interactions and behavior upon rendering
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Verify the number of selector calls using the spy object from `createSelectorTestCase` to spot unnecessary re-renders and improve performance
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Prefer to use the `createSelectorTestCase` helper function when writing or modifying tests
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-12-16T08:12:06.809Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6783
File: test/util/ChartUtils.spec.tsx:15-16
Timestamp: 2025-12-16T08:12:06.809Z
Learning: In tests (files under any test directory, e.g., test/, __tests__/, etc.), allow importing internal module paths (e.g., ../../src/...) and do not require imports to use the public API entry point (src/index.ts). The public API import restriction should apply only to non-test code. During reviews, accept internal imports in test files and enforce the public API pattern only for non-test code.
Applied to files:
test/component/Legend.spec.tsxtest/component/Legend.itemSorter.spec.tsx
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All imports from `recharts` must use the public API entry point; imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed
Applied to files:
www/src/docs/api/PieChartAPI.tsxsrc/chart/RechartsWrapper.tsxsrc/util/types.tswww/src/docs/api/index.ts
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to storybook/stories/**/*.stories.tsx : Update Storybook stories when APIs have been changed to ensure they work as expected
Applied to files:
omnidoc/omnidoc.spec.ts
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to storybook/stories/**/*.stories.tsx : Use Storybook for smoke tests and add play functions with assertions for actual tests
Applied to files:
omnidoc/omnidoc.spec.ts
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Applies to **/storybook/**/*.stories.{ts,tsx} : When adding new Storybook stories, prioritize high fidelity examples intended for publication on the website and in Storybook UI; use unit tests or VR tests for low fidelity tests
Applied to files:
omnidoc/omnidoc.spec.ts
🧬 Code graph analysis (15)
www/src/docs/api/CustomizedAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-28)
www/src/docs/api/LabelListAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-28)
omnidoc/componentsAndDefaultPropsMap.ts (1)
src/component/Label.tsx (1)
defaultLabelProps(607-613)
omnidoc/readProject.spec.ts (1)
test/helper/assertNotNull.ts (1)
assertNotNull(1-5)
www/src/docs/api/PieAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-28)
src/component/LabelList.tsx (1)
src/component/Label.tsx (1)
LabelFormatter(75-75)
www/src/docs/api/LegendAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-28)
www/src/docs/api/PieChartAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-28)
src/chart/RechartsWrapper.tsx (1)
src/chart/types.ts (1)
ExternalMouseEvents(8-53)
src/util/types.ts (2)
src/chart/types.ts (1)
ExternalMouseEvents(8-53)src/synchronisation/types.ts (1)
SyncMethod(37-37)
src/component/DefaultLegendContent.tsx (1)
src/util/types.ts (2)
LegendType(81-92)CartesianLayout(50-50)
src/component/Legend.tsx (1)
src/component/DefaultLegendContent.tsx (2)
Props(122-123)VerticalAlignmentType(23-23)
omnidoc/omnidoc.spec.ts (1)
omnidoc/generateApiDoc.ts (1)
OMNIDOC_AUTOMATED_API_DOCS_COMPONENTS(24-39)
omnidoc/generateApiDoc.ts (2)
omnidoc/readProject.ts (1)
getTagText(27-37)www/src/docs/api/types.ts (1)
ApiProps(10-19)
src/polar/Pie.tsx (2)
src/util/types.ts (5)
ActiveShape(1110-1115)AnimationDuration(648-648)AnimationTiming(646-646)DataKey(65-65)LegendType(81-92)src/index.ts (4)
PieSectorDataItem(61-61)DataKey(121-121)PieLabel(59-59)LegendType(121-121)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build, Test, Pack
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (62)
src/component/Tooltip.tsx (1)
182-185: LGTM! Documentation enhancement aligns with PR objectives.The JSDoc annotation clearly documents the contexts consumed by this component, improving code maintainability and developer experience.
src/chart/SunburstChart.tsx (2)
86-89: LGTM! Consistent JSDoc formatting.The added space before the closing
*/improves consistency with standard JSDoc formatting conventions.
367-376: LGTM! Valid refactor removing unnecessary fragment.The React fragment wrapper is unnecessary here since
Surfacealready accepts multiple children (alongsideLayerat line 366). Removing it simplifies the component structure without any functional impact..github/workflows/ci.yml (1)
201-206: Configuration is correct and fully compatible.pnpm version 10.x requires Node.js at least v18.12, and the workflow uses Node.js 24.x, which exceeds this requirement. pnpm v10.24.0 is the latest stable release, and the combination has no known compatibility issues. The pnpm installation step is well-positioned, correctly configured with caching, and ready to proceed.
src/polar/PolarGrid.tsx (1)
165-168: LGTM!The
@consumes PolarViewBoxContextannotation accurately documents the component's dependency on the polar view box context, as evidenced by theuseAppSelector(selectPolarViewBox)call at line 181. This aligns with the pattern being applied across other polar components in this PR.src/polar/PolarRadiusAxis.tsx (1)
238-241: LGTM!The
@consumes PolarViewBoxContextannotation correctly documents that this component depends on the polar view box context. The actual consumption happens inPolarRadiusAxisWrapperviauseAppSelector(selectPolarViewBox)at line 208, and documenting it on the public export is the appropriate approach.src/cartesian/Scatter.tsx (3)
209-226: LGTM!The documentation for the
lineprop is clear and comprehensive, with good examples and cross-references to thelineTypeprop and external documentation.
268-275: LGTM!The enhanced description for
activeShapenow clearly explains the various activation triggers (mouse hover, touch, keyboard, programmatic), which improves API documentation clarity.
289-299: LGTM!The new public
hideprop is well-documented with clear explanation of its behavior regarding Legend visibility and axis domain calculations. The documentation is consistent with the same prop added toArea.tsxand aligns with the existing internal handling at line 152.src/cartesian/Area.tsx (1)
196-206: LGTM!The new public
hideprop is properly documented with a clear explanation of the difference between hiding and removing an element. The documentation is consistent with the same prop added toScatter.tsx, and the prop correctly defaults tofalseas defined indefaultAreaPropsat line 855. The existing internal handling at line 794 already respects this prop.src/polar/RadialBar.tsx (1)
658-661: LGTM!The JSDoc annotations accurately document the context relationships. RadialBar provides
LabelListContextviaPolarLabelListContextProviderand consumes polar chart context through Redux selectors.src/polar/Radar.tsx (1)
572-575: LGTM!The JSDoc accurately documents the context relationships. Note that Radar provides
CartesianLabelListContext(notPolarLabelListContext), but using the generic term "LabelListContext" appropriately abstracts this implementation detail.src/cartesian/Bar.tsx (1)
180-188: LGTM!The enhanced documentation clearly explains the difference between hiding and removing elements, and appropriately references the
includeHiddenprop for axis domain calculations. This is helpful for users understanding the behavior.src/component/LabelList.tsx (2)
82-86: LGTM!The documentation improvement clarifies that the content function is called once per item, which is helpful for understanding the rendering behavior.
111-121: Documentation is correct—no changes needed.The documented default value of 2000 matches
DefaultZIndexes.label, which is set to 2000 in src/zIndex/DefaultZIndexes.tsx line 80 and used as the default in LabelList.tsx line 179.omnidoc/componentsAndDefaultPropsMap.ts (1)
52-52: The mapping of LabelList todefaultLabelPropsis correct and intentional. LabelList accepts the same props as Label (angle,offset,position,textBreakAll,zIndex) and shares the same default values. The LabelList component internally manages how these defaults are applied—it wraps its content in a ZIndexLayer using the provided zIndex, then renders individual Label components withzIndex={0}to avoid portaling. No separatedefaultLabelListPropsis needed.src/component/Label.tsx (1)
85-87: Formatter and zIndex docs look good; please verify default consistencyThe new formatter description matches the existing
getLabelbehavior, and the expandedzIndexblock correctly explains layering and portal behavior forLabel. The only thing to double‑check is thatDefaultZIndexes.labelreally is2000, so the documented@defaultValue 2000stays in sync with the actual default.Also applies to: 138-147
www/src/docs/api/ScatterAPI.tsx (3)
13-16: Clarified activeShape activation descriptionThe updated
activeShapedescription correctly captures the various activation mechanisms (hover, touch, keyboard, programmatic) and matches how Scatter behaves in charts.
95-112: hide prop documentation matches component semanticsThe new
hideprop entry clearly explains that it hides the graphical element while keeping it in the Legend and (optionally) axis domain calculations viaincludeHiddenon axes. This aligns well with the broader hide semantics used across components.
196-196: Minor copy fix for line prop descriptionChanging “Options"” to “Options:” improves readability and avoids the stray quote; no further changes needed.
src/polar/PolarAngleAxis.tsx (1)
325-327: Context-consumption annotation is accurateThe
@consumes PolarViewBoxContextJSDoc accurately reflects thatPolarAngleAxisdepends on the polar view box from shared state/context, and brings this file in line with other annotated components.src/chart/RechartsWrapper.tsx (1)
31-52: Simplified RechartsWrapperProps to extend ExternalMouseEvents directlyUsing
ExternalMouseEvents & { ... }now relies on the handlers being optional inExternalMouseEvents, which matches the implementation and removes the extraNullable<>indirection. This keeps the public prop type accurate without changing runtime behavior.src/cartesian/Line.tsx (1)
196-203: hide JSDoc now accurately reflects legend and axis behaviorThe expanded
hidedocumentation matches howLinebehaves: the graphical element is not rendered whenhideis true, yet the legend entry remains (marked inactive) and axis-domain participation is controlled viaincludeHiddenon X/Y axes. No code changes needed.test/component/Legend.spec.tsx (1)
435-512: Tests correctly assert inactiveColor in Legend content propsUpdating the expectations to include
inactiveColor: '#ccc'in the arguments passed to function/Componentcontentensures the new Legend default is covered and that custom content can rely on this prop being present. The rest of the payload shape is unchanged.Also applies to: 780-858
test/component/Legend.itemSorter.spec.tsx (1)
58-137: Legend.itemSorter tests now cover inactiveColor in content propsIncluding
inactiveColor: '#ccc'in the expected Legend content props for both default sorting anditemSorter="dataKey"keeps these tests aligned with the new Legend default props and validates that custom content receives the inactive color as part of its inputs.Also applies to: 152-232
www/src/docs/api/LineAPI.tsx (1)
146-151: Expanded Line.hide API docs align with component behaviorThe updated
hidedescription on the Line API page matches the JSDoc inLine.tsxand correctly explains Legend visibility and axis-domain implications viaincludeHiddenon axes. This keeps the public docs consistent with runtime semantics.www/src/docs/api/types.ts (1)
18-18: LGTM! Type extension supports richer deprecation metadata.The change from
booleantoboolean | stringis backward compatible and enables deprecation messages with explanatory text. The implementation inwww/src/views/APIViewNew.tsxcorrectly handles both types usingtypeofchecks.Also applies to: 27-27
src/chart/PieChart.tsx (1)
19-19: Good addition for API documentation clarity.The
@provides PolarChartContextannotation documents the context relationship, improving the generated API docs and helping developers understand component context consumption/provision patterns.omnidoc/readProject.spec.ts (2)
19-19: LGTM! Correctly includes newly documented component.Adding 'Customized' to the expected components list aligns with the PR's objective to document this component, even though it's deprecated.
1006-1030: Comprehensive test coverage for new deprecation features.The new tests appropriately verify:
- Component-level JSDoc and deprecation metadata reading
- Prop-level deprecation tag handling
- Correct primitive default value processing (without string wrappers)
The tests are well-structured and align with the expanded API documentation surface.
www/src/views/APIViewNew.tsx (2)
60-64: Prop deprecation message rendering is correct.The type guard correctly checks for string deprecation values. Note that when
deprecatedistrue(boolean), only the@deprecatedlabel is shown (line 58) without an explanatory message. This is a reasonable design choice since the boolean form typically indicates "check the docs" rather than providing inline explanation.
209-213: Component deprecation notice correctly handles both boolean and string types.The implementation properly:
- Checks for any truthy
deprecatedvalue- Provides a fallback message when
deprecated === true- Uses the custom deprecation message when it's a string
www/src/docs/api/AreaAPI.tsx (1)
139-156: Excellent documentation for the hide prop.The description clearly explains:
- What hiding does (hides graphical element)
- Important nuances (still visible in Legend)
- Related functionality (includeHidden on axes)
This will help developers understand the distinction between hiding and removing elements.
omnidoc/cross-component-prop-comments.spec.ts (4)
51-51: Appropriate exception for Legend's height/width props.Legend's height and width refer to the legend container dimensions, which have different semantics than chart dimensions. This exception prevents false positives in cross-component consistency checks.
Also applies to: 56-56
75-79: Correct exception for Legend's layout prop.Legend's layout prop controls internal item arrangement (horizontal/vertical), which differs semantically from chart layout props. The exception is well-justified.
121-125: Valid exceptions for Pie component's unique props.Both exceptions are justified:
- Pie's label implementation is unique due to arc positioning requirements
- Pie's shape receives activeIndex for active slice highlighting, unlike other components
Also applies to: 137-140
127-135: Well-justified exceptions for cx/cy and content props.Both exceptions document genuine behavioral differences:
- Dot and SunburstChart's cx/cy don't support percentage values (unlike other components)
- Label's content function is called once per Label (not once per data point like other components)
Also applies to: 142-145
www/src/docs/api/LegendAPI.tsx (3)
3-31: Well-structured Legend API documentation.The align prop documentation is particularly clear, explaining:
- Each alignment option's behavior
- How it affects chart dimensions
- Interaction with verticalAlign prop
This follows best practices for API documentation.
34-65: Good documentation with helpful examples.The content and formatter props are clearly explained with practical examples. The CodeSandbox link in the formatter's format field provides valuable interactive documentation.
117-134: Excellent itemSorter documentation with important behavioral note.The documentation clearly explains:
- Default sorting behavior (by value/label)
- Custom sorting options (dataKey, value, or function)
- Critical warning about using
nulland potential render order instabilityThe parentComponents list appropriately includes all chart types that support Legend.
Also applies to: 419-419
omnidoc/omnidoc.spec.ts (1)
20-25: LGTM! Smart test optimization.Filtering auto-generated components from consistency tests makes sense since they're generated directly from the project source and are guaranteed to match. This reduces test noise while maintaining coverage for manually maintained API docs.
Also applies to: 68-73, 176-182
www/src/docs/api/CustomizedAPI.tsx (1)
3-32: LGTM! Clear deprecation documentation.The API documentation for the deprecated Customized component is well-structured with:
- Clear migration guidance (Before/After examples)
- Consistent deprecation messages at both prop and component levels
- Explicit mention of removal timeline (version 4.0)
www/src/docs/api/LabelAPI.tsx (1)
144-161: LGTM! Comprehensive zIndex documentation.The new zIndex prop is well-documented with:
- Clear description of behavior and rendering order
- Appropriate default value (2000)
- Link to the zIndex guide for further reference
src/component/Customized.tsx (1)
12-17: LGTM! Consistent deprecation documentation.The JSDoc deprecation tags are well-written with:
- Clear explanation of why the component is no longer needed
- Before/After migration examples
- Explicit deprecation timeline (removal in 4.0)
This aligns perfectly with the API documentation in CustomizedAPI.tsx.
Also applies to: 22-29
www/src/docs/api/PieChartAPI.tsx (1)
3-277: LGTM! Comprehensive PieChart API documentation.The API documentation is thorough and well-structured with:
- Complete prop coverage including data, dimensions, margins, and event handlers
- Detailed descriptions for key props (data, height, width, responsive, syncId, syncMethod)
- Appropriate default values specified
- Correct parent-child component relationships documented
www/src/docs/api/LabelListAPI.tsx (1)
3-165: LGTM! Well-documented LabelList API.The API documentation is comprehensive with:
- Detailed descriptions for key props (dataKey, content, valueAccessor)
- Clear explanation of prop interactions (e.g., dataKey vs valueAccessor)
- Consistent zIndex documentation matching Label component
- Accurate parent component relationships
www/src/docs/api/PieAPI.tsx (3)
7-25: Good: activeShape deprecation is clearly documented.The deprecation message provides clear migration guidance to use the
shapeprop withisActiveinstead.
150-167: Excellent hide prop documentation.The description clearly explains the difference between hiding an element (still in Legend, can affect axis domain) versus removing it entirely. This nuance is important for users to understand.
3-673: LGTM! Comprehensive Pie API documentation.The API documentation is thorough with:
- Complete prop coverage including shape, data, angles, radii, labels, and extensive event handlers
- Clear deprecation guidance for activeShape and inactiveShape
- Detailed descriptions for complex props (label, labelLine, hide)
- Accurate parent-child component relationships
omnidoc/generateApiDoc.ts (3)
24-39: LGTM! Expanded automated component list.The addition of Customized, LabelList, Legend, Pie, and PieChart to the automated generation list aligns with the PR objectives.
243-266: Excellent deprecation extraction logic.The implementation correctly:
- Prefers deprecation metadata from recharts-origin props over DOM/inherited props
- Falls back to checking all prop metadata sources if needed
- Returns the deprecation text if available, or
trueif only the tag existsThis ensures accurate deprecation information even for props that may be inherited or overridden.
356-359: LGTM! Complete deprecation support.The implementation properly handles deprecation at both levels:
- Component-level: extracted from component JSDoc and included in ApiDoc
- Prop-level: extracted from prop JSDoc and included in ApiProps
- Both are correctly serialized to the generated output
The type safety is maintained with explicit
string | boolean | undefinedtyping.Also applies to: 431-433, 456-458
src/util/types.ts (1)
1143-1200: Good consolidation of shared chart props intoBaseChartProps.This refactoring eliminates duplication between
CartesianChartPropsandPolarChartPropsby extracting common properties into a shared base interface. The JSDoc documentation is thorough and helpful.Also applies to: 1202-1202, 1257-1257
src/component/Legend.tsx (2)
96-145: Well-documented Props type with clear JSDoc annotations.The Props type correctly omits
verticalAlignfromDefaultLegendContentPropsto re-declare it with a different default value (bottomvsmiddle). The JSDoc documentation clearly explains the behavior of each alignment option.
186-198: LGTM!The
inactiveColordefault is consistent withDefaultLegendContent, and the@consumesannotations provide useful metadata for documentation generation.www/src/docs/api/index.ts (1)
56-111: LGTM!The export mappings correctly wire the new API documentation modules for PieChart, Legend, LabelList, Customized, and Pie.
src/component/DefaultLegendContent.tsx (2)
44-120: Comprehensive JSDoc documentation forDefaultLegendContentProps.The documentation clearly explains each prop's purpose, includes practical examples, and links to external demos. The
@defaultValueannotations properly match the actual defaults indefaultLegendContentDefaultProps.
137-154: LGTM!The
iconTypeparameter correctly usesLegendType | undefined, and the component properly handles the'none'case at line 152-154 after the nullish coalescing fallback.src/chart/types.ts (1)
8-53: LGTM - Making event handlers optional aligns with practical usage.All event handlers in
ExternalMouseEventsare now optional, which matches how users actually consume the API (providing only the handlers they need). This is a backward-compatible relaxation of the type constraint.src/polar/Pie.tsx (3)
68-103: LGTM! Excellent documentation for PieDef properties.The TSDoc comments clearly explain each property's purpose, including how percentage values are calculated and providing helpful examples with links.
287-310: Excellent comprehensive documentation forlabelandlabelLineprops.The documentation thoroughly explains the different ways to use these props (boolean, object, ReactElement, function), provides clear examples, and links to live demonstrations. This will greatly improve the developer experience.
995-998: LGTM! Clear context consumption and provision annotations.The
@consumesand@providesannotations clearly document the component's context dependencies and what it provides to child components. This aligns with the implementation wherePolarLabelListContextProvideris used (lines 816-819).
| /* | ||
| * CartesianAxis, Cell, Customized are deprecated and will be removed in 4.0 | ||
| * so I will not put effort into documenting them. | ||
| */ |
There was a problem hiding this comment.
Update comment to reflect that Customized is now documented.
The comment states "I will not put effort into documenting them," but the PR actually adds documentation for Customized (as stated in PR objectives and verified by tests in omnidoc/readProject.spec.ts lines 1006-1025). Consider updating the comment to clarify that Customized has been documented despite its deprecated status, or simply remove Customized from the comment.
🤖 Prompt for AI Agents
omnidoc/componentsWithInconsistentCommentsInApiDoc.ts around lines 6-9: the
block comment currently lists "CartesianAxis, Cell, Customized are deprecated
and will be removed in 4.0 so I will not put effort into documenting them," but
the PR adds documentation for Customized; update the comment to reflect that
Customized is documented (or remove Customized from the
deprecated-and-not-documented list). Edit the comment to either remove
"Customized" from the list or rephrase to explicitly note "Customized is
documented despite deprecation," keeping the rest of the comment unchanged.
| /** | ||
| * The customized event handler of mousedown on the sectors in this group. | ||
| */ | ||
| onMouseDown?: (data: any, index: number, e: React.MouseEvent) => void; | ||
| /** | ||
| * The customized event handler of mouseup on the sectors in this group. | ||
| */ | ||
| onMouseUp?: (data: any, index: number, e: React.MouseEvent) => void; | ||
| /** | ||
| * The customized event handler of mousemove on the sectors in this group. | ||
| */ | ||
| onMouseMove?: (data: any, index: number, e: React.MouseEvent) => void; | ||
| /** | ||
| * The customized event handler of mouseover on the sectors in this group. | ||
| */ | ||
| onMouseOver?: (data: any, index: number, e: React.MouseEvent) => void; | ||
| /** | ||
| * The customized event handler of mouseout on the sectors in this group. | ||
| */ | ||
| onMouseOut?: (data: any, index: number, e: React.MouseEvent) => void; |
There was a problem hiding this comment.
Replace any type with PieSectorDataItem in new event handler signatures.
The newly added event handlers (onMouseDown, onMouseUp, onMouseMove, onMouseOver, onMouseOut) use any for the data parameter, which violates the coding guideline prohibiting any types. The PieSectorDataItem type (defined at lines 178-182) is the appropriate type for sector data passed to these handlers.
As per coding guidelines, prefer unknown over any, or better yet, use the specific type PieSectorDataItem that already exists in this codebase.
Apply this diff to fix the type signatures:
/**
* The customized event handler of mousedown on the sectors in this group.
*/
- onMouseDown?: (data: any, index: number, e: React.MouseEvent) => void;
+ onMouseDown?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void;
/**
* The customized event handler of mouseup on the sectors in this group.
*/
- onMouseUp?: (data: any, index: number, e: React.MouseEvent) => void;
+ onMouseUp?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void;
/**
* The customized event handler of mousemove on the sectors in this group.
*/
- onMouseMove?: (data: any, index: number, e: React.MouseEvent) => void;
+ onMouseMove?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void;
/**
* The customized event handler of mouseover on the sectors in this group.
*/
- onMouseOver?: (data: any, index: number, e: React.MouseEvent) => void;
+ onMouseOver?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void;
/**
* The customized event handler of mouseout on the sectors in this group.
*/
- onMouseOut?: (data: any, index: number, e: React.MouseEvent) => void;
+ onMouseOut?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void;Note: The existing onClick, onMouseEnter, and onMouseLeave handlers also use any and could benefit from the same fix, though they may have existed prior to this PR.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /** | |
| * The customized event handler of mousedown on the sectors in this group. | |
| */ | |
| onMouseDown?: (data: any, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseup on the sectors in this group. | |
| */ | |
| onMouseUp?: (data: any, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mousemove on the sectors in this group. | |
| */ | |
| onMouseMove?: (data: any, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseover on the sectors in this group. | |
| */ | |
| onMouseOver?: (data: any, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseout on the sectors in this group. | |
| */ | |
| onMouseOut?: (data: any, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mousedown on the sectors in this group. | |
| */ | |
| onMouseDown?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseup on the sectors in this group. | |
| */ | |
| onMouseUp?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mousemove on the sectors in this group. | |
| */ | |
| onMouseMove?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseover on the sectors in this group. | |
| */ | |
| onMouseOver?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void; | |
| /** | |
| * The customized event handler of mouseout on the sectors in this group. | |
| */ | |
| onMouseOut?: (data: PieSectorDataItem, index: number, e: React.MouseEvent) => void; |
🤖 Prompt for AI Agents
In src/polar/Pie.tsx around lines 341 to 360, the event handler signatures
currently use the `any` type for the `data` parameter; replace `any` with the
existing `PieSectorDataItem` type for `onMouseDown`, `onMouseUp`, `onMouseMove`,
`onMouseOver`, and `onMouseOut`. Update their signatures to `(data:
PieSectorDataItem, index: number, e: React.MouseEvent) => void` and also
consider changing `onClick`, `onMouseEnter`, and `onMouseLeave` to use
`PieSectorDataItem` for consistency. Ensure imports/types remain valid and run
TypeScript checks after the change.
There was a problem hiding this comment.
Since it's been there on the other handlers as well, I will look into this in the next PR
There was a problem hiding this comment.
@PavelVanecek, thank you for acknowledging this! That makes sense to fix all the event handler types together in a comprehensive update.
Would you like me to create a GitHub issue to track this type safety improvement for all the Pie event handlers?
🧠 Learnings used
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6750
File: src/state/selectors/axisSelectors.ts:593-602
Timestamp: 2025-12-08T08:23:26.261Z
Learning: In the recharts codebase, `DataKey<any>` is an intentional exception to the "no any" rule while proper typing is being developed. This should not be flagged in reviews.
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to **/*.{ts,tsx} : Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to **/*.{ts,tsx} : Prefer `unknown` over `any` and refine the type in TypeScript
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to **/*.{ts,tsx} : Never use `any` type (implicit or explicit) in TypeScript code
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6787 +/- ##
==========================================
+ Coverage 93.75% 93.83% +0.08%
==========================================
Files 518 518
Lines 44094 44781 +687
Branches 5035 5037 +2
==========================================
+ Hits 41340 42021 +681
- Misses 2747 2753 +6
Partials 7 7 ☔ 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 |
| <code>number</code>: the index of the field in the data; | ||
| </li> | ||
| <li> | ||
| <code>function</code>: a function that receives the data object and returns the value of each label. |
There was a problem hiding this comment.
eventually would be nice to add support for what the types look like for functions I think
There was a problem hiding this comment.
I was looking for balance here, between information and too much detail. Whoever is interested in the exact type can open the IDE and hover over the prop.
|
some build errors? |
|
I fixed those yesterday in the other PR. I was too lazy to rerun build here, I'm positive it will pass. |
|
Also saving chromatic tokens 😅 |
Description
Also adds the "Deprecated" tag to the website, where used. And deprecates Customized component.
Also fixes builds (pnpm was missing from this repository CI script).
Related Issue
#6734
#6069
Summary by CodeRabbit
New Features
hideproperty to chart elements (Area, Bar, Line, Scatter, Pie) to control visibility while maintaining legend and axis impact.zIndexproperty to labels for explicit layer control.Deprecations
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.