Conversation
|
Warning Rate limit exceeded@PavelVanecek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 26 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughRestructures API documentation generation and docs (migrating .ts → .tsx ApiDoc files), expands and tightens several component public props (Tooltip, Legend, Sector, Trapezoid, Treemap, Funnel), refines omnidoc exceptions and tests, adds ResponsiveContainerContext JSDoc annotations, wraps SunburstChart with a store/tooltip portal, and updates CI to echo deployment URLs. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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 |
2a5a89e to
2753003
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
www/src/docs/api/TreemapAPI.tsx (1)
66-66: Incomplete type annotation for colorPanel.The type
'Array<>'appears incomplete or malformed. Consider specifying the element type, such as'Array<string>'for color values.🔎 Proposed fix
- { name: 'colorPanel', type: 'Array<>', isOptional: true }, + { name: 'colorPanel', type: 'Array<string>', isOptional: true },omnidoc/commentSimilarityExceptions.ts (1)
173-176: Consider removing informal comment.The reason text
'like why? these should be consistent omg'is informal for production code. While it expresses a valid concern, consider rephrasing to something more neutral like'Tooltip itemSorter has different default behavior than Legend itemSorter (historical inconsistency)'.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (49)
.github/workflows/ci.ymlomnidoc/commentSimilarityExceptions.tsomnidoc/componentsWithInconsistentCommentsInApiDoc.tsomnidoc/generateApiDoc.spec.tsomnidoc/generateApiDoc.tsomnidoc/omnidoc.spec.tssrc/cartesian/Brush.tsxsrc/cartesian/Funnel.tsxsrc/chart/AreaChart.tsxsrc/chart/BarChart.tsxsrc/chart/ComposedChart.tsxsrc/chart/FunnelChart.tsxsrc/chart/LineChart.tsxsrc/chart/PieChart.tsxsrc/chart/RadarChart.tsxsrc/chart/RadialBarChart.tsxsrc/chart/Sankey.tsxsrc/chart/ScatterChart.tsxsrc/chart/SunburstChart.tsxsrc/chart/Treemap.tsxsrc/component/DefaultLegendContent.tsxsrc/component/Label.tsxsrc/component/LabelList.tsxsrc/component/Legend.tsxsrc/component/ResponsiveContainer.tsxsrc/component/Tooltip.tsxsrc/shape/Sector.tsxsrc/shape/Trapezoid.tsxtest/cartesian/Funnel.spec.tsxwww/src/docs/api/BrushAPI.tsxwww/src/docs/api/FunnelAPI.tsxwww/src/docs/api/LabelAPI.tsxwww/src/docs/api/LabelListAPI.tsxwww/src/docs/api/LegendAPI.tsxwww/src/docs/api/PieChartAPI.tsxwww/src/docs/api/RadarChartAPI.tsxwww/src/docs/api/RadialBarChartAPI.tsxwww/src/docs/api/ResponsiveContainerAPI.tsxwww/src/docs/api/SankeyAPI.tsxwww/src/docs/api/Sector.tswww/src/docs/api/SectorAPI.tsxwww/src/docs/api/Tooltip.tswww/src/docs/api/TooltipAPI.tsxwww/src/docs/api/Trapezoid.tswww/src/docs/api/TrapezoidAPI.tsxwww/src/docs/api/Treemap.tswww/src/docs/api/TreemapAPI.tsxwww/src/docs/api/index.tswww/src/docs/exampleComponents/ComposedChart/BandedChart.tsx
💤 Files with no reviewable changes (5)
- www/src/docs/api/Tooltip.ts
- www/src/docs/api/Trapezoid.ts
- www/src/docs/api/Treemap.ts
- omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
- www/src/docs/api/Sector.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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 constAll imports from
rechartsmust use the public API entry point (e.g.,import { TooltipIndex } from 'recharts'). Imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed and will fail the linter.
Files:
src/component/ResponsiveContainer.tsxsrc/chart/Sankey.tsxwww/src/docs/api/PieChartAPI.tsxwww/src/docs/api/BrushAPI.tsxwww/src/docs/api/RadialBarChartAPI.tsxsrc/component/Label.tsxomnidoc/generateApiDoc.spec.tssrc/chart/PieChart.tsxsrc/chart/BarChart.tsxsrc/chart/FunnelChart.tsxwww/src/docs/api/ResponsiveContainerAPI.tsxsrc/cartesian/Brush.tsxwww/src/docs/api/TrapezoidAPI.tsxsrc/chart/RadialBarChart.tsxsrc/chart/ComposedChart.tsxwww/src/docs/api/SectorAPI.tsxsrc/component/DefaultLegendContent.tsxwww/src/docs/api/TooltipAPI.tsxsrc/cartesian/Funnel.tsxwww/src/docs/api/SankeyAPI.tsxtest/cartesian/Funnel.spec.tsxsrc/chart/ScatterChart.tsxsrc/component/LabelList.tsxwww/src/docs/api/RadarChartAPI.tsxwww/src/docs/api/FunnelAPI.tsxsrc/chart/RadarChart.tsxomnidoc/omnidoc.spec.tsomnidoc/commentSimilarityExceptions.tsomnidoc/generateApiDoc.tssrc/shape/Sector.tsxsrc/shape/Trapezoid.tsxsrc/chart/SunburstChart.tsxsrc/component/Legend.tsxsrc/chart/LineChart.tsxwww/src/docs/exampleComponents/ComposedChart/BandedChart.tsxwww/src/docs/api/LegendAPI.tsxsrc/component/Tooltip.tsxsrc/chart/AreaChart.tsxsrc/chart/Treemap.tsxwww/src/docs/api/TreemapAPI.tsxwww/src/docs/api/LabelAPI.tsxwww/src/docs/api/LabelListAPI.tsxwww/src/docs/api/index.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Ensure code lints by running
npm run lintand follows Airbnb's Style Guide
Files:
src/component/ResponsiveContainer.tsxsrc/chart/Sankey.tsxwww/src/docs/api/PieChartAPI.tsxwww/src/docs/api/BrushAPI.tsxwww/src/docs/api/RadialBarChartAPI.tsxsrc/component/Label.tsxomnidoc/generateApiDoc.spec.tssrc/chart/PieChart.tsxsrc/chart/BarChart.tsxsrc/chart/FunnelChart.tsxwww/src/docs/api/ResponsiveContainerAPI.tsxsrc/cartesian/Brush.tsxwww/src/docs/api/TrapezoidAPI.tsxsrc/chart/RadialBarChart.tsxsrc/chart/ComposedChart.tsxwww/src/docs/api/SectorAPI.tsxsrc/component/DefaultLegendContent.tsxwww/src/docs/api/TooltipAPI.tsxsrc/cartesian/Funnel.tsxwww/src/docs/api/SankeyAPI.tsxtest/cartesian/Funnel.spec.tsxsrc/chart/ScatterChart.tsxsrc/component/LabelList.tsxwww/src/docs/api/RadarChartAPI.tsxwww/src/docs/api/FunnelAPI.tsxsrc/chart/RadarChart.tsxomnidoc/omnidoc.spec.tsomnidoc/commentSimilarityExceptions.tsomnidoc/generateApiDoc.tssrc/shape/Sector.tsxsrc/shape/Trapezoid.tsxsrc/chart/SunburstChart.tsxsrc/component/Legend.tsxsrc/chart/LineChart.tsxwww/src/docs/exampleComponents/ComposedChart/BandedChart.tsxwww/src/docs/api/LegendAPI.tsxsrc/component/Tooltip.tsxsrc/chart/AreaChart.tsxsrc/chart/Treemap.tsxwww/src/docs/api/TreemapAPI.tsxwww/src/docs/api/LabelAPI.tsxwww/src/docs/api/LabelListAPI.tsxwww/src/docs/api/index.ts
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/component/ResponsiveContainer.tsxsrc/chart/Sankey.tsxsrc/component/Label.tsxsrc/chart/PieChart.tsxsrc/chart/BarChart.tsxsrc/chart/FunnelChart.tsxsrc/cartesian/Brush.tsxsrc/chart/RadialBarChart.tsxsrc/chart/ComposedChart.tsxsrc/component/DefaultLegendContent.tsxsrc/cartesian/Funnel.tsxsrc/chart/ScatterChart.tsxsrc/component/LabelList.tsxsrc/chart/RadarChart.tsxsrc/shape/Sector.tsxsrc/shape/Trapezoid.tsxsrc/chart/SunburstChart.tsxsrc/component/Legend.tsxsrc/chart/LineChart.tsxsrc/component/Tooltip.tsxsrc/chart/AreaChart.tsxsrc/chart/Treemap.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 testUnit tests should be placed in the
testdirectory, with some tests also allowed inwww/test. Test files follow the naming convention*.spec.tsx.
Files:
omnidoc/generateApiDoc.spec.tstest/cartesian/Funnel.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/cartesian/Funnel.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/cartesian/Funnel.spec.tsx
🧠 Learnings (15)
📓 Common learnings
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
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.
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.
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.
📚 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/component/ResponsiveContainer.tsxsrc/chart/Sankey.tsxsrc/component/Label.tsxsrc/chart/PieChart.tsxsrc/chart/BarChart.tsxsrc/chart/FunnelChart.tsxsrc/cartesian/Brush.tsxsrc/chart/RadialBarChart.tsxsrc/chart/ComposedChart.tsxsrc/component/DefaultLegendContent.tsxsrc/cartesian/Funnel.tsxsrc/chart/ScatterChart.tsxsrc/component/LabelList.tsxsrc/chart/RadarChart.tsxsrc/shape/Sector.tsxsrc/shape/Trapezoid.tsxsrc/chart/SunburstChart.tsxsrc/component/Legend.tsxsrc/chart/LineChart.tsxsrc/component/Tooltip.tsxsrc/chart/AreaChart.tsxsrc/chart/Treemap.tsx
📚 Learning: 2025-11-25T01:23:14.977Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:23:14.977Z
Learning: Applies to src/**/*.{ts,tsx} : Do not hardcode any strings or formatting choices in library code; users should provide localized strings as desired
Applied to files:
src/component/Label.tsx
📚 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:
omnidoc/generateApiDoc.spec.tstest/cartesian/Funnel.spec.tsxsrc/component/Tooltip.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/generateApiDoc.spec.tstest/cartesian/Funnel.spec.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/chart/BarChart.tsxsrc/chart/FunnelChart.tsxsrc/chart/ComposedChart.tsxwww/src/docs/api/TooltipAPI.tsxsrc/chart/ScatterChart.tsxwww/src/docs/api/FunnelAPI.tsxsrc/chart/SunburstChart.tsxsrc/chart/LineChart.tsxsrc/component/Tooltip.tsxsrc/chart/AreaChart.tsxwww/src/docs/api/index.ts
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.
Applied to files:
src/chart/ComposedChart.tsxwww/src/docs/api/TooltipAPI.tsxtest/cartesian/Funnel.spec.tsxsrc/chart/ScatterChart.tsxsrc/chart/RadarChart.tsxomnidoc/generateApiDoc.tssrc/chart/SunburstChart.tsxsrc/component/Tooltip.tsxwww/src/docs/api/index.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/cartesian/Funnel.spec.tsx
📚 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:
test/cartesian/Funnel.spec.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 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-07T01:38:46.703Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6748
File: .github/workflows/ci.yml:268-276
Timestamp: 2025-12-07T01:38:46.703Z
Learning: In the recharts/recharts repository, the staging deployment pipeline should deploy the website and VR test report even when VR tests fail, so that the HTML report can be reviewed. This requires using `if: always() && needs.build_test_pack.result == 'success' && (needs.vr_tests.result == 'success' || needs.vr_tests.result == 'failure')` in the deploy_staging job condition.
Applied to files:
.github/workflows/ci.yml
📚 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:
src/chart/SunburstChart.tsxwww/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:
src/chart/SunburstChart.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:
www/src/docs/api/index.ts
🧬 Code graph analysis (12)
www/src/docs/api/TrapezoidAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-29)
www/src/docs/api/SectorAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-29)
www/src/docs/api/TooltipAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-29)
src/cartesian/Funnel.tsx (1)
src/util/types.ts (1)
PresentationAttributesAdaptChildEvent(94-96)
test/cartesian/Funnel.spec.tsx (2)
src/cartesian/Funnel.tsx (1)
FunnelTrapezoidItem(52-62)src/index.ts (1)
FunnelTrapezoidItem(115-115)
omnidoc/omnidoc.spec.ts (2)
omnidoc/generateApiDoc.ts (1)
OMNIDOC_AUTOMATED_API_DOCS_COMPONENTS(24-64)www/src/docs/apiCates.ts (1)
apiCates(1-61)
src/shape/Sector.tsx (1)
storybook/stories/API/props/SectorProps.ts (1)
SectorProps(13-70)
src/shape/Trapezoid.tsx (1)
src/util/types.ts (2)
AnimationDuration(673-673)AnimationTiming(671-671)
src/component/Legend.tsx (2)
src/component/DefaultLegendContent.tsx (1)
ContentType(20-20)src/component/Tooltip.tsx (1)
ContentType(34-36)
src/chart/Treemap.tsx (1)
src/util/types.ts (3)
Percent(1484-1484)DataKey(90-90)AnimationDuration(673-673)
www/src/docs/api/TreemapAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-29)
www/src/docs/api/index.ts (3)
www/src/docs/api/TooltipAPI.tsx (1)
TooltipAPI(4-421)www/src/docs/api/SectorAPI.tsx (1)
SectorAPI(3-209)www/src/docs/api/TrapezoidAPI.tsx (1)
TrapezoidAPI(3-190)
⏰ 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). (1)
- GitHub Check: Build, Test, Pack
🔇 Additional comments (55)
.github/workflows/ci.yml (1)
341-343: LGTM! Good visibility improvement.These echo statements provide helpful visibility of the deployment URLs directly in the CI logs. The URL construction is correct and consistent with the PR comment logic below.
www/src/docs/api/LabelAPI.tsx (3)
1-1: LGTM! Import added for documentation linking.The
Linkimport from 'react-router' is correctly added to support cross-referencing the Text API documentation in the formatter description.
65-69: Excellent documentation improvement!This clarification helps developers understand that
formattershould return primitive values (string/number) suitable for the Text component, and directs them to thecontentprop for custom React components. The cross-reference to the Text API documentation is helpful.
106-106: Good type fix - aligns with default value.Adding
"middle"to the position type union is correct, as it aligns the type definition with the default value specified on line 115. This ensures type safety for the default position value.www/src/docs/api/SankeyAPI.tsx (1)
278-278: LGTM! Documentation metadata addition.The
parentComponentsfield clearly documents that Sankey can be used within ResponsiveContainer, improving API discoverability.test/cartesian/Funnel.spec.tsx (2)
3-3: LGTM! Correct usage of the public API.The import of
FunnelTrapezoidItemfrom the public API entry point aligns with coding guidelines and the expanded public API surface in this PR.
77-77: LGTM! Improved type safety for activeShape callback.The callback is now correctly typed with
FunnelTrapezoidItem, which provides better type information for accessing trapezoid-specific properties likex,y,height,upperWidth, etc.src/component/Label.tsx (1)
86-90: LGTM! Clear documentation enhancement.The expanded documentation clarifies the expected return type of
formatterand guides users to use thecontentprop for custom components. This will help prevent misuse of the formatter prop.src/cartesian/Funnel.tsx (1)
196-196: LGTM! Improved type safety.Narrowing
FunnelSvgPropsto useSVGPathElementinstead of the more genericSVGElementprovides better type safety for event handlers and refs, since Funnel components render<path>elements.www/src/docs/api/LabelListAPI.tsx (3)
1-1: LGTM! Enables internal documentation linking.Adding the
Linkimport from react-router enables cross-referencing the Text API in the formatter prop documentation, improving documentation navigation.
87-91: LGTM! Consistent documentation improvement.The expanded formatter documentation aligns with the changes in
Label.tsxand provides clear guidance about expected return types and alternatives for custom components.
125-125: LGTM! Position type includes "middle".The position type union now explicitly includes
"middle"as an allowed value, matching the actual implementation and default value.www/src/docs/api/FunnelAPI.tsx (1)
298-299: LGTM! Documentation cleanup.Removing deprecated metadata from
onKeyPressandonKeyPressCaptureprops aligns the documentation with the current API state.src/shape/Sector.tsx (1)
192-267: LGTM! Excellent API documentation expansion.Refactoring
SectorPropsfrom an implicit extension to an explicit interface with comprehensive JSDoc documentation significantly improves the public API surface. Key benefits:
- All properties now have clear descriptions and default values
- Event handlers are explicitly typed for
SVGPathElement- Better IDE autocomplete and documentation
- Maintains backward compatibility through
Partial<SectorProps>in the exportedPropstypeThe documentation aligns with Storybook definitions, ensuring consistency across the codebase.
src/chart/LineChart.tsx (1)
10-10: LGTM! Documentation improvement.Adding the
@consumes ResponsiveContainerContextJSDoc tag documents the component's context dependencies, improving code clarity and maintainability. This aligns with similar documentation additions across other chart components in this PR.src/chart/BarChart.tsx (1)
10-10: LGTM! Documentation annotation is consistent with the broader pattern.The
@consumes ResponsiveContainerContextannotation correctly documents that BarChart consumes the context provided by ResponsiveContainer. This aligns with the coordinated documentation updates across all chart components in this PR.src/component/ResponsiveContainer.tsx (1)
248-249: LGTM! Correctly documents context provision.The
@provides ResponsiveContainerContextannotation accurately documents that this component provides the context consumed by chart components. This complements the@consumesannotations added throughout the codebase.src/chart/RadarChart.tsx (1)
39-39: LGTM! Consistent documentation annotation.The
@consumes ResponsiveContainerContextannotation aligns with the pattern applied across all chart components in this PR.omnidoc/generateApiDoc.spec.ts (1)
100-107: LGTM! Well-structured test for inline link conversion in prop descriptions.This test appropriately verifies that inline
{@link ComponentName}tags within prop descriptions are converted to React Router<Link>elements. It complements the existing test for component-level descriptions and follows the established testing patterns.src/chart/FunnelChart.tsx (1)
10-10: LGTM! Consistent documentation annotation.The
@consumes ResponsiveContainerContextannotation aligns with the coordinated documentation updates across chart components.src/chart/PieChart.tsx (1)
18-18: LGTM! Consistent documentation annotation.The
@consumes ResponsiveContainerContextannotation follows the established pattern for documenting context consumption in chart components.www/src/docs/exampleComponents/ComposedChart/BandedChart.tsx (1)
55-55: LGTM! Correctly adapts to DefaultLegendContentProps API change.The removal of the
contentparameter from the function signature aligns with the removal of this prop fromDefaultLegendContentProps. The explicit type annotation improves type safety, and the function body continues to work correctly as it never used thecontentparameter.www/src/docs/api/BrushAPI.tsx (2)
177-180: LGTM! Helpful documentation addition about synchronization behavior.The new paragraph clearly explains that the Brush component synchronizes zooming and panning across charts that share the same
syncId. This is valuable information for users implementing synchronized charts.
184-187: LGTM! Enhanced example links provide better coverage.The expanded links array now includes both a basic Brush example and a synchronized Brush example, helping users discover and understand both use cases.
src/chart/Sankey.tsx (1)
1219-1219: LGTM: Documentation enhancementThe added JSDoc annotation clarifies that Sankey consumes ResponsiveContainerContext, which is consistent with similar documentation improvements across other chart components in this PR.
www/src/docs/api/PieChartAPI.tsx (1)
403-403: LGTM: API documentation metadataAdding
parentComponents: ['ResponsiveContainer']documents the hierarchical relationship between PieChart and ResponsiveContainer, which will improve navigation and API documentation structure.src/chart/AreaChart.tsx (1)
10-10: LGTM: Consistent documentation patternThe JSDoc annotation documents ResponsiveContainerContext consumption, maintaining consistency with other chart components.
src/chart/ScatterChart.tsx (1)
10-10: LGTM: Documentation enhancementConsistent with the pattern of documenting ResponsiveContainerContext consumption across chart components.
www/src/docs/api/RadarChartAPI.tsx (1)
403-403: LGTM: API documentation metadataDocuments the hierarchical relationship with ResponsiveContainer, consistent with similar API documentation enhancements.
src/chart/RadialBarChart.tsx (1)
18-18: LGTM: Documentation enhancementConsistent documentation of ResponsiveContainerContext consumption across chart components.
omnidoc/omnidoc.spec.ts (2)
53-59: Good addition: Navigation mapping validationThis new test ensures that every component with autogenerated API docs has a corresponding entry in
apiCates, preventing broken navigation links. This is a valuable validation that will catch documentation inconsistencies early.
46-51: Note: Skipped testThis test is skipped, which means autogenerated API docs coverage is not currently validated for all exported components. While this doesn't block the current PR, it might be worth addressing in a future iteration to ensure comprehensive API documentation coverage.
src/component/LabelList.tsx (1)
109-112: LGTM: Helpful documentation clarificationThe added documentation clearly explains what the
formatterfunction should return and provides guidance on when to use thecontentprop instead. This will help users understand the proper usage of this prop.src/chart/ComposedChart.tsx (1)
10-10: LGTM! Clear documentation of context consumption.The
@consumes ResponsiveContainerContextannotation accurately documents that this chart component consumes the ResponsiveContainer context, which helps API documentation consumers understand the component's dependencies.www/src/docs/api/ResponsiveContainerAPI.tsx (1)
190-203: LGTM! Comprehensive children components list.The
childrenComponentsarray properly documents all chart types that can be wrapped by ResponsiveContainer, enhancing the API documentation's discoverability.www/src/docs/api/RadialBarChartAPI.tsx (1)
403-403: LGTM! Proper parent component documentation.The
parentComponentsmetadata correctly documents that RadialBarChart can be wrapped by ResponsiveContainer, improving API documentation completeness.src/cartesian/Brush.tsx (1)
1052-1056: LGTM! Enhanced documentation with synchronization details.The updated documentation clearly explains that the Brush synchronizes zooming and panning when charts use
syncId, and provides helpful example links for users.www/src/docs/api/SectorAPI.tsx (1)
1-209: LGTM! Well-structured API documentation for Sector.The SectorAPI documentation is comprehensive, covering all geometric properties (cx, cy, innerRadius, outerRadius, angles, corners) and event handlers with clear descriptions and appropriate default values.
src/chart/SunburstChart.tsx (1)
381-383: LGTM! Context consumption documented.The
@consumes ResponsiveContainerContextannotation properly documents that SunburstChart consumes ResponsiveContainer context, maintaining consistency with other chart components in this PR.www/src/docs/api/TrapezoidAPI.tsx (1)
1-190: LGTM! Complete API documentation for Trapezoid.The TrapezoidAPI documentation thoroughly covers all properties including geometric dimensions (x, y, height, upperWidth, lowerWidth), animation settings, and mouse event handlers with clear descriptions and sensible defaults.
src/component/DefaultLegendContent.tsx (1)
89-92: No breaking usage found from the removal of thecontentprop from DefaultLegendContentProps.Verification confirms the
contentprop was successfully removed from the DefaultLegendContentProps interface. Search results show no code references acontentprop on DefaultLegendContent. Thecontentprop is now properly located on the Legend component itself (Legend.tsx line 45), where it callsReact.createElement(props.content as any, contentProps). The API change is complete and consistent with no orphaned references.www/src/docs/api/TooltipAPI.tsx (1)
1-421: Comprehensive Tooltip API documentation.The documentation is thorough with well-structured prop definitions, appropriate use of
Linkfor internal navigation (e.g., line 95 linking to DefaultTooltipContent), and correct parent component associations including the newly supported Treemap.www/src/docs/api/index.ts (1)
1-112: Clean API index refactor.The import and mapping updates are consistent with the new API documentation structure. Removing explicit
.tsxextensions and using the canonical*APInaming convention improves maintainability.omnidoc/generateApiDoc.ts (2)
55-59: New components added to automated API docs generation.The additions of Sector, Tooltip, Trapezoid, and Treemap to
OMNIDOC_AUTOMATED_API_DOCS_COMPONENTSalign with the PR objectives. The alphabetical ordering is maintained.
564-572: Improved link detection logic.Splitting the link detection into
hasLinkInDescandhasLinkInPropsmakes the logic clearer and correctly handles the case where Link components can appear in either component descriptions or individual prop descriptions.www/src/docs/api/TreemapAPI.tsx (1)
1-235: Comprehensive Treemap API documentation.The documentation covers all relevant props including animation settings, data configuration, and event handlers. The parent/child component relationships correctly indicate that Treemap consumes ResponsiveContainer context and can contain a Tooltip.
www/src/docs/api/LegendAPI.tsx (2)
1-1: Enhanced content prop documentation with Link.The addition of the
Linkimport and the updatedcontentprop description clearly explains the rendering behavior and appropriately links toDefaultLegendContentfor users seeking the default implementation.Also applies to: 41-53
80-83: Improved dimension prop documentation.The updated descriptions for
heightandwidthnow clearly explain that both CSS string values (like100%orfit-content) and numeric values are accepted.Also applies to: 210-213
src/shape/Trapezoid.tsx (1)
29-95: Well-documented prop interface.The JSDoc additions for position props (
x,y), dimension props (upperWidth,lowerWidth,height), animation prop (isUpdateAnimationActive), and all mouse event handlers provide clear documentation with appropriate@defaulttags. This enables the omnidoc tool to generate accurate API documentation.omnidoc/commentSimilarityExceptions.ts (1)
161-191: Comprehensive Tooltip exception groups.The new exception groups for Tooltip correctly distinguish its unique behaviors from other components: HTML content vs SVG, array-returning formatters, different itemSorter defaults, and unique position semantics.
src/chart/Treemap.tsx (2)
1023-1028: Component-level JSDoc with context annotations.The
@consumes ResponsiveContainerContextand@provides TooltipEntrySettingsannotations enable the omnidoc tool to automatically determine parent/child component relationships, which is reflected in the generated TreemapAPI documentation.
383-396: Pre-existinganytype usage in DataKey.The
DataKey<any>type annotations follow the existing pattern fromsrc/util/types.ts, where the type is intentionally parameterized withanyas a known exception while proper typing is being developed. This is a widespread pattern in the codebase (90+ instances) and should not be flagged. The documentation additions are correct.src/component/Legend.tsx (2)
6-11: LGTM: Excellent documentation and type improvements.The addition of the
contentprop with comprehensive documentation and the import ofContentTypefromDefaultLegendContentimproves type safety and API clarity. The documentation clearly explains the three usage modes (default, React element, or function).Also applies to: 98-109
115-123: LGTM: Width and height now support CSS string values.Broadening
widthandheightto acceptnumber | stringenables CSS values like"100%"or"fit-content", which improves flexibility. The corresponding logic change ingetWidthOrHeight(line 181) fromisNumber(height)toheight != nullcorrectly handles both types.Also applies to: 177-181
src/component/Tooltip.tsx (1)
78-91: LGTM: Comprehensive documentation improvements.The extensive documentation additions across all Tooltip props significantly improve API discoverability and usability. The explicit type signatures for
formatter,itemSorter,labelFormatter, and style props make the API clearer and more maintainable.Also applies to: 104-236, 263-268
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/component/Tooltip.tsx (1)
269-269: Use HTTPS protocol for documentation links.The JSDoc link uses
http://recharts.github.iowhich can cause mixed content warnings and security issues. While the localhost URL from the previous review has been fixed, the protocol should be HTTPS.🔎 Proposed fix
- * @see {@link http://recharts.github.io/en-US/guide/activeIndex/ Active index replacement when migrating from Recharts v2 to v3} + * @see {@link https://recharts.github.io/en-US/guide/activeIndex/ Active index replacement when migrating from Recharts v2 to v3}
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/chart/Treemap.tsxsrc/component/Tooltip.tsxwww/src/docs/api/TooltipAPI.tsxwww/src/docs/api/TreemapAPI.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- www/src/docs/api/TreemapAPI.tsx
- src/chart/Treemap.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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 constAll imports from
rechartsmust use the public API entry point (e.g.,import { TooltipIndex } from 'recharts'). Imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed and will fail the linter.
Files:
www/src/docs/api/TooltipAPI.tsxsrc/component/Tooltip.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/TooltipAPI.tsxsrc/component/Tooltip.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/component/Tooltip.tsx
🧠 Learnings (5)
📓 Common learnings
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.
📚 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:
www/src/docs/api/TooltipAPI.tsxsrc/component/Tooltip.tsx
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.
Applied to files:
www/src/docs/api/TooltipAPI.tsxsrc/component/Tooltip.tsx
📚 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: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/component/Tooltip.tsx
🧬 Code graph analysis (2)
www/src/docs/api/TooltipAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-29)
src/component/Tooltip.tsx (6)
src/util/types.ts (3)
AllowInDimension(120-123)AnimationDuration(673-673)Coordinate(125-128)src/component/DefaultLegendContent.tsx (1)
ContentType(20-20)src/component/Cursor.tsx (1)
CursorDefinition(32-32)src/index.ts (1)
TooltipIndex(17-17)src/state/tooltipSlice.ts (1)
TooltipIndex(39-39)src/component/DefaultTooltipContent.tsx (1)
Payload(27-48)
⏰ 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 (4)
src/component/Tooltip.tsx (4)
104-115: LGTM: Clear documentation for content prop.The JSDoc clearly explains the three ways to use the content prop (default component, React element, or function) and includes a proper example link using HTTPS.
117-236: LGTM: Well-typed and documented prop additions.The expanded prop definitions include proper TypeScript types with explicit function signatures and clear JSDoc comments. All types are properly specified without relying on
anyor type inference, following the coding guidelines.
259-259: LGTM: Consistent default value for wrapperStyle.The addition of
wrapperStyle: {}to the defaults is consistent with other style props (contentStyle, itemStyle, labelStyle) and matches the documented default value.
78-91: LGTM: Clear JSDoc additions for animation props.The added documentation for
allowEscapeViewBox,animationDuration, andanimationEasingis clear and includes correct default values.
www/src/docs/api/TooltipAPI.tsx
Outdated
| name: 'Active index replacement when migrating from Recharts v2 to v3', | ||
| url: 'http://recharts.github.io/en-US/guide/activeIndex/', | ||
| isExternal: true, | ||
| }, |
There was a problem hiding this comment.
Use HTTPS protocol for documentation links.
The link uses http://recharts.github.io which can cause mixed content warnings if the documentation site is served over HTTPS. Modern browsers may block or warn about insecure HTTP links.
🔎 Proposed fix
{
name: 'Active index replacement when migrating from Recharts v2 to v3',
- url: 'http://recharts.github.io/en-US/guide/activeIndex/',
+ url: 'https://recharts.github.io/en-US/guide/activeIndex/',
isExternal: true,
},📝 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.
| name: 'Active index replacement when migrating from Recharts v2 to v3', | |
| url: 'http://recharts.github.io/en-US/guide/activeIndex/', | |
| isExternal: true, | |
| }, | |
| name: 'Active index replacement when migrating from Recharts v2 to v3', | |
| url: 'https://recharts.github.io/en-US/guide/activeIndex/', | |
| isExternal: true, | |
| }, |
🤖 Prompt for AI Agents
In www/src/docs/api/TooltipAPI.tsx around lines 403 to 406, the doc link uses
the insecure http:// protocol which can cause mixed-content warnings; update the
URL to use HTTPS (https://recharts.github.io/en-US/guide/activeIndex/) so the
link is secure and won't be blocked when the site is served over HTTPS.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6837 +/- ##
==========================================
+ Coverage 93.77% 93.81% +0.03%
==========================================
Files 531 531
Lines 48965 49280 +315
Branches 5117 5117
==========================================
+ Hits 45916 46231 +315
Misses 3042 3042
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 |
Bundle ReportChanges will increase total bundle size by 2.94kB (0.11%) ⬆️. 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:
|
| components: ['Tooltip'], | ||
| props: ['itemSorter'], | ||
| reason: | ||
| 'Tooltip itemSorter has different default behavior than Legend itemSorter (like why? these should be consistent omg)', |
Related Issue
#6069
Summary by CodeRabbit
New Features
Improvements
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.