Conversation
WalkthroughRefactors omnidoc type-processing to return arrays of type names, adds processType, updates tests, converts ErrorBar to a function component, expands cartesian component props (Area, Bar, Line, Scatter), and migrates/updates many API-doc data files and Storybook metadata. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas to focus during review:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (4)
src/zIndex/ZIndexLayer.tsx (1)
15-25: Nice doc improvement; consider JSDoc{@link ...}for better tooling support.Many TS/IDE doc renderers link better with
@see {@link https://...}(optional).storybook/stories/API/cartesian/Line.stories.tsx (1)
14-33:strokecontrol is good; consider moving the default toargsortable.defaultValue.Right now the “default” is split (
argTypes.defaultValuevsargs.stroke = 'red'), which can confuse the Docs panel.omnidoc/readProject.ts (1)
515-624: LGTM on the type resolution refactor.The change to return
names: string[]instead of a singlenameproperly handles union types and allows downstream consumers to process type information more flexibly. The filtering ofundefinedand boolean coalescing logic (lines 613-618) is clean.One minor observation: the inline comments at lines 576-594 read like development notes/thinking rather than documentation. Consider removing or condensing them for production code.
www/src/docs/api/AreaAPI.tsx (1)
156-171: Consider usingbooleaninstead of'false | true | "auto"'for clarity.The type
'false | true | "auto"'could be simplified to'boolean | "auto"'for better readability. TheprocessTypefunction ingenerateApiDoc.tscoalescestrue | falsetoboolean, so auto-generated docs should produce this. If this is a manually maintained file, consider aligning the format.{ name: 'isAnimationActive', - type: 'false | true | "auto"', + type: 'boolean | "auto"', isOptional: true,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
package-lock.jsonis excluded by!**/package-lock.jsontest-vr/__snapshots__/tests/www/ScatterChartApiExamples.spec-vr.tsx-snapshots/JointLineScatterChart-1-chromium-linux.pngis excluded by!**/*.pngtest-vr/__snapshots__/tests/www/ScatterChartApiExamples.spec-vr.tsx-snapshots/JointLineScatterChart-1-firefox-linux.pngis excluded by!**/*.pngtest-vr/__snapshots__/tests/www/ScatterChartApiExamples.spec-vr.tsx-snapshots/JointLineScatterChart-1-webkit-linux.pngis excluded by!**/*.png
📒 Files selected for processing (28)
omnidoc/componentsWithInconsistentCommentsInApiDoc.ts(0 hunks)omnidoc/cross-component-prop-comments.spec.ts(1 hunks)omnidoc/generateApiDoc.ts(4 hunks)omnidoc/omnidoc.spec.ts(1 hunks)omnidoc/processType.spec.ts(1 hunks)omnidoc/readProject.spec.ts(3 hunks)omnidoc/readProject.ts(3 hunks)omnidoc/simplifyType.spec.ts(0 hunks)src/cartesian/Area.tsx(6 hunks)src/cartesian/Bar.tsx(2 hunks)src/cartesian/ErrorBar.tsx(6 hunks)src/cartesian/Line.tsx(3 hunks)src/cartesian/Scatter.tsx(3 hunks)src/component/Cell.tsx(1 hunks)src/shape/Curve.tsx(2 hunks)src/zIndex/ZIndexLayer.tsx(1 hunks)storybook/stories/API/cartesian/Line.stories.tsx(1 hunks)www/src/docs/api/AreaAPI.tsx(7 hunks)www/src/docs/api/ErrorBar.ts(0 hunks)www/src/docs/api/ErrorBarAPI.tsx(1 hunks)www/src/docs/api/LabelAPI.tsx(3 hunks)www/src/docs/api/Line.ts(0 hunks)www/src/docs/api/LineAPI.tsx(1 hunks)www/src/docs/api/Scatter.ts(0 hunks)www/src/docs/api/ScatterAPI.tsx(1 hunks)www/src/docs/api/TextAPI.tsx(2 hunks)www/src/docs/api/index.ts(4 hunks)www/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsx(1 hunks)
💤 Files with no reviewable changes (5)
- www/src/docs/api/Line.ts
- omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
- www/src/docs/api/Scatter.ts
- www/src/docs/api/ErrorBar.ts
- omnidoc/simplifyType.spec.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx}: Never useanytype (implicit or explicit) in TypeScript code
Preferunknownoveranyand refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not useastype assertions in TypeScript; the only exception isas const
Files:
src/zIndex/ZIndexLayer.tsxwww/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsxomnidoc/readProject.spec.tsomnidoc/readProject.tsomnidoc/cross-component-prop-comments.spec.tswww/src/docs/api/ScatterAPI.tsxsrc/component/Cell.tsxsrc/cartesian/Bar.tsxomnidoc/processType.spec.tswww/src/docs/api/ErrorBarAPI.tsxstorybook/stories/API/cartesian/Line.stories.tsxsrc/shape/Curve.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/TextAPI.tsxwww/src/docs/api/index.tsomnidoc/omnidoc.spec.tswww/src/docs/api/LabelAPI.tsxsrc/cartesian/Area.tsxsrc/cartesian/ErrorBar.tsxwww/src/docs/api/AreaAPI.tsxomnidoc/generateApiDoc.tssrc/cartesian/Line.tsxsrc/cartesian/Scatter.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Ensure code lints by running
npm run lintand follows Airbnb's Style Guide
Files:
src/zIndex/ZIndexLayer.tsxwww/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsxomnidoc/readProject.spec.tsomnidoc/readProject.tsomnidoc/cross-component-prop-comments.spec.tswww/src/docs/api/ScatterAPI.tsxsrc/component/Cell.tsxsrc/cartesian/Bar.tsxomnidoc/processType.spec.tswww/src/docs/api/ErrorBarAPI.tsxstorybook/stories/API/cartesian/Line.stories.tsxsrc/shape/Curve.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/TextAPI.tsxwww/src/docs/api/index.tsomnidoc/omnidoc.spec.tswww/src/docs/api/LabelAPI.tsxsrc/cartesian/Area.tsxsrc/cartesian/ErrorBar.tsxwww/src/docs/api/AreaAPI.tsxomnidoc/generateApiDoc.tssrc/cartesian/Line.tsxsrc/cartesian/Scatter.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/zIndex/ZIndexLayer.tsxsrc/component/Cell.tsxsrc/cartesian/Bar.tsxsrc/shape/Curve.tsxsrc/cartesian/Area.tsxsrc/cartesian/ErrorBar.tsxsrc/cartesian/Line.tsxsrc/cartesian/Scatter.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (DEVELOPING.md)
All imports from
rechartsmust use the public API entry point; imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed
Files:
src/zIndex/ZIndexLayer.tsxwww/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsxomnidoc/readProject.spec.tsomnidoc/readProject.tsomnidoc/cross-component-prop-comments.spec.tswww/src/docs/api/ScatterAPI.tsxsrc/component/Cell.tsxsrc/cartesian/Bar.tsxomnidoc/processType.spec.tswww/src/docs/api/ErrorBarAPI.tsxstorybook/stories/API/cartesian/Line.stories.tsxsrc/shape/Curve.tsxwww/src/docs/api/LineAPI.tsxwww/src/docs/api/TextAPI.tsxwww/src/docs/api/index.tsomnidoc/omnidoc.spec.tswww/src/docs/api/LabelAPI.tsxsrc/cartesian/Area.tsxsrc/cartesian/ErrorBar.tsxwww/src/docs/api/AreaAPI.tsxomnidoc/generateApiDoc.tssrc/cartesian/Line.tsxsrc/cartesian/Scatter.tsx
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
When running unit tests, prefer to run a single test file using
npm run test -- path/to/TestFile.spec.tsxrather than running all tests withnpm test
Files:
omnidoc/readProject.spec.tsomnidoc/cross-component-prop-comments.spec.tsomnidoc/processType.spec.tsomnidoc/omnidoc.spec.ts
storybook/stories/**/*.stories.tsx
📄 CodeRabbit inference engine (CONTRIBUTING.md)
storybook/stories/**/*.stories.tsx: Use Storybook for smoke tests and add play functions with assertions for actual tests
Update Storybook stories when APIs have been changed to ensure they work as expected
Files:
storybook/stories/API/cartesian/Line.stories.tsx
**/storybook/**/*.stories.{ts,tsx}
📄 CodeRabbit inference engine (DEVELOPING.md)
When adding new Storybook stories, prioritize high fidelity examples intended for publication on the website and in Storybook UI; use unit tests or VR tests for low fidelity tests
Files:
storybook/stories/API/cartesian/Line.stories.tsx
🧠 Learnings (9)
📚 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/zIndex/ZIndexLayer.tsxsrc/cartesian/Line.tsx
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All imports from `recharts` must use the public API entry point; imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed
Applied to files:
omnidoc/readProject.spec.tswww/src/docs/api/index.tssrc/cartesian/ErrorBar.tsxsrc/cartesian/Line.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 **/*.{ts,tsx} : Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Applied to files:
omnidoc/readProject.spec.tsomnidoc/readProject.ts
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Run type checking with `npm run check-types` to verify TypeScript types
Applied to files:
omnidoc/readProject.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 test/component/**/*.spec.tsx : Use React Testing Library for testing component interactions and behavior upon rendering
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-11-19T14:08:01.728Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6659
File: www/src/components/GuideView/Performance/index.tsx:232-250
Timestamp: 2025-11-19T14:08:01.728Z
Learning: In Recharts version 3.4.2, object-as-prop optimizations were introduced to reduce unnecessary re-renders when new object references are passed as props. This affects the recommendation for the `react-perf/jsx-no-new-object-as-prop` ESLint rule.
Applied to files:
omnidoc/cross-component-prop-comments.spec.tssrc/cartesian/ErrorBar.tsxsrc/cartesian/Line.tsxsrc/cartesian/Scatter.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:
storybook/stories/API/cartesian/Line.stories.tsxwww/src/docs/api/index.tsomnidoc/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-11-16T09:14:24.918Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6640
File: src/cartesian/Bar.tsx:156-159
Timestamp: 2025-11-16T09:14:24.918Z
Learning: In recharts, SSR (Server-Side Rendering) is not yet supported—charts don't render at all in SSR environments. The `isAnimationActive: 'auto'` mode is preparatory work for future SSR support, so testing of this mode should be deferred until SSR support is actually implemented.
Applied to files:
src/cartesian/Area.tsx
🧬 Code graph analysis (12)
www/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsx (1)
src/index.ts (1)
Scatter(89-89)
omnidoc/readProject.spec.ts (2)
test/helper/assertNotNull.ts (1)
assertNotNull(1-5)omnidoc/generateApiDoc.ts (1)
processType(84-102)
www/src/docs/api/ScatterAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-27)
omnidoc/processType.spec.ts (1)
omnidoc/generateApiDoc.ts (1)
processType(84-102)
www/src/docs/api/ErrorBarAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-27)
src/shape/Curve.tsx (2)
storybook/stories/API/props/CartesianComponentShared.ts (1)
layout(67-75)src/context/chartLayoutContext.tsx (1)
useChartLayout(135-135)
www/src/docs/api/LineAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-27)
omnidoc/omnidoc.spec.ts (1)
omnidoc/generateApiDoc.ts (1)
OMNIDOC_AUTOMATED_API_DOCS_COMPONENTS(24-34)
src/cartesian/Area.tsx (2)
src/util/types.ts (3)
DataKey(65-65)DotType(1073-1100)LegendType(81-92)src/index.ts (2)
DataKey(120-120)LegendType(120-120)
src/cartesian/ErrorBar.tsx (1)
src/util/resolveDefaultProps.tsx (1)
resolveDefaultProps(16-53)
src/cartesian/Line.tsx (7)
src/util/types.ts (7)
ActiveDotType(1027-1051)AnimationDuration(642-642)AnimationTiming(640-640)DataKey(65-65)DotType(1073-1100)LegendType(81-92)TooltipType(93-93)src/state/chartDataSlice.ts (1)
ChartData(14-14)src/index.ts (2)
DataKey(120-120)LegendType(120-120)src/component/LabelList.tsx (1)
ImplicitLabelListType(131-131)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)src/shape/Curve.tsx (1)
CurveType(64-80)src/state/cartesianAxisSlice.ts (1)
AxisId(11-11)
src/cartesian/Scatter.tsx (6)
src/zIndex/ZIndexLayer.tsx (1)
ZIndexable(14-26)src/state/cartesianAxisSlice.ts (1)
AxisId(11-11)src/util/types.ts (6)
DataKey(65-65)LegendType(81-92)TooltipType(93-93)AnimationDuration(642-642)AnimationTiming(640-640)PresentationAttributesAdaptChildEvent(69-71)src/index.ts (2)
DataKey(120-120)LegendType(120-120)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)src/component/LabelList.tsx (1)
ImplicitLabelListType(131-131)
⏰ 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 (27)
omnidoc/cross-component-prop-comments.spec.ts (1)
95-115: Exceptions look appropriately scoped and justified.www/src/docs/api/TextAPI.tsx (1)
170-194: LGTM (docs-only union ordering cleanup).www/src/docs/api/LabelAPI.tsx (1)
39-56: Good improvement: removedanyfrom the Label docs type.(Optional) If you want to tighten the docs further, consider spelling the function shape (e.g.
((props: unknown) => ReactNode)) instead ofFunction, but not required.Also applies to: 85-86, 101-112
omnidoc/omnidoc.spec.ts (1)
433-441: Filter change makes sense to avoid redundant checks for omnidoc-generated components.www/src/docs/api/index.ts (1)
14-15: LGTM! API documentation imports and mappings are correctly updated.The changes successfully align the API documentation index with the new per-component API data objects (LineAPI, ScatterAPI, ErrorBarAPI, AreaAPI), ensuring consistency across the documentation surface.
Also applies to: 22-22, 54-54, 72-73, 100-100
src/cartesian/Area.tsx (1)
133-194: LGTM! Documentation improvements enhance clarity.The JSDoc additions and updates provide clear descriptions for component props, including:
- Detailed explanations for
activeDotanddotprop options- Clarification that
dataKeyreuses YAxis dataKey when undefined- Comprehensive
zIndexdocumentation with links to the guideThese changes align with the PR's objective to fix documentation/comments.
Also applies to: 204-232, 263-263, 281-290
src/component/Cell.tsx (1)
5-7: LGTM! Documentation metadata added.The
@consumes CellReaderJSDoc tag documents the component's context consumption without changing functionality.src/cartesian/Bar.tsx (1)
265-274: LGTM! Enhanced documentation for zIndex and context provider.The expanded
zIndexprop documentation provides clear guidance with links to the zIndex guide, and the@provides CellReadertag documents the component's context provisioning.Also applies to: 1092-1092
www/src/docs/api/ErrorBarAPI.tsx (1)
3-99: LGTM! Comprehensive ErrorBar API documentation.The ErrorBarAPI object provides detailed documentation for all ErrorBar props including type information, descriptions, and default values. The structure correctly conforms to the ApiDoc type.
www/src/docs/api/ScatterAPI.tsx (1)
3-527: LGTM! Comprehensive Scatter API documentation.The ScatterAPI object provides extensive documentation for the Scatter component, including:
- Core props with detailed descriptions and examples
- Comprehensive event handler coverage
- Proper parent and children component relationships
The structure correctly implements the ApiDoc type.
omnidoc/readProject.spec.ts (3)
4-5: LGTM! Imports added for new test utilities.The imports support the new type processing tests and assertions added later in the file.
916-918: LGTM! Test expectations updated for new type representation.The expectations correctly reflect the new
{names: string[], isInline: boolean}structure returned bygetTypeOf, replacing the previous single-name format.Also applies to: 924-929
983-1004: LGTM! New tests validate type processing improvements.The three new test cases effectively verify:
- Double pointy brackets are not added in simplified types
- Children type is correctly simplified to
ReactNode- Boolean type is represented as
boolean, nottrue | false, withundefinedexcludedThese tests align with the type processing refactor mentioned in the PR.
omnidoc/processType.spec.ts (1)
1-29: LGTM! Comprehensive test coverage for processType.The test suite effectively validates
processTypebehavior across multiple scenarios:
- Simple and complex unions
- Nested object and generic types
- Type deduplication
- Undefined filtering
The tests are clear, focused, and cover important edge cases.
omnidoc/generateApiDoc.ts (2)
84-102: LGTM on the newprocessTypefunction.The function correctly:
- Filters out
undefined(line 87)- Simplifies each type part (line 88)
- Deduplicates using
Set(line 90)- Provides a readable fallback for complex unions (line 101)
The threshold of 4 variants before switching to generic display is a reasonable heuristic.
24-34: Component list updates align with PR objectives.Adding
ErrorBar,Line, andScatterto the automated API docs generation is consistent with the PR goals for documentation improvements.src/cartesian/ErrorBar.tsx (1)
259-285: Clean conversion to function component.The ErrorBar conversion from class to function component is well-structured:
- Uses
resolveDefaultPropspattern consistently with the codebase- Properly wraps with
ReportErrorBarSettingsandZIndexLayercontext providersdisplayNamecorrectly assigned for debugging/DevToolswww/src/docs/api/AreaAPI.tsx (1)
329-346: Good expansion ofzIndexdocumentation.The expanded
zIndexprop documentation with description, default value, and examples guide link provides much better guidance for users.www/src/docs/api/LineAPI.tsx (1)
661-662: RemoveFunnelChartfrom theparentComponentsarray.
FunnelChartis not a valid parent for theLinecomponent. The FunnelChart API documentation explicitly lists supported children as['Funnel', 'Legend', 'Tooltip', 'Customized', 'validate svg elements...'], andLineis not included. This applies to lines 661 as well as the broader pattern affectingAreaAPI.tsxandScatterAPI.tsx, which incorrectly includeFunnelChartin their parentComponents arrays.Likely an incorrect or invalid review comment.
src/cartesian/Line.tsx (3)
69-69: LGTM! ChartData typing is a good improvement.Using
ChartData(which isunknown[]) instead of looseanytyping improves type safety while remaining flexible for user data structures.Also applies to: 170-170
320-320: LGTM! Addition of 'baseLine' to omitted properties.This correctly prevents the
baseLineSVG prop conflict with internal Line component usage.
992-997: LGTM! ErrorBarContext provider annotation added.The JSDoc accurately reflects that Line now exposes ErrorBarContext (via
SetErrorBarContextat line 800-808).src/cartesian/Scatter.tsx (5)
342-345: LGTM! BaseScatterSvgProps correctly omits conflicting properties.Omitting
'points' | 'ref' | 'children' | 'dangerouslySetInnerHTML'prevents conflicts between SVG presentation attributes and Scatter's internal props.
163-163: LGTM! Children prop added to support ErrorBar and Cell children.Adding
children?: ReactNodeto both internal and external props enables proper typing for nested components like ErrorBar and Cell.Also applies to: 336-336
919-924: LGTM! Context provider annotations correctly updated.The JSDoc now accurately documents that Scatter provides
ErrorBarContextandCellReadercontexts, which aligns with the component's implementation (SetErrorBarContext at line 792-802 and Cell usage at line 845).
84-89: LGTM! Improved ScatterPointItem documentation.The updated comments clarify coordinate nullability behavior and explain how points are exposed via props for custom shapes.
416-462: The fix for monotone curves is incomplete or not shown in this snippet.The
ScatterLinecomponent at line 417 only extractsline,lineType, andlineJointTypefrom props, but does not extract or passlayout. WhenlineJointType='monotone', theCurvecomponent needs thelayoutprop to determine whether to usecurveMonotoneXorcurveMonotoneY—without it,getCurveFactoryfalls back tocurveLinear.Compare with the
Linecomponent, which explicitly extractslayoutand includes it in thecurvePropsobject. TheScatterLinefunction should either extractlayoutfrompropsand pass it via thelinePropsobject, or pass it explicitly when rendering<Curve>.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (6)
www/src/docs/api/ErrorBarAPI.tsx (1)
1-99: LGTM - ErrorBarAPI documentation is well-structured.The import path issue from the previous review has been fixed. The API documentation covers the essential props with appropriate types, default values, and descriptions.
www/src/docs/api/ScatterAPI.tsx (1)
1-2: Import path is correct.The
.tsextension issue from the previous review has been addressed.src/cartesian/Line.tsx (2)
170-178: Past issue fixed - JSDoc now correctly references "Line".The documentation now correctly refers to "this Line" instead of "this Area".
262-268: Past issue fixed - typo removed.The extraneous "Q" has been removed from the JSDoc.
src/cartesian/Scatter.tsx (2)
304-308: Past issue fixed - JSDoc now correctly references "Scatter".The documentation now correctly says "animation of Scatter points" instead of "animation of area".
209-226: Formatting error in JSDoc forlineprop partially addressed but still incorrect.The past review flagged "Options" followed by "= -". The "= -" appears fixed, but there's still an extra quote mark. Line 211 shows
Options"which should beOptions:./** * Renders line connecting individual points. - * Options" + * Options: * - `false`: no line is drawn.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
omnidoc/generateApiDoc.ts(5 hunks)src/cartesian/Line.tsx(3 hunks)src/cartesian/Scatter.tsx(3 hunks)src/zIndex/ZIndexLayer.tsx(1 hunks)www/src/docs/api/AreaAPI.tsx(8 hunks)www/src/docs/api/BarStackAPI.tsx(1 hunks)www/src/docs/api/ErrorBarAPI.tsx(1 hunks)www/src/docs/api/LabelAPI.tsx(4 hunks)www/src/docs/api/LineAPI.tsx(1 hunks)www/src/docs/api/ScatterAPI.tsx(1 hunks)www/src/docs/api/TextAPI.tsx(3 hunks)www/src/docs/api/ZIndexLayerAPI.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- www/src/docs/api/BarStackAPI.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
- www/src/docs/api/TextAPI.tsx
- www/src/docs/api/LineAPI.tsx
- www/src/docs/api/LabelAPI.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx}: Never useanytype (implicit or explicit) in TypeScript code
Preferunknownoveranyand refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not useastype assertions in TypeScript; the only exception isas const
Files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsxwww/src/docs/api/ZIndexLayerAPI.tsxsrc/cartesian/Line.tsxsrc/zIndex/ZIndexLayer.tsxwww/src/docs/api/AreaAPI.tsxsrc/cartesian/Scatter.tsxomnidoc/generateApiDoc.ts
**/*.{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/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsxwww/src/docs/api/ZIndexLayerAPI.tsxsrc/cartesian/Line.tsxsrc/zIndex/ZIndexLayer.tsxwww/src/docs/api/AreaAPI.tsxsrc/cartesian/Scatter.tsxomnidoc/generateApiDoc.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (DEVELOPING.md)
All imports from
rechartsmust use the public API entry point; imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed
Files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsxwww/src/docs/api/ZIndexLayerAPI.tsxsrc/cartesian/Line.tsxsrc/zIndex/ZIndexLayer.tsxwww/src/docs/api/AreaAPI.tsxsrc/cartesian/Scatter.tsxomnidoc/generateApiDoc.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/cartesian/Line.tsxsrc/zIndex/ZIndexLayer.tsxsrc/cartesian/Scatter.tsx
🧠 Learnings (10)
📚 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 **/*.{ts,tsx} : Do not use `as` type assertions in TypeScript; the only exception is `as const`
Applied to files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsx
📚 Learning: 2025-12-06T03:36:59.377Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-06T03:36:59.377Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All imports from `recharts` must use the public API entry point; imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed
Applied to files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsxwww/src/docs/api/ZIndexLayerAPI.tsxsrc/cartesian/Line.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 **/*.{ts,tsx} : Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Applied to files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.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 **/*.{ts,tsx} : Prefer `unknown` over `any` and refine the type in TypeScript
Applied to files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.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:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.tsxsrc/cartesian/Line.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 **/*.{ts,tsx} : Never use `any` type (implicit or explicit) in TypeScript code
Applied to files:
www/src/docs/api/ErrorBarAPI.tsxwww/src/docs/api/ScatterAPI.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:
www/src/docs/api/ScatterAPI.tsx
📚 Learning: 2025-12-08T08:23:26.261Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6750
File: src/state/selectors/axisSelectors.ts:593-602
Timestamp: 2025-12-08T08:23:26.261Z
Learning: In the recharts codebase, `DataKey<any>` is an intentional exception to the "no any" rule while proper typing is being developed. This should not be flagged in reviews.
Applied to files:
src/cartesian/Line.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/cartesian/Line.tsxsrc/zIndex/ZIndexLayer.tsxsrc/cartesian/Scatter.tsx
📚 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/cartesian/Scatter.tsx
🧬 Code graph analysis (4)
www/src/docs/api/ErrorBarAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-27)
www/src/docs/api/ScatterAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-27)
src/cartesian/Line.tsx (6)
src/util/types.ts (8)
ActiveDotType(1027-1051)AnimationDuration(642-642)AnimationTiming(640-640)DataKey(65-65)DotType(1073-1100)LegendType(81-92)ActiveShape(1102-1107)TooltipType(93-93)src/state/chartDataSlice.ts (1)
ChartData(14-14)src/component/LabelList.tsx (1)
ImplicitLabelListType(131-131)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)src/shape/Curve.tsx (1)
CurveType(64-80)src/state/cartesianAxisSlice.ts (1)
AxisId(11-11)
src/cartesian/Scatter.tsx (6)
src/zIndex/ZIndexLayer.tsx (1)
ZIndexable(14-26)src/state/cartesianAxisSlice.ts (1)
AxisId(11-11)src/util/types.ts (4)
DataKey(65-65)LegendType(81-92)TooltipType(93-93)PresentationAttributesAdaptChildEvent(69-71)src/shape/Curve.tsx (1)
CurveType(64-80)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)src/component/LabelList.tsx (1)
ImplicitLabelListType(131-131)
⏰ 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 (8)
omnidoc/generateApiDoc.ts (1)
84-102: LGTM - Well-structured type processing logic.The new
processTypefunction properly handles type name arrays by filtering outundefined, simplifying each type, and deduplicating results. The threshold of 4 variants for inline display vs. summary is a reasonable UX choice.www/src/docs/api/ZIndexLayerAPI.tsx (1)
1-1: LGTM - Import path corrected.The
.tsextension was correctly removed from the import path.src/cartesian/Line.tsx (1)
295-314: LGTM - New stroke props are well-documented.The new
stroke,strokeWidth, andstrokeDasharrayprops have clear JSDoc with examples.www/src/docs/api/AreaAPI.tsx (2)
1-1: LGTM - Import path is correct.
329-346: LGTM - zIndex documentation is comprehensive.The expanded zIndex entry with description, default value, and example links provides clear guidance for users.
src/cartesian/Scatter.tsx (2)
163-164: LGTM - children prop added to both internal and external prop interfaces.Adding
children?: ReactNodeenables proper typing for nested children within Scatter components.Also applies to: 336-337
921-923: LGTM - JSDoc context annotations updated.The component now properly documents that it provides
ErrorBarContextandCellReadercontexts.src/zIndex/ZIndexLayer.tsx (1)
23-23: LGTM! The JSDoc @see tag syntax is correct, and the documentation link to the zIndex guide is accessible and provides helpful reference material for users.
| { | ||
| name: 'line', | ||
| type: '(union of 5 variants)', | ||
| isOptional: true, | ||
| desc: { | ||
| 'en-US': ( | ||
| <section> | ||
| <p>Renders line connecting individual points. Options"</p> | ||
| <ul> |
There was a problem hiding this comment.
Typo in description: extra quote mark and missing colon.
Line 176 has Options" which should be Options:.
desc: {
'en-US': (
<section>
- <p>Renders line connecting individual points. Options"</p>
+ <p>Renders line connecting individual points. Options:</p>
<ul>📝 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: 'line', | |
| type: '(union of 5 variants)', | |
| isOptional: true, | |
| desc: { | |
| 'en-US': ( | |
| <section> | |
| <p>Renders line connecting individual points. Options"</p> | |
| <ul> | |
| { | |
| name: 'line', | |
| type: '(union of 5 variants)', | |
| isOptional: true, | |
| desc: { | |
| 'en-US': ( | |
| <section> | |
| <p>Renders line connecting individual points. Options:</p> | |
| <ul> |
🤖 Prompt for AI Agents
In www/src/docs/api/ScatterAPI.tsx around lines 169 to 177, the description
string for the 'line' prop contains a typo — it reads `Options"` instead of
`Options:`; update the JSX/JS string to replace the extra double-quote with a
colon so the paragraph reads "Options:" (ensure escaping/quoting is correct in
the JSX so no syntax break occurs).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6771 +/- ##
==========================================
+ Coverage 93.72% 93.80% +0.07%
==========================================
Files 516 516
Lines 43401 43946 +545
Branches 5008 5007 -1
==========================================
+ Hits 40678 41223 +545
Misses 2717 2717
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 341 bytes (0.01%) ⬆️. 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:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
Description
Also I fixed the bug with double pointy brackets in the type, and fixed a bug where Scatter lineJointType=monotone was still rendering linear line.
Related Issue
#6069
Types of changes
Checklist:
Summary by CodeRabbit
New Features
Documentation
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.