Skip to content

[Omnidoc] Docs for Sector, Tooltip, Trapezoid, Treemap#6837

Merged
ckifer merged 12 commits intomainfrom
omnidoc
Jan 2, 2026
Merged

[Omnidoc] Docs for Sector, Tooltip, Trapezoid, Treemap#6837
ckifer merged 12 commits intomainfrom
omnidoc

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Dec 30, 2025

Related Issue

#6069

Summary by CodeRabbit

  • New Features

    • Tooltip: custom content, formatter, item sorting, styling, fixed positioning and animation controls.
    • Legend: custom content rendering and CSS-style width/height.
    • Treemap: content rendering, name/data keys, animation lifecycle hooks and options.
    • Sector & Trapezoid: expanded public props and mouse event handlers.
    • Sunburst: wrapper with tooltip portal and store context; synchronized Brush docs.
  • Improvements

    • Expanded and reorganized API doc metadata and component/type coverage.
    • Marked many charts as consuming/providing ResponsiveContainer context.
  • Documentation

    • Added/refined numerous API doc files and examples.
  • Tests

    • Added tests for inline link conversion and API mapping consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 21daa28 and 51e75a5.

📒 Files selected for processing (2)
  • src/component/Tooltip.tsx
  • www/src/docs/api/TooltipAPI.tsx

Walkthrough

Restructures 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

Cohort / File(s) Summary
CI/CD & Workflow
\.github/workflows/ci.yml``
Added echo statements in Deploy step to print website and VR report deployment URLs using TARGET_DIR.
Omnidoc tooling
\omnidoc/commentSimilarityExceptions.ts`, `omnidoc/componentsWithInconsistentCommentsInApiDoc.ts`, `omnidoc/generateApiDoc.ts`, `omnidoc/generateApiDoc.spec.ts`, `omnidoc/omnidoc.spec.ts``
Reorganized and expanded comment-similarity exception groups; removed several entries from componentsWithInconsistentCommentsInApiDoc; generateApiDoc now retrieves public component names and processes inline {@link} tags (with spec); added test asserting apiCates mapping coverage.
API docs migration & index
\www/src/docs/api/*.ts` → `www/src/docs/api/*API.tsx`, `www/src/docs/api/index.ts``
Removed legacy .ts ApiDoc exports and added corresponding .tsx ApiDoc files (TooltipAPI, SectorAPI, TrapezoidAPI, TreemapAPI); updated imports and allApiDocs mappings to use the new *API.tsx modules.
API doc content updates
\www/src/docs/api/BrushAPI.tsx`, `www/src/docs/api/FunnelAPI.tsx`, `www/src/docs/api/LabelAPI.tsx`, `www/src/docs/api/LabelListAPI.tsx`, `www/src/docs/api/LegendAPI.tsx`, `www/src/docs/api/PieChartAPI.tsx`, `www/src/docs/api/RadarChartAPI.tsx`, `www/src/docs/api/RadialBarChartAPI.tsx`, `www/src/docs/api/ResponsiveContainerAPI.tsx`, `www/src/docs/api/SankeyAPI.tsx``
Documentation metadata changes: Brush sync note and example links; Funnel API removed several props and deprecation metadata; Label/LabelList/Legend formatter/docs updated (imports of Link added); several chart APIs annotated with parentComponents/childrenComponents.
Component prop & API surface changes
\src/component/Tooltip.tsx`, `src/component/Legend.tsx`, `src/component/DefaultLegendContent.tsx`, `src/component/Label.tsx`, `src/component/LabelList.tsx``
TooltipProps expanded (content, contentStyle, formatter, filterNull, includeHidden, isAnimationActive, itemSorter, itemStyle, labelFormatter, labelStyle, position, separator, wrapperStyle); Legend gained content?: ContentType, width/height accept number
Shape props expanded
\src/shape/Sector.tsx`, `src/shape/Trapezoid.tsx``
Made SectorProps and TrapezoidProps explicit and added many props including coordinates/dimensions and mouse event handlers (onClick, onMouseDown, onMouseUp, onMouseMove, onMouseOver, onMouseOut, onMouseEnter, onMouseLeave).
Chart docs / minor typings & wrappers
\src/cartesian/Brush.tsx`, `src/cartesian/Funnel.tsx`, `src/chart/SunburstChart.tsx`, `src/chart/Treemap.tsx`, `src/chart/*.tsx` (JSDoc consumes/provides)`
Added ResponsiveContainerContext JSDoc annotations across many charts; Brush docs note syncId behavior; FunnelSvgProps narrowed to SVGPathElement; SunburstChart: added wrapper that provides a RechartsStoreProvider and TooltipPortal; Treemap Props extended (content, nameKey, dataKey, animation hooks and settings, colorPanel immutability).
Tests & examples
\test/cartesian/Funnel.spec.tsx`, `www/src/docs/exampleComponents/ComposedChart/BandedChart.tsx``
Exported FunnelTrapezoidItem type and updated test typing; adjusted renderLegendWithoutRange local signature in example.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant App as App (docs site)
participant SunburstWrapper as SunburstChart (wrapper)
participant Store as RechartsStoreProvider
participant Impl as SunburstChartImpl
participant TooltipCtx as TooltipPortalContext

App->>SunburstWrapper: render(outsideProps)
SunburstWrapper->>Store: create provider with preloaded state
SunburstWrapper->>TooltipCtx: setTooltipPortal(state)
SunburstWrapper->>Impl: render inside RegisterGraphicalItemId with outsideProps
Impl-->>TooltipCtx: request tooltip portal (async at runtime)
Note over Store,TooltipCtx: Wrapper supplies store + portal to inner chart

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • ckifer

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and does not follow the repository's template. Only the 'Related Issue' section is filled; all other required sections (Description, Motivation and Context, How Has This Been Tested, Types of changes, and Checklist) are missing or empty. Complete the PR description by filling in: Description (detailed explanation of changes), Motivation and Context (why these docs are needed), How Has This Been Tested (testing methodology), Types of changes (mark appropriate checkboxes), and Checklist items (documentation, tests, storybook updates as applicable).
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main objective: generating API documentation for four components (Sector, Tooltip, Trapezoid, Treemap), which aligns with the substantial changes across omnidoc files and API documentation files in the changeset.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ebc6ded and 2753003.

📒 Files selected for processing (49)
  • .github/workflows/ci.yml
  • omnidoc/commentSimilarityExceptions.ts
  • omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
  • omnidoc/generateApiDoc.spec.ts
  • omnidoc/generateApiDoc.ts
  • omnidoc/omnidoc.spec.ts
  • src/cartesian/Brush.tsx
  • src/cartesian/Funnel.tsx
  • src/chart/AreaChart.tsx
  • src/chart/BarChart.tsx
  • src/chart/ComposedChart.tsx
  • src/chart/FunnelChart.tsx
  • src/chart/LineChart.tsx
  • src/chart/PieChart.tsx
  • src/chart/RadarChart.tsx
  • src/chart/RadialBarChart.tsx
  • src/chart/Sankey.tsx
  • src/chart/ScatterChart.tsx
  • src/chart/SunburstChart.tsx
  • src/chart/Treemap.tsx
  • src/component/DefaultLegendContent.tsx
  • src/component/Label.tsx
  • src/component/LabelList.tsx
  • src/component/Legend.tsx
  • src/component/ResponsiveContainer.tsx
  • src/component/Tooltip.tsx
  • src/shape/Sector.tsx
  • src/shape/Trapezoid.tsx
  • test/cartesian/Funnel.spec.tsx
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/FunnelAPI.tsx
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • www/src/docs/api/LegendAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • www/src/docs/api/Sector.ts
  • www/src/docs/api/SectorAPI.tsx
  • www/src/docs/api/Tooltip.ts
  • www/src/docs/api/TooltipAPI.tsx
  • www/src/docs/api/Trapezoid.ts
  • www/src/docs/api/TrapezoidAPI.tsx
  • www/src/docs/api/Treemap.ts
  • www/src/docs/api/TreemapAPI.tsx
  • www/src/docs/api/index.ts
  • www/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 use any type (implicit or explicit) in TypeScript code
Prefer unknown over any and 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 use as type assertions in TypeScript; the only exception is as const

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.

Files:

  • src/component/ResponsiveContainer.tsx
  • src/chart/Sankey.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • src/component/Label.tsx
  • omnidoc/generateApiDoc.spec.ts
  • src/chart/PieChart.tsx
  • src/chart/BarChart.tsx
  • src/chart/FunnelChart.tsx
  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • src/cartesian/Brush.tsx
  • www/src/docs/api/TrapezoidAPI.tsx
  • src/chart/RadialBarChart.tsx
  • src/chart/ComposedChart.tsx
  • www/src/docs/api/SectorAPI.tsx
  • src/component/DefaultLegendContent.tsx
  • www/src/docs/api/TooltipAPI.tsx
  • src/cartesian/Funnel.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • test/cartesian/Funnel.spec.tsx
  • src/chart/ScatterChart.tsx
  • src/component/LabelList.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/FunnelAPI.tsx
  • src/chart/RadarChart.tsx
  • omnidoc/omnidoc.spec.ts
  • omnidoc/commentSimilarityExceptions.ts
  • omnidoc/generateApiDoc.ts
  • src/shape/Sector.tsx
  • src/shape/Trapezoid.tsx
  • src/chart/SunburstChart.tsx
  • src/component/Legend.tsx
  • src/chart/LineChart.tsx
  • www/src/docs/exampleComponents/ComposedChart/BandedChart.tsx
  • www/src/docs/api/LegendAPI.tsx
  • src/component/Tooltip.tsx
  • src/chart/AreaChart.tsx
  • src/chart/Treemap.tsx
  • www/src/docs/api/TreemapAPI.tsx
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • www/src/docs/api/index.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Ensure code lints by running npm run lint and follows Airbnb's Style Guide

Files:

  • src/component/ResponsiveContainer.tsx
  • src/chart/Sankey.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • src/component/Label.tsx
  • omnidoc/generateApiDoc.spec.ts
  • src/chart/PieChart.tsx
  • src/chart/BarChart.tsx
  • src/chart/FunnelChart.tsx
  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • src/cartesian/Brush.tsx
  • www/src/docs/api/TrapezoidAPI.tsx
  • src/chart/RadialBarChart.tsx
  • src/chart/ComposedChart.tsx
  • www/src/docs/api/SectorAPI.tsx
  • src/component/DefaultLegendContent.tsx
  • www/src/docs/api/TooltipAPI.tsx
  • src/cartesian/Funnel.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • test/cartesian/Funnel.spec.tsx
  • src/chart/ScatterChart.tsx
  • src/component/LabelList.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/FunnelAPI.tsx
  • src/chart/RadarChart.tsx
  • omnidoc/omnidoc.spec.ts
  • omnidoc/commentSimilarityExceptions.ts
  • omnidoc/generateApiDoc.ts
  • src/shape/Sector.tsx
  • src/shape/Trapezoid.tsx
  • src/chart/SunburstChart.tsx
  • src/component/Legend.tsx
  • src/chart/LineChart.tsx
  • www/src/docs/exampleComponents/ComposedChart/BandedChart.tsx
  • www/src/docs/api/LegendAPI.tsx
  • src/component/Tooltip.tsx
  • src/chart/AreaChart.tsx
  • src/chart/Treemap.tsx
  • www/src/docs/api/TreemapAPI.tsx
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • www/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.tsx
  • src/chart/Sankey.tsx
  • src/component/Label.tsx
  • src/chart/PieChart.tsx
  • src/chart/BarChart.tsx
  • src/chart/FunnelChart.tsx
  • src/cartesian/Brush.tsx
  • src/chart/RadialBarChart.tsx
  • src/chart/ComposedChart.tsx
  • src/component/DefaultLegendContent.tsx
  • src/cartesian/Funnel.tsx
  • src/chart/ScatterChart.tsx
  • src/component/LabelList.tsx
  • src/chart/RadarChart.tsx
  • src/shape/Sector.tsx
  • src/shape/Trapezoid.tsx
  • src/chart/SunburstChart.tsx
  • src/component/Legend.tsx
  • src/chart/LineChart.tsx
  • src/component/Tooltip.tsx
  • src/chart/AreaChart.tsx
  • src/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.tsx rather than running all tests with npm test

Unit tests should be placed in the test directory, with some tests also allowed in www/test. Test files follow the naming convention *.spec.tsx.

Files:

  • omnidoc/generateApiDoc.spec.ts
  • test/cartesian/Funnel.spec.tsx
  • omnidoc/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 the createSelectorTestCase helper function when writing or modifying tests
Use the expectLastCalledWith helper function instead of expect(spy).toHaveBeenLastCalledWith(...) for better typing and autocompletion
Verify the number of selector calls using the spy object from createSelectorTestCase to spot unnecessary re-renders and improve performance
Mock getBoundingClientRect in tests using the helper function provided in test/helper/MockGetBoundingClientRect.ts
Use vi.useFakeTimers() in all tests due to Redux autoBatchEnhancer dependency on timers and requestAnimationFrame
Call vi.runOnlyPendingTimers() to advance timers after renders when not using createSelectorTestCase helper, and avoid vi.runAllTimers() to prevent infinite loops
Use userEvent.setup({ advanceTimers: vi.runOnlyPendingTimers }) or the userEventSetup helper function from test/helper/userEventSetup.ts when creating userEvent instances
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

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.tsx
  • src/chart/Sankey.tsx
  • src/component/Label.tsx
  • src/chart/PieChart.tsx
  • src/chart/BarChart.tsx
  • src/chart/FunnelChart.tsx
  • src/cartesian/Brush.tsx
  • src/chart/RadialBarChart.tsx
  • src/chart/ComposedChart.tsx
  • src/component/DefaultLegendContent.tsx
  • src/cartesian/Funnel.tsx
  • src/chart/ScatterChart.tsx
  • src/component/LabelList.tsx
  • src/chart/RadarChart.tsx
  • src/shape/Sector.tsx
  • src/shape/Trapezoid.tsx
  • src/chart/SunburstChart.tsx
  • src/component/Legend.tsx
  • src/chart/LineChart.tsx
  • src/component/Tooltip.tsx
  • src/chart/AreaChart.tsx
  • src/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.ts
  • test/cartesian/Funnel.spec.tsx
  • src/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.ts
  • test/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.tsx
  • src/chart/FunnelChart.tsx
  • src/chart/ComposedChart.tsx
  • www/src/docs/api/TooltipAPI.tsx
  • src/chart/ScatterChart.tsx
  • www/src/docs/api/FunnelAPI.tsx
  • src/chart/SunburstChart.tsx
  • src/chart/LineChart.tsx
  • src/component/Tooltip.tsx
  • src/chart/AreaChart.tsx
  • www/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.tsx
  • www/src/docs/api/TooltipAPI.tsx
  • test/cartesian/Funnel.spec.tsx
  • src/chart/ScatterChart.tsx
  • src/chart/RadarChart.tsx
  • omnidoc/generateApiDoc.ts
  • src/chart/SunburstChart.tsx
  • src/component/Tooltip.tsx
  • www/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.tsx
  • www/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 Link import 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 formatter should return primitive values (string/number) suitable for the Text component, and directs them to the content prop 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 parentComponents field 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 FunnelTrapezoidItem from 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 like x, y, height, upperWidth, etc.

src/component/Label.tsx (1)

86-90: LGTM! Clear documentation enhancement.

The expanded documentation clarifies the expected return type of formatter and guides users to use the content prop for custom components. This will help prevent misuse of the formatter prop.

src/cartesian/Funnel.tsx (1)

196-196: LGTM! Improved type safety.

Narrowing FunnelSvgProps to use SVGPathElement instead of the more generic SVGElement provides 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 Link import 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.tsx and 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 onKeyPress and onKeyPressCapture props aligns the documentation with the current API state.

src/shape/Sector.tsx (1)

192-267: LGTM! Excellent API documentation expansion.

Refactoring SectorProps from 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 exported Props type

The documentation aligns with Storybook definitions, ensuring consistency across the codebase.

src/chart/LineChart.tsx (1)

10-10: LGTM! Documentation improvement.

Adding the @consumes ResponsiveContainerContext JSDoc 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 ResponsiveContainerContext annotation 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 ResponsiveContainerContext annotation accurately documents that this component provides the context consumed by chart components. This complements the @consumes annotations added throughout the codebase.

src/chart/RadarChart.tsx (1)

39-39: LGTM! Consistent documentation annotation.

The @consumes ResponsiveContainerContext annotation 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 ResponsiveContainerContext annotation aligns with the coordinated documentation updates across chart components.

src/chart/PieChart.tsx (1)

18-18: LGTM! Consistent documentation annotation.

The @consumes ResponsiveContainerContext annotation 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 content parameter from the function signature aligns with the removal of this prop from DefaultLegendContentProps. The explicit type annotation improves type safety, and the function body continues to work correctly as it never used the content parameter.

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 enhancement

The 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 metadata

Adding 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 pattern

The JSDoc annotation documents ResponsiveContainerContext consumption, maintaining consistency with other chart components.

src/chart/ScatterChart.tsx (1)

10-10: LGTM: Documentation enhancement

Consistent with the pattern of documenting ResponsiveContainerContext consumption across chart components.

www/src/docs/api/RadarChartAPI.tsx (1)

403-403: LGTM: API documentation metadata

Documents the hierarchical relationship with ResponsiveContainer, consistent with similar API documentation enhancements.

src/chart/RadialBarChart.tsx (1)

18-18: LGTM: Documentation enhancement

Consistent documentation of ResponsiveContainerContext consumption across chart components.

omnidoc/omnidoc.spec.ts (2)

53-59: Good addition: Navigation mapping validation

This 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 test

This 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 clarification

The added documentation clearly explains what the formatter function should return and provides guidance on when to use the content prop 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 ResponsiveContainerContext annotation 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 childrenComponents array 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 parentComponents metadata 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 ResponsiveContainerContext annotation 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 the content prop from DefaultLegendContentProps.

Verification confirms the content prop was successfully removed from the DefaultLegendContentProps interface. Search results show no code references a content prop on DefaultLegendContent. The content prop is now properly located on the Legend component itself (Legend.tsx line 45), where it calls React.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 Link for 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 .tsx extensions and using the canonical *API naming 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_COMPONENTS align with the PR objectives. The alphabetical ordering is maintained.


564-572: Improved link detection logic.

Splitting the link detection into hasLinkInDesc and hasLinkInProps makes 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 Link import and the updated content prop description clearly explains the rendering behavior and appropriately links to DefaultLegendContent for users seeking the default implementation.

Also applies to: 41-53


80-83: Improved dimension prop documentation.

The updated descriptions for height and width now clearly explain that both CSS string values (like 100% or fit-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 @default tags. 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 ResponsiveContainerContext and @provides TooltipEntrySettings annotations enable the omnidoc tool to automatically determine parent/child component relationships, which is reflected in the generated TreemapAPI documentation.


383-396: Pre-existing any type usage in DataKey.

The DataKey<any> type annotations follow the existing pattern from src/util/types.ts, where the type is intentionally parameterized with any as 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 content prop with comprehensive documentation and the import of ContentType from DefaultLegendContent improves 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 width and height to accept number | string enables CSS values like "100%" or "fit-content", which improves flexibility. The corresponding logic change in getWidthOrHeight (line 181) from isNumber(height) to height != null correctly 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.io which 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2753003 and 21daa28.

📒 Files selected for processing (4)
  • src/chart/Treemap.tsx
  • src/component/Tooltip.tsx
  • www/src/docs/api/TooltipAPI.tsx
  • www/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 use any type (implicit or explicit) in TypeScript code
Prefer unknown over any and 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 use as type assertions in TypeScript; the only exception is as const

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.

Files:

  • www/src/docs/api/TooltipAPI.tsx
  • src/component/Tooltip.tsx
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Ensure code lints by running npm run lint and follows Airbnb's Style Guide

Files:

  • www/src/docs/api/TooltipAPI.tsx
  • src/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.tsx
  • src/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.tsx
  • src/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 any or 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, and animationEasing is clear and includes correct default values.

Comment on lines +403 to +406
name: 'Active index replacement when migrating from Recharts v2 to v3',
url: 'http://recharts.github.io/en-US/guide/activeIndex/',
isExternal: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (ebc6ded) to head (51e75a5).
⚠️ Report is 6 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@codecov
Copy link

codecov bot commented Dec 31, 2025

Bundle Report

Changes will increase total bundle size by 2.94kB (0.11%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.2MB 1.46kB (0.12%) ⬆️
recharts/bundle-es6 1.03MB 1.48kB (0.14%) ⬆️
recharts/bundle-umd 526.56kB 2 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
chart/Sankey.js 40 bytes 31.27kB 0.13%
chart/Treemap.js 171 bytes 29.22kB 0.59%
cartesian/Brush.js 272 bytes 28.1kB 0.98%
chart/SunburstChart.js 49 bytes 13.23kB 0.37%
component/ResponsiveContainer.js 43 bytes 10.94kB 0.39%
component/Tooltip.js 588 bytes 9.37kB 6.69% ⚠️
component/Legend.js -65 bytes 9.24kB -0.7%
chart/RadialBarChart.js 40 bytes 3.22kB 1.26%
chart/RadarChart.js 40 bytes 3.18kB 1.27%
chart/PieChart.js 40 bytes 3.17kB 1.28%
chart/ComposedChart.js 40 bytes 1.51kB 2.72%
chart/ScatterChart.js 40 bytes 1.5kB 2.73%
chart/FunnelChart.js 40 bytes 1.5kB 2.74%
chart/BarChart.js 40 bytes 1.5kB 2.75%
chart/AreaChart.js 40 bytes 1.49kB 2.75%
chart/LineChart.js 40 bytes 1.49kB 2.75%
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js 2 bytes 526.56kB 0.0%
view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
chart/Sankey.js 40 bytes 29.56kB 0.14%
chart/Treemap.js 171 bytes 27.55kB 0.62%
cartesian/Brush.js 272 bytes 26.79kB 1.03%
chart/SunburstChart.js 49 bytes 11.9kB 0.41%
component/ResponsiveContainer.js 43 bytes 9.54kB 0.45%
component/Tooltip.js 588 bytes 8.24kB 7.68% ⚠️
component/Legend.js -48 bytes 8.14kB -0.59%
chart/RadialBarChart.js 40 bytes 2.33kB 1.75%
chart/RadarChart.js 40 bytes 2.31kB 1.77%
chart/PieChart.js 40 bytes 2.3kB 1.77%
chart/ComposedChart.js 40 bytes 694 bytes 6.12% ⚠️
chart/BarChart.js 40 bytes 692 bytes 6.13% ⚠️
chart/ScatterChart.js 40 bytes 692 bytes 6.13% ⚠️
chart/FunnelChart.js 40 bytes 690 bytes 6.15% ⚠️
chart/AreaChart.js 40 bytes 686 bytes 6.19% ⚠️
chart/LineChart.js 40 bytes 686 bytes 6.19% ⚠️

components: ['Tooltip'],
props: ['itemSorter'],
reason:
'Tooltip itemSorter has different default behavior than Legend itemSorter (like why? these should be consistent omg)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

@ckifer ckifer merged commit 263234e into main Jan 2, 2026
42 of 44 checks passed
@ckifer ckifer deleted the omnidoc branch January 2, 2026 17:52
@coderabbitai coderabbitai bot mentioned this pull request Jan 24, 2026
7 tasks
@coderabbitai coderabbitai bot mentioned this pull request Feb 18, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants