Conversation
WalkthroughThis PR adds public props to the ErrorBar component (stroke and strokeWidth) and the Dot component (onClick), updates related JSDoc and description documentation across storybook stories and API docs, and removes both components from the componentsWithInconsistentCommentsInApiDoc tracking list. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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: 0
🧹 Nitpick comments (1)
src/chart/SunburstChart.tsx (1)
71-74: Optional: Remove trailing spaces in JSDoc comments.The JSDoc comments for
cxandcycontain trailing spaces before the closing*/. These add no value and can be removed for consistency.Apply this diff:
- /** The x-coordinate of center */ + /** The x-coordinate of center */ cx?: number; - /** The y-coordinate of center */ + /** The y-coordinate of center */ cy?: number;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
omnidoc/componentsWithInconsistentCommentsInApiDoc.ts(0 hunks)src/cartesian/ErrorBar.tsx(2 hunks)src/chart/SunburstChart.tsx(1 hunks)src/shape/Dot.tsx(1 hunks)src/util/types.ts(1 hunks)storybook/stories/API/cartesian/ErrorBar.stories.tsx(2 hunks)www/src/docs/api/ErrorBar.ts(4 hunks)
💤 Files with no reviewable changes (1)
- omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx}: Never useanytype (implicit or explicit) in TypeScript code
Preferunknownoveranyand refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not useastype assertions in TypeScript; the only exception isas const
Files:
src/chart/SunburstChart.tsxsrc/cartesian/ErrorBar.tsxstorybook/stories/API/cartesian/ErrorBar.stories.tsxsrc/util/types.tssrc/shape/Dot.tsxwww/src/docs/api/ErrorBar.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Ensure code lints by running
npm run lintand follows Airbnb's Style Guide
Files:
src/chart/SunburstChart.tsxsrc/cartesian/ErrorBar.tsxstorybook/stories/API/cartesian/ErrorBar.stories.tsxsrc/util/types.tssrc/shape/Dot.tsxwww/src/docs/api/ErrorBar.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/chart/SunburstChart.tsxsrc/cartesian/ErrorBar.tsxsrc/util/types.tssrc/shape/Dot.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/chart/SunburstChart.tsxsrc/cartesian/ErrorBar.tsxstorybook/stories/API/cartesian/ErrorBar.stories.tsxsrc/util/types.tssrc/shape/Dot.tsxwww/src/docs/api/ErrorBar.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/ErrorBar.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/ErrorBar.stories.tsx
🧠 Learnings (1)
📚 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/ErrorBar.stories.tsx
🧬 Code graph analysis (1)
src/shape/Dot.tsx (2)
src/util/types.ts (1)
RechartsMouseEventHandler(181-181)src/cartesian/ReferenceDot.tsx (1)
Props(63-63)
⏰ 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 (7)
src/shape/Dot.tsx (2)
6-6: LGTM!The import of
RechartsMouseEventHandleris appropriate for typing the newonClickprop.
11-30: LGTM!The JSDoc comments for
cx,cy,r, andonClickare clear and follow recharts documentation patterns. TheonClickprop type is correctly specified asRechartsMouseEventHandler<Props>, which will be properly handled byadaptEventHandlers.src/util/types.ts (1)
316-347: LGTM!The JSDoc comments for mouse event handlers are consistent and improve API documentation. The pattern "The customized event handler of [event] in this chart" aligns with the documentation added to other components in this PR.
src/cartesian/ErrorBar.tsx (2)
48-53: LGTM!The JSDoc comment for
dataKeyclearly explains both symmetric (single value) and asymmetric (array) error bar modes.
81-90: LGTM!The new public props
strokeWidthandstrokeare properly typed and documented. They will correctly flow through to the SVG line elements viasvgPropertiesNoEvents, and the default values inerrorBarDefaultPropsmatch the JSDoc annotations.www/src/docs/api/ErrorBar.ts (1)
9-42: LGTM!The documentation updates improve consistency and conciseness. The semicolon in the
dataKeydescription enhances readability, and removing "The" prefix aligns with modern API documentation style. All default values match the implementation.storybook/stories/API/cartesian/ErrorBar.stories.tsx (1)
9-51: LGTM!The Storybook story updates properly reflect the API changes and maintain consistency with the updated documentation. The default value for
strokenow correctly shows'black'to match the component defaults, and all descriptions align with the API documentation.As per coding guidelines, the Storybook stories have been appropriately updated when APIs were changed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6745 +/- ##
==========================================
+ Coverage 93.92% 93.96% +0.04%
==========================================
Files 502 504 +2
Lines 41978 42177 +199
Branches 4908 4925 +17
==========================================
+ Hits 39427 39633 +206
+ Misses 2546 2539 -7
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportBundle size has no change ✅ |
Related Issue
#6069
Summary by CodeRabbit
Release Notes
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.