Conversation
WalkthroughExports many formerly-internal per-component default prop constants, expands and documents numerous public prop interfaces (including widening animation flags to Changes
Sequence Diagram(s)(Skipped — changes are props/defaults, docs, and tests only; no new runtime control-flow to diagram.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
www/src/docs/api/Curve.ts (1)
1-148: Fix thepointsprop documentation to reflect the actual component behavior.The Curve component source shows that all props in
CurvePropsare optional (points?), andgetPathprovides a default value of[]forpoints. However, the documentation at line 29 markspointsasisOptional: false(required). This is incorrect.Update line 29 to set
isOptional: truefor thepointsprop to align with the actual component implementation. The removal of incorrectdefaultVal: 'null'entries forpoints,layout, andbaseLinewas appropriate since these don't reflect the component's actual behavior.storybook/stories/API/props/Legend.ts (1)
17-77:verticalAligndefault type mismatch between docs and story args
LegendArgTypes.verticalAlignonly setstable.defaultValue: { summary: 'bottom' }and no top‑leveldefaultValue. BecausegetStoryArgsFromArgsTypesObjectusesargsType.table.defaultValueas the actual arg value whendefaultValueis missing, the story will receive{ summary: 'bottom' }instead of the string'bottom', which does not match the component’s real default (legendDefaultProps.verticalAlign) or the expected prop type.Recommend wiring it like the other Legend defaults:
verticalAlign: { description: `Sets vertical position of the Legend relative to the chart: ... `, + defaultValue: 'bottom', table: { type: { summary: 'top | middle | bottom', }, - defaultValue: { summary: 'bottom' }, + defaultValue: { summary: 'bottom' }, category: 'General', }, },This keeps Storybook docs (
table.defaultValue) and the runtime arg (defaultValue) consistent withlegendDefaultProps.storybook/stories/API/polar/PolarRadiusAxis.stories.tsx (1)
33-45:labelstory default should be booleanfalse, not{ summary: 'false' }
GeneralProps.labelcurrently only definestable.defaultValue: { summary: 'false' }. BecauseAPI.argsis built viagetStoryArgsFromArgsTypesObject(GeneralProps), the story ends up withlabel = { summary: 'false' }, which does not match the component’s real default (label: falseindefaultPolarRadiusAxisProps) or the intended boolean type.Consider aligning it with the runtime default:
label: { description: `If set a string or a number, default label will be drawn, ... `, control: 'text', - table: { - type: { summary: 'String | Number | ReactElement | Function' }, - defaultValue: { summary: 'false' }, - category: 'General', - }, + defaultValue: false, + table: { + type: { summary: 'String | Number | ReactElement | Function' }, + defaultValue: { summary: 'false' }, + category: 'General', + }, },This keeps the docs table unchanged while making the story args use the correct boolean default.
Also applies to: 50-61
www/src/docs/api/RadialBar.ts (1)
71-79: ClarifyisAnimationActivetype stringThe type is documented as
Boolean | "auto(missing the closing quote in the literal part). For consistency withPieAPIand the actual TS type, consider changing this to:type: 'Boolean | "auto"',so the docs clearly show the
"auto"literal option.src/polar/RadialBar.tsx (1)
74-75: Allowbooleaninbackgroundtype to match runtime usage and default value
InternalRadialBarPropsdefinesbackground?: RadialBarBackground, whereRadialBarBackground = ActiveShape<SectorProps> & ZIndexable. When the unionActiveShape(which includesboolean) intersects with the object typeZIndexable, the boolean member is eliminated by TypeScript's distribution rules—boolean & { zIndex?: number }simplifies tonever.However,
defaultRadialBarPropssetsbackground: false, and the runtime code treats it as a boolean toggle (line 442:background &&) while also supporting object properties for zIndex extraction. The type should explicitly allow boolean:background?: RadialBarBackground | boolean;This ensures
falseis assignable, aligns with actual usage patterns, and reflects the dual role of the field (toggle + optional zIndex).
🧹 Nitpick comments (10)
www/src/docs/api/types.ts (1)
9-18:defaultValnow supports objects; consider tightening the object typeAllowing
objectindefaultValis necessary for structured defaults and matches usage across the docs. If you want a bit more type-safety, you could optionally narrow this fromobjectto something likeRecord<string, unknown>so consumers don’t accidentally pass class instances or other exotic objects.storybook/stories/API/props/TooltipArgTypes.tsx (1)
3-17: ArgTypes defaults updated correctly; adjustisAnimationActivetype summaryRenaming to
TooltipArgTypesand syncingisAnimationActive('auto') andanimationDuration(400) with the component defaults looks good, and dropping explicitdefaultValueforactive/defaultIndexavoids redundantundefined.One minor follow‑up: the
table.type.summaryforisAnimationActivestill says'boolean'while the default is'auto'and the prop supports'auto'. Consider updating it to something likeboolean | "auto"so Storybook docs accurately reflect the public API.Also applies to: 146-165
src/cartesian/ErrorBar.tsx (1)
49-80: KeepzIndexJSDoc default aligned withDefaultZIndexes.lineThe documented defaults for width/animation props match
errorBarDefaultProps, butzIndexis hard‑coded as400while the actual default comes fromDefaultZIndexes.line. If that constant ever changes, the JSDoc will go stale.Consider either:
- documenting the symbolic default (
DefaultZIndexes.line) instead of a number, or- double‑checking that
DefaultZIndexes.lineis indeed400and keeping these in sync going forward.www/src/docs/api/LabelList.ts (1)
53-75:clockWisedoc now has type/default mismatch
offsetnow usesdefaultVal: 5with typeNumber, which is consistent.- For
clockWise, the type is still'String'butdefaultValis the booleanfalse, which is inconsistent and may confuse doc tooling/readers. It also strongly suggests the prop is actually a boolean.Consider updating this block to reflect a boolean prop, e.g.:
- type: 'String', - defaultVal: false, + type: 'Boolean', + defaultVal: false,Please confirm the runtime type of
clockWisebefore changing the docs.www/src/docs/api/Tooltip.ts (1)
1-249: TypedTooltipAPIand normalized defaults look good; consider documenting'auto'semantics
- Typing
TooltipAPIasApiDocand normalizing defaults (offset: 10,filterNull: true, empty style objects,cursor: true,allowEscapeViewBox: { x: false, y: false }) make the Tooltip docs much more faithful to the actual props.- Updating
isAnimationActivetotype: 'Boolean | "auto"'withdefaultVal: 'auto'matches the newer'auto'mode introduced alongside preparatory SSR work, where'auto'behaves liketruein the browser but is designed to disable animations under SSR. Based on past learnings, this is intentional.You might optionally:
- expand the
isAnimationActivedescription to explain what'auto'does relative totrue/false, so consumers aren’t surprised by the extra literal.Based on learnings about
isAnimationActive: 'auto'and SSR behavior.src/polar/PolarRadiusAxis.tsx (1)
57-61:InsideProps.radiusappears unused and could be removed
InsidePropsnow includes aradius: numberfield andPolarRadiusAxisWrappersetsradius: viewBox.outerRadius, but nothing else in this file readsprops.radius.If there’s no external consumer relying on this field, you could simplify the type and object construction by dropping
radiusentirely:-type InsideProps = Omit<PropsWithDefaults, 'scale'> & - PolarViewBoxRequired & { - scale: RechartsScale; - radius: number; - }; +type InsideProps = Omit<PropsWithDefaults, 'scale'> & + PolarViewBoxRequired & { + scale: RechartsScale; + };and remove the
radiusassignment inPolarRadiusAxisWrapper.storybook/stories/API/props/RadialBarArgTypes.ts (1)
12-21: Fix formatting inconsistency in the type summary.The type summary has inconsistent spacing around the pipe separator:
'line | plainline | square | rect| circle | cross...'should have consistent spacing as'... | rect | circle | ...'.Apply this diff:
type: { - summary: 'line | plainline | square | rect| circle | cross | diamond | square | star | triangle | wye | none', + summary: 'line | plainline | square | rect | circle | cross | diamond | square | star | triangle | wye | none', },src/component/Tooltip.tsx (1)
112-119: ClarifyincludeHiddendefault in code vs omnidoc defaultsBehaviorally,
includeHiddendefaults to “false” because the filter usesentry.hide !== true || props.includeHidden, soundefinedbehaves the same asfalse. However,defaultTooltipPropsdoesn’t declareincludeHidden, while the JSDoc documents@defaultValue false. If omnidoc relies only ondefaultTooltipProps, the default for this prop may appear missing.Consider explicitly adding
includeHidden: falsetodefaultTooltipPropsto keep runtime behavior, JSDoc, and generated docs perfectly aligned.Also applies to: 163-181, 264-270
src/polar/Pie.tsx (1)
272-278: AlignzIndexdocumentation withDefaultZIndexes.areaThe
zIndexJSDoc advertises@defaultValue 100, while the actual default comes fromDefaultZIndexes.area. IfDefaultZIndexes.areais not guaranteed to be100(or might change in the future), the numeric literal in the docs can become stale.Consider either:
- Documenting the symbolic default (e.g. “defaults to
DefaultZIndexes.area”), or- Ensuring
DefaultZIndexes.areais locked to100and updating the comment if that ever changes.Also applies to: 808-831
www/src/docs/api/RadialBar.ts (1)
5-25: Deprecatedcx/cydefaults may not reflect actual behavior
cxandcyare markeddeprecated: truewith numeric defaults of0, but the RadialBar implementation derivescx/cyfrom the chart’s radial axes andcomputeRadialBarDataItems, and does not use the RadialBar-levelcx/cyprops for geometry.If these props are effectively no-ops now, consider either dropping their
defaultValentries or clarifying in the description that they are ignored and scheduled for removal. That would better align the docs with the PR goal of removing ineffective defaults.Also applies to: 61-69
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (67)
omnidoc/componentsAndDefaultPropsMap.ts(1 hunks)omnidoc/readProject.spec.ts(1 hunks)src/cartesian/ErrorBar.tsx(1 hunks)src/cartesian/Funnel.tsx(3 hunks)src/chart/CartesianChart.tsx(2 hunks)src/component/Label.tsx(1 hunks)src/component/Legend.tsx(2 hunks)src/component/Tooltip.tsx(2 hunks)src/component/TooltipBoundingBox.tsx(1 hunks)src/polar/Pie.tsx(4 hunks)src/polar/PolarAngleAxis.tsx(1 hunks)src/polar/PolarGrid.tsx(1 hunks)src/polar/PolarRadiusAxis.tsx(2 hunks)src/polar/Radar.tsx(3 hunks)src/polar/RadialBar.tsx(2 hunks)src/polar/defaultPolarAngleAxisProps.tsx(1 hunks)src/polar/defaultPolarRadiusAxisProps.tsx(1 hunks)src/shape/Curve.tsx(1 hunks)src/shape/Rectangle.tsx(3 hunks)src/shape/Sector.tsx(2 hunks)src/shape/Trapezoid.tsx(2 hunks)src/util/types.ts(5 hunks)storybook/stories/API/cartesian/Funnel.stories.tsx(2 hunks)storybook/stories/API/component/Legend.stories.tsx(3 hunks)storybook/stories/API/component/Tooltip.stories.tsx(2 hunks)storybook/stories/API/hooks/useActiveTooltipDataPoints.stories.tsx(2 hunks)storybook/stories/API/polar/Pie.stories.tsx(6 hunks)storybook/stories/API/polar/PolarAngleAxis.stories.tsx(0 hunks)storybook/stories/API/polar/PolarGrid.stories.tsx(3 hunks)storybook/stories/API/polar/PolarRadiusAxis.stories.tsx(2 hunks)storybook/stories/API/polar/Radar.stories.tsx(3 hunks)storybook/stories/API/polar/RadialBar.stories.tsx(2 hunks)storybook/stories/API/props/CartesianComponentShared.ts(0 hunks)storybook/stories/API/props/Legend.ts(2 hunks)storybook/stories/API/props/PolarComponentShared.ts(1 hunks)storybook/stories/API/props/RadialBarArgTypes.ts(1 hunks)storybook/stories/API/props/TooltipArgTypes.tsx(3 hunks)storybook/stories/API/shapes/Rectangle.stories.tsx(2 hunks)storybook/stories/API/shapes/Trapezoid.stories.tsx(2 hunks)storybook/stories/Examples/Tooltip.stories.tsx(17 hunks)test/chart/RadialBarChart.spec.tsx(1 hunks)test/component/Tooltip/Tooltip.content.spec.tsx(2 hunks)test/polar/Radar.spec.tsx(2 hunks)www/src/docs/api/AreaChart.ts(5 hunks)www/src/docs/api/BarChart.ts(6 hunks)www/src/docs/api/ComposedChart.ts(6 hunks)www/src/docs/api/Cross.ts(6 hunks)www/src/docs/api/Curve.ts(2 hunks)www/src/docs/api/Dot.ts(0 hunks)www/src/docs/api/Funnel.ts(5 hunks)www/src/docs/api/FunnelChart.ts(1 hunks)www/src/docs/api/LabelList.ts(2 hunks)www/src/docs/api/Legend.ts(4 hunks)www/src/docs/api/LineChart.ts(3 hunks)www/src/docs/api/Pie.ts(16 hunks)www/src/docs/api/PolarAngleAxis.ts(6 hunks)www/src/docs/api/PolarGrid.ts(0 hunks)www/src/docs/api/PolarRadiusAxis.ts(7 hunks)www/src/docs/api/Polygon.ts(0 hunks)www/src/docs/api/Radar.ts(5 hunks)www/src/docs/api/RadialBar.ts(7 hunks)www/src/docs/api/Rectangle.ts(5 hunks)www/src/docs/api/ResponsiveContainer.ts(4 hunks)www/src/docs/api/ScatterChart.ts(1 hunks)www/src/docs/api/Sector.ts(8 hunks)www/src/docs/api/Tooltip.ts(13 hunks)www/src/docs/api/types.ts(1 hunks)
💤 Files with no reviewable changes (5)
- storybook/stories/API/polar/PolarAngleAxis.stories.tsx
- www/src/docs/api/Polygon.ts
- storybook/stories/API/props/CartesianComponentShared.ts
- www/src/docs/api/PolarGrid.ts
- www/src/docs/api/Dot.ts
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6659
File: www/src/components/GuideView/Performance/index.tsx:232-250
Timestamp: 2025-11-19T14:08:01.728Z
Learning: In Recharts version 3.4.2, object-as-prop optimizations were introduced to reduce unnecessary re-renders when new object references are passed as props. This affects the recommendation for the `react-perf/jsx-no-new-object-as-prop` ESLint rule.
📚 Learning: 2025-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:
storybook/stories/API/props/TooltipArgTypes.tsxwww/src/docs/api/Tooltip.tstest/polar/Radar.spec.tsxwww/src/docs/api/Radar.tswww/src/docs/api/RadialBar.tswww/src/docs/api/Pie.tswww/src/docs/api/Funnel.tssrc/polar/Pie.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/polar/PolarRadiusAxis.tsxsrc/chart/CartesianChart.tsxsrc/polar/Radar.tsxsrc/polar/RadialBar.tsx
🧬 Code graph analysis (27)
storybook/stories/API/hooks/useActiveTooltipDataPoints.stories.tsx (2)
storybook/stories/API/props/TooltipArgTypes.tsx (1)
TooltipArgTypes(3-194)storybook/stories/API/props/utils.ts (1)
getStoryArgsFromArgsTypesObject(5-16)
src/component/Label.tsx (1)
src/component/Text.tsx (1)
RenderableText(66-66)
src/polar/PolarGrid.tsx (1)
src/state/cartesianAxisSlice.ts (1)
AxisId(8-8)
storybook/stories/API/props/TooltipArgTypes.tsx (1)
storybook/StorybookArgs.ts (1)
StorybookArgs(59-61)
src/shape/Sector.tsx (1)
src/util/resolveDefaultProps.tsx (1)
resolveDefaultProps(16-53)
test/chart/RadialBarChart.spec.tsx (2)
src/polar/RadialBar.tsx (1)
RadialBar(633-658)src/index.ts (1)
RadialBar(59-59)
storybook/stories/API/component/Tooltip.stories.tsx (2)
storybook/stories/API/props/TooltipArgTypes.tsx (1)
TooltipArgTypes(3-194)storybook/stories/API/props/utils.ts (1)
getStoryArgsFromArgsTypesObject(5-16)
storybook/stories/API/component/Legend.stories.tsx (2)
storybook/stories/API/props/Legend.ts (1)
LegendArgTypes(17-171)storybook/stories/API/props/utils.ts (1)
getStoryArgsFromArgsTypesObject(5-16)
src/polar/PolarRadiusAxis.tsx (2)
src/util/types.ts (2)
TickItem(775-780)PolarViewBoxRequired(814-814)src/util/ChartUtils.ts (1)
RechartsScale(152-164)
www/src/docs/api/Tooltip.ts (1)
www/src/docs/api/types.ts (1)
ApiDoc(20-26)
src/shape/Rectangle.tsx (3)
src/util/types.ts (1)
AnimationDuration(605-605)src/animation/easing.ts (1)
EasingInput(144-144)src/util/resolveDefaultProps.tsx (1)
resolveDefaultProps(16-53)
storybook/stories/Examples/Tooltip.stories.tsx (2)
storybook/stories/API/props/TooltipArgTypes.tsx (1)
TooltipArgTypes(3-194)storybook/stories/API/props/utils.ts (1)
getStoryArgsFromArgsTypesObject(5-16)
src/cartesian/ErrorBar.tsx (1)
src/util/types.ts (1)
AnimationTiming(603-603)
src/shape/Trapezoid.tsx (1)
src/util/resolveDefaultProps.tsx (1)
resolveDefaultProps(16-53)
src/component/Tooltip.tsx (6)
src/util/types.ts (3)
AllowInDimension(83-86)AnimationDuration(605-605)AnimationTiming(603-603)src/state/cartesianAxisSlice.ts (1)
AxisId(8-8)src/component/DefaultLegendContent.tsx (1)
ContentType(20-20)src/component/Cursor.tsx (1)
CursorDefinition(32-32)src/state/tooltipSlice.ts (2)
TooltipIndex(38-38)TooltipPayload(29-29)src/chart/types.ts (1)
TooltipTrigger(4-4)
src/cartesian/Funnel.tsx (3)
src/util/types.ts (4)
AnimationDuration(605-605)AnimationTiming(603-603)DataKey(60-60)LegendType(69-80)src/component/LabelList.tsx (1)
ImplicitLabelListType(85-85)src/index.ts (1)
LegendType(111-111)
omnidoc/componentsAndDefaultPropsMap.ts (12)
src/chart/CartesianChart.tsx (1)
defaultCartesianChartProps(15-25)src/cartesian/Funnel.tsx (1)
defaultFunnelProps(395-407)src/component/Legend.tsx (1)
legendDefaultProps(155-161)src/polar/Pie.tsx (1)
defaultPieProps(808-831)src/polar/defaultPolarAngleAxisProps.tsx (1)
defaultPolarAngleAxisProps(4-20)src/polar/defaultPolarRadiusAxisProps.tsx (1)
defaultPolarRadiusAxisProps(4-21)src/polar/Radar.tsx (1)
defaultRadarProps(503-516)src/polar/RadialBar.tsx (1)
defaultRadialBarProps(488-505)src/shape/Rectangle.tsx (1)
defaultRectangleProps(119-133)src/shape/Sector.tsx (1)
defaultSectorProps(201-211)src/component/Tooltip.tsx (1)
defaultTooltipProps(163-181)src/shape/Trapezoid.tsx (1)
defaultTrapezoidProps(42-52)
src/chart/CartesianChart.tsx (1)
src/util/resolveDefaultProps.tsx (1)
resolveDefaultProps(16-53)
storybook/stories/API/polar/PolarGrid.stories.tsx (1)
storybook/StorybookArgs.ts (1)
StorybookArgs(59-61)
src/shape/Curve.tsx (1)
src/util/types.ts (2)
LayoutType(57-57)NullableCoordinate(93-96)
src/util/types.ts (2)
src/component/Label.tsx (1)
ImplicitLabelType(107-114)src/synchronisation/types.ts (1)
SyncMethod(32-32)
storybook/stories/API/polar/RadialBar.stories.tsx (2)
storybook/stories/API/props/RadialBarArgTypes.ts (1)
RadialBarArgTypes(8-26)storybook/stories/API/props/utils.ts (1)
getStoryArgsFromArgsTypesObject(5-16)
storybook/stories/API/props/Legend.ts (1)
storybook/StorybookArgs.ts (1)
StorybookArgs(59-61)
src/polar/Radar.tsx (4)
src/util/types.ts (7)
ActiveDotType(978-1002)AnimationDuration(605-605)AnimationTiming(603-603)DataKey(60-60)DotType(1022-1049)LegendType(69-80)TooltipType(81-81)src/component/LabelList.tsx (1)
ImplicitLabelListType(85-85)src/index.ts (1)
LegendType(111-111)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)
storybook/stories/API/polar/Pie.stories.tsx (1)
storybook/StorybookArgs.ts (1)
StorybookArgs(59-61)
src/polar/Pie.tsx (3)
src/util/types.ts (6)
ActiveShape(1051-1056)AnimationDuration(605-605)AnimationTiming(603-603)DataKey(60-60)LegendType(69-80)TooltipType(81-81)src/index.ts (3)
PieSectorDataItem(56-56)PieLabel(56-56)LegendType(111-111)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)
src/polar/RadialBar.tsx (5)
src/state/cartesianAxisSlice.ts (1)
AxisId(8-8)src/util/types.ts (5)
AnimationDuration(605-605)AnimationTiming(603-603)LegendType(69-80)ActiveShape(1051-1056)TooltipType(81-81)src/component/LabelList.tsx (1)
ImplicitLabelListType(85-85)src/index.ts (1)
LegendType(111-111)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)
⏰ 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: Analyze (javascript-typescript)
- GitHub Check: Build, Test, Pack
🔇 Additional comments (78)
src/shape/Curve.tsx (1)
101-104: Documentation improvements accurately reflect implementation defaults.The JSDoc
@defaultValueannotations correctly document the defaults applied in thegetPathfunction (lines 125 and 129). This is a documentation-only improvement that will help external consumers understand prop behavior without reading implementation details.Also applies to: 108-111
storybook/stories/API/props/PolarComponentShared.ts (4)
7-11: ConfirmangleAxisIddocumented default matches implementationYou’re now documenting a default of
'0'forangleAxisId. Please double‑check that all polar components using this prop actually default to0when it’s omitted; otherwise Omnidoc will advertise a default that isn’t really there.
15-18:stackIdarg table addition looks consistentAdding the
tablemetadata (type +Generalcategory) forstackIdis consistent with other props and keeps the default intentionally unspecified/“no default”, which matches the usual semantics of stacking.
22-26: VerifyradiusAxisIddefault'0'is actually applied at runtimeSimilar to
angleAxisId, you’re documentingradiusAxisIdas defaulting to'0'. Please confirm that the underlying components really use0as the default ID whenradiusAxisIdis omitted so Omnidoc doesn’t drift from the actual behavior.
31-35: Internaldataarg wiring matches Omnidoc/Storybook patternExporting
dataas aStorybookArgwithcategory: 'Internal'and then grouping it underInternalmirrors the pattern used elsewhere for non-user-facing props and should keep these out of the public API tables while still being available to Omnidoc.www/src/docs/api/Curve.ts (1)
8-8: LGTM! Fixed default value representations.The changes correctly standardize the default value representations:
- Line 8:
'linear'is now properly represented as a string literal without extra quotes- Line 58:
falseis now properly represented as a boolean instead of the string"'false'"These fixes ensure consistency in how defaults are documented across the API.
Also applies to: 58-58
www/src/docs/api/ComposedChart.ts (4)
10-10: LGTM! String literal standardization.The removal of extra quotes from string literal default values (
'horizontal'and'index') correctly aligns with TypeScript/JavaScript conventions and improves documentation consistency.Also applies to: 37-37
86-86: No action needed—documentation is accurate.The verification confirms that the actual default value for
barCategoryGapin the CartesianChart component is'10%', which matches the documenteddefaultVal: '10%'at line 86. The type signature allows bothPercentage | Number, but the implementation uses the percentage string'10%'as the default. No correction is required.
117-117: Verified: Boolean default value is correct.The change to
defaultVal: false(boolean) aligns with all component implementations:CartesianChart.tsx,PolarChart.tsx, androotPropsSlice.tsall use booleanfalseas the default. Type definitions insrc/util/types.tsdocument@defaultValue falsefor this boolean property. The standardization is accurate.
128-128: No issues found. The removal of 'auto' from baseValue type is correct.The BaseValue type is defined as
number | 'dataMin' | 'dataMax'in the implementation, and the code only handles these three values. 'auto' was never a valid option for baseValue, so removing it from the documentation aligns with the actual implementation and the PR's objective to remove non-functional props.test/component/Tooltip/Tooltip.content.spec.tsx (1)
34-74: Update to expectisAnimationActive: 'auto'looks correctThe test expectations now align with the Tooltip default
'auto'both before interaction and on hover; payload shape remains consistent.Also applies to: 76-177
www/src/docs/api/FunnelChart.ts (1)
23-32: Normalizedmargin.defaultValto JSON string is consistent with other docsUsing a JSON string for
margin.defaultValwhile keeping the human-readableformatentry matches the broader docs pattern and improves consistency.src/component/Label.tsx (1)
107-115: Implicit label function type now aligned withLabelContentTypeAllowing implicit label functions to return
RenderableText | ReactElement(instead of justReactElement<SVGElement>) matchesLabelContentTypeand existing runtime behavior, and removes an unnecessary typing restriction.www/src/docs/api/Cross.ts (1)
5-63: Numeric defaults normalized from string'0'to number0Switching
defaultValfor the Cross coordinates and dimensions to numeric0is consistent with the declaredNumbertype and the updatedApiProps.defaultValtyping.www/src/docs/api/BarChart.ts (1)
7-15: BarChart default values normalized to match runtime behaviorThe updated
defaultValentries forlayout,syncMethod,margin,barCategoryGap,stackOffset, andreverseStackOrdernow use proper literals/JSON strings instead of quoted representations, which better reflects the actual runtime defaults and aligns with the new default‑props/docs normalization across charts.Also applies to: 34-42, 72-81, 83-91, 134-154, 156-166
src/shape/Trapezoid.tsx (1)
42-56: ExporteddefaultTrapezoidPropsand use ofresolveDefaultPropslook soundPromoting the trapezoid defaults to an exported
defaultTrapezoidPropsand resolving props viaresolveDefaultPropspreserves existing behavior while making the defaults reusable for documentation and tooling. The default keys all matchProps, so this remains type‑safe withresolveDefaultProps.src/polar/PolarGrid.tsx (1)
21-36: PolarGrid prop defaults documented consistently with implementation
gridType = 'polygon',radialLines = true,angleAxisId = 0, andradiusAxisId = 0in the function signature line up with the new@defaultValueannotations onPolarGridProps. Looks good and should help omnidoc stay accurate.www/src/docs/api/ResponsiveContainer.ts (1)
20-62: ResponsiveContainer default metadata matches intended behavior betterSwitching
minWidthanddebouncedefaults to numeric0and dropping defaults foraspect,minHeight, andonResizemakes the docs closer to the actual API. Keepingwidth/heightat'100%'while marking them required also aligns with howResponsiveContaineris typically used.www/src/docs/api/ScatterChart.ts (1)
23-32: ScatterChartmargindefault is now machine‑ and human‑readableUsing a JSON string in
defaultValplus the JS‑style object informatis a nice balance for tooling and docs, and removing fakenulldefaults forwidth/heightavoids implying runtime defaults that don’t exist.src/polar/PolarRadiusAxis.tsx (1)
31-48: New PolarRadiusAxis props and defaults align with the axis modelAdding
radiusAxisId,angle,orientation, andreversedwith documented defaults (0 / 0 /right/false) brings the public API in line with the Redux‑backed axis model (selectPolarAxisScale/selectPolarAxisTicks) and the importeddefaultPolarRadiusAxisProps. This should make axis configuration more explicit and better documented.www/src/docs/api/Legend.ts (1)
32-32: LGTM! Default value formatting standardized.The changes consistently remove extra quotes from string default values (
'horizontal','center','bottom') and keep numeric values unquoted (14), improving documentation consistency across the API surface.Also applies to: 42-42, 57-57, 72-72
www/src/docs/api/Radar.ts (3)
35-35: LGTM! Default values align with expanded public API.The explicit
falsedefaults fordotandlabel, and'rect'forlegendTypecorrectly document the new default prop surface for Radar components.Also applies to: 47-47, 57-57
68-69: LGTM! The 'auto' mode is preparatory work for SSR support.The updated type and default value for
isAnimationActiveto include and default to'auto'aligns with the broader pattern across components. Based on learnings, this is preparatory work for future SSR support.
99-99: LGTM! Animation easing default documented.The
'ease'default foranimationEasingis now explicitly documented.storybook/stories/API/shapes/Trapezoid.stories.tsx (3)
5-5: LGTM! Import cleanup.Removing
isAnimationActivefrom the import aligns with the new pattern of defining animation controls directly in argTypes.
170-196: LGTM! Explicit table metadata improves Storybook documentation.Adding table metadata with type summaries and default values (0) for
upperWidth,lowerWidth,x, andyprovides better control visibility in Storybook.
201-208: LGTM! New animation control exposed.The
isUpdateAnimationActiveargType withboolean | "auto"type andfalsedefault provides explicit animation control for component updates, consistent with the broader animation control pattern across components.www/src/docs/api/AreaChart.ts (3)
13-13: LGTM! String default values standardized.The default values for
layout('horizontal'),syncMethod('index'), andstackOffset('none') are now consistently formatted without extra quotes.Also applies to: 40-40, 89-89
78-78: LGTM! Margin default now uses JSON string format.The margin default value is now represented as a JSON string (
'{"top":5,"right":5,"bottom":5,"left":5}'), standardizing the representation of object defaults across the documentation.
110-110: The review comment is based on incorrect assumptions about a non-existent breaking change.The verification shows that the
BaseValuetype definition insrc/cartesian/Area.tsx(line 74) isnumber | 'dataMin' | 'dataMax', which exactly matches the documentation atwww/src/docs/api/AreaChart.ts(line 110). There is no evidence that the'auto'option ever existed forbaseValuein the codebase—a comprehensive search found zero occurrences ofbaseValuepaired with'auto'. The current documentation is accurate and reflects the actual type definition with no breaking changes present.Likely an incorrect or invalid review comment.
test/polar/Radar.spec.tsx (1)
314-314: LGTM! Test expectations align with expanded Radar public API.Adding
label: falseto the expected event payloads correctly reflects the new default value in the expandedRadarPropsinterface, ensuring tests validate the complete payload shape.Also applies to: 342-342
storybook/stories/API/hooks/useActiveTooltipDataPoints.stories.tsx (1)
7-7: LGTM! Migration to TooltipArgTypes pattern.The refactoring from
TooltipPropstoTooltipArgTypesaligns with the broader pattern of using dedicated ArgTypes objects for Storybook stories, improving the separation between component prop types and Storybook documentation types.Also applies to: 11-11, 37-37
omnidoc/readProject.spec.ts (1)
866-866: Test focus changed fromlayouttoidproperty.The test now verifies that
AreaChart.idhas no default value instead of testingAreaChart.layout. This aligns with the PR's goal of standardizing default values—layoutnow has an explicit default (documented in AreaChart.ts as'horizontal'), whileidcorrectly has no default.storybook/stories/API/polar/RadialBar.stories.tsx (1)
6-6: LGTM! Migration to RadialBarArgTypes pattern.The refactoring from
RadialBarPropstoRadialBarArgTypesis consistent with the broader Storybook story migration pattern, using dedicated ArgTypes objects for better separation of concerns between component props and Storybook documentation.Also applies to: 10-10, 29-29
src/component/TooltipBoundingBox.tsx (1)
14-27:isAnimationActive: boolean | 'auto'wiring looks consistentAllowing
'auto'inTooltipBoundingBoxPropsand using it in thetransitioncondition viaisAnimationActive && activekeeps runtime behavior sane ('auto'behaves like enabled). This aligns with the wider move to'auto'defaults without introducing branching changes here.Also applies to: 113-124
src/polar/defaultPolarRadiusAxisProps.tsx (1)
4-21: Explicitlabel: falsedefault is appropriateSetting
label: falseindefaultPolarRadiusAxisPropsmatches the “no label by default” behavior and keeps docs and runtime defaults aligned.src/shape/Sector.tsx (1)
191-211: ExporteddefaultSectorProps+resolveDefaultPropsis a solid refactorThe new
defaultSectorPropssurface is well‑typed (satisfies Partial<Props>), and usingresolveDefaultPropskeeps FC defaults explicit and reusable (e.g., via omnidoc) without changing rendering logic.Also applies to: 213-226
storybook/stories/API/component/Tooltip.stories.tsx (1)
6-12: Switch toTooltipArgTypeskeeps API story aligned with documented defaultsUsing
TooltipArgTypesboth forargTypesand for seedingargsviagetStoryArgsFromArgsTypesObjectis consistent with the props-docs refactor and should keep the story in sync with the Tooltip documentation.Also applies to: 38-44
storybook/stories/API/polar/PolarRadiusAxis.stories.tsx (1)
33-45: Domain table metadata change is safeThe updated
domaintable metadata (type'Array | Function', category'General') is purely documentary and doesn’t affect runtime behavior; it looks fine.src/component/Legend.tsx (1)
91-114:legendDefaultPropsexport and usage look correctExporting
legendDefaultPropsand resolving props throughresolveDefaultPropsmakes the Legend defaults explicit and reusable (e.g., for omnidoc) without changing behavior. The values (align, layout, verticalAlign, iconSize, itemSorter) match the documented defaults and the new@defaultValueonitemSorter.Also applies to: 155-161, 163-179
test/chart/RadialBarChart.spec.tsx (1)
376-393: Test now relies on chart/default RadialBar angles, which matches the new APIUsing
<RadialBar label={label} background dataKey="uv" isAnimationActive={false} />withoutstartAngle/endAngleis consistent with the RadialBar API tightening. The assertion still validates that 7 sectors are rendered, without depending on props that no longer exist.src/polar/defaultPolarAngleAxisProps.tsx (1)
9-9: LGTM!The addition of
axisLineType: 'polygon'as a default prop aligns with the expanded public API surface for PolarAngleAxis.www/src/docs/api/Rectangle.ts (1)
7-7: LGTM!The standardization of default values from string
'0'to number0improves consistency with the runtime defaults indefaultRectanglePropsand matches the documented type of 'Number'.Also applies to: 17-17, 27-27, 37-37, 47-47
storybook/stories/API/cartesian/Funnel.stories.tsx (1)
27-56: LGTM!The migration from imported props to inline argTypes with comprehensive metadata (description, type, defaultValue, category) improves Storybook documentation and control generation. The default values align with the expanded Funnel component API.
storybook/stories/API/component/Legend.stories.tsx (1)
5-5: LGTM!The refactor from
LegendPropstoLegendArgTypesimproves semantic clarity, as these are Storybook argument type definitions rather than component props. The change is consistent with the broader pattern of using typedStorybookArgsacross the codebase.Also applies to: 10-10, 39-39, 102-102
src/shape/Rectangle.tsx (3)
75-114: LGTM!The JSDoc
@defaultValuecomments provide clear inline documentation for the Rectangle props, improving developer experience and API discoverability.
119-133: LGTM!The exported
defaultRectanglePropsconstant provides a single source of truth for Rectangle defaults, typed withas const satisfies Partial<Props>for type safety. This aligns with the broader pattern of exporting default props across shape and chart components.
136-136: LGTM!The usage of
resolveDefaultPropswith the exporteddefaultRectanglePropsensures type-safe default resolution and maintains consistency with the new pattern across the codebase.Also applies to: 191-191
src/chart/CartesianChart.tsx (2)
15-25: LGTM!The exported
defaultCartesianChartPropsprovides a centralized, type-safe source of defaults for Cartesian chart components. The defaults are sensible:layout: 'horizontal',responsive: false,stackOffset: 'none', andaccessibilityLayer: truealign with typical chart usage patterns.
44-44: LGTM!The use of
resolveDefaultPropsensures type-safe default resolution and is consistent with the refactoring pattern across the codebase.storybook/stories/API/polar/Pie.stories.tsx (3)
9-9: LGTM!The adoption of
StorybookArgstype forGeneralPropsimproves type safety and aligns with the Storybook typing standards used across other story files.Also applies to: 11-11
12-143: LGTM!The restructuring of argTypes with proper placement of
defaultValueat the table level improves consistency and readability. The documented defaults are sensible for a Pie chart component:cx: '50%',cy: '50%',outerRadius: '80%',innerRadius: 0,startAngle: 0,endAngle: 360.
151-158: LGTM!The addition of
animationBeginwith a default value of 400ms is consistent with other chart components and provides clear documentation for the animation delay prop.storybook/stories/API/polar/Radar.stories.tsx (3)
8-8: LGTM!The migration to
StorybookArgstype improves type safety and consistency with the Storybook typing patterns used across the codebase.Also applies to: 10-10, 32-32, 45-45
24-28: LGTM!Adding
defaultValueentries to thedotandlabelprop tables improves documentation clarity by explicitly showing that both default tofalse.Also applies to: 37-41
64-73: LGTM!The inline
legendTypeargType with comprehensive type documentation and default value of'rect'provides clear documentation and aligns with the pattern used in other polar component stories.www/src/docs/api/Sector.ts (1)
7-7: LGTM! Default value standardization is consistent.The conversion from string literals to primitive types (e.g.,
'0'→0,'false'→false) standardizes the default value representation across the API documentation and aligns with the broader PR pattern.Also applies to: 17-17, 27-27, 37-37, 47-47, 57-57, 67-67, 77-77
storybook/stories/API/shapes/Rectangle.stories.tsx (1)
174-186: Verify the defaultValue discrepancy between argTypes and story args.The argTypes define
defaultValue: falsefor bothisAnimationActiveandisUpdateAnimationActive, but the API story args (lines 370-371) set them totrue. This might be intentional (story-specific overrides), but please confirm this is the expected behavior.src/util/types.ts (2)
755-755: LGTM! Type consolidation improves maintainability.The change from an inline union type to
ImplicitLabelTypeconsolidates the type definition and improves maintainability. The relevant code snippet confirms thatImplicitLabelTypeincludes all the necessary type options (boolean, string, number, ReactElement, function, and Props object).
1084-1144: LGTM! Default value documentation enhances API clarity.The addition of JSDoc
@defaultValuecomments for CartesianChartProps properties provides valuable documentation for developers using these props. The default values align with the broader PR pattern of documenting defaults explicitly.www/src/docs/api/LineChart.ts (2)
7-7: LGTM! Default value standardization is consistent.Removing the surrounding quotes from string literals (
'horizontal'and'index') aligns the representation with primitive types and standardizes the documentation format across the codebase.Also applies to: 34-34
42-67: LGTM! Removal of defaultVal for required props is correct.The
width,height, anddataproperties are marked asisOptional: false, indicating they are required props. RemovingdefaultValfor these required properties is appropriate since they must be explicitly provided by the user.storybook/stories/API/polar/PolarGrid.stories.tsx (1)
30-45: Verify the argType structure for defaultValue placement.The
defaultValueis placed inside thetableobject (lines 34, 42), which is non-standard for Storybook argTypes. Typically,defaultValueshould be at the top level of the argType definition, not nested withintable. This structure might prevent Storybook from correctly recognizing and displaying the default values in the controls panel.Expected structure:
gridType: { description: 'The type of polar grids.', defaultValue: 'polygon', // at top level table: { type: { summary: "'polygon' | 'circle'" }, category: 'General', }, }www/src/docs/api/Funnel.ts (2)
63-64: LGTM! Animation default aligns with SSR preparatory work.The change to
isAnimationActivesupporting'auto'as the default value is consistent with the broader pattern across the codebase for preparing SSR support. Based on learnings, this mode is preparatory work for future SSR implementation.
26-26: LGTM! Default value documentation is consistent.The defaultVal entries use appropriate primitive types (numbers and strings) and align with the standardization pattern across the PR.
Also applies to: 36-36, 74-74, 94-94
storybook/stories/Examples/Tooltip.stories.tsx (1)
23-23: LGTM! Consistent migration to TooltipArgTypes.The change from
TooltipPropstoTooltipArgTypesis applied consistently across all imports, exports, and function calls throughout the file. This aligns with the broader PR pattern of standardizing Storybook argument type naming conventions.Also applies to: 27-27, 51-51, 80-80, 133-133, 182-182, 220-220, 227-227, 275-275, 307-307, 336-336, 355-355, 376-376, 402-402, 440-440, 486-486, 515-515, 554-554, 574-574
src/component/Tooltip.tsx (1)
92-105: AxisaxisIdis now correctly wired into tooltip state
axisIdis documented with a default of0and fed throughdefaultTooltipPropsandsetTooltipSettingsState, so it finally drives tooltip behavior instead of being a no-op. TheuseEffectdependency list (shared,trigger,axisId,activeFromProps,defaultIndexAsString) also looks complete and avoids stale settings.Also applies to: 183-221
www/src/docs/api/PolarRadiusAxis.ts (1)
5-7: Radius axis default values look consistent; just keep them in sync with runtime defaultsThe documented defaults for
angle,type,allowDuplicatedCategory,reversed,label,axisLine, andtickmatch the expected behavior ofPolarRadiusAxisand align with typical axis defaults in the codebase. Please just double‑check they stay in lock‑step with the actual default props (e.g.,defaultPolarRadiusAxisProps) so omnidoc and runtime never diverge.Also applies to: 15-18, 25-28, 52-55, 62-65, 84-87, 95-98
www/src/docs/api/PolarAngleAxis.ts (1)
43-48: Angle axis defaults line up with the new angle-axis defaultsThe documented defaults for
axisLine,axisLineType,tickLine,tick,type = 'category', andallowDuplicatedCategoryall look correct and in line with the newdefaultPolarAngleAxisPropspattern. Just ensure these values always mirror the actual exported defaults so omnidoc and the runtime behavior can’t drift apart.Also applies to: 54-57, 64-67, 75-78, 115-118, 125-128
src/polar/Pie.tsx (1)
188-191:isAnimationActive: 'auto'wiring matches the SSR‑prep patternWidening
isAnimationActivetoboolean | 'auto'in bothInternalPiePropsandPieProps, and defaulting it to'auto'indefaultPieProps, is consistent with the newer animation pattern (defer SSR decisions to animation logic rather than baking inGlobal.isSsr).SectorsWithAnimationpasses this straight through toJavascriptAnimate, so as long asJavascriptAnimatealready understands'auto'(as in other chart components), this should behave as intended.Based on learnings, this lines up with the existing SSR preparation work around
'auto'animation defaults.Also applies to: 199-218, 808-831, 705-753
src/cartesian/Funnel.tsx (1)
65-86: Funnel defaults and'auto'animation wiring are consistent with the new pattern
InternalFunnelPropsandFunnelPropsnow both allowisAnimationActive?: boolean | 'auto', anddefaultFunnelPropscentralizes the defaults for animation timing,hide,lastShapeType,legendType, andnameKey. UsingdefaultFunnelPropsboth inresolveDefaultPropsand asFunnel.defaultPropskeeps runtime behavior and omnidoc defaults aligned, whileTrapezoidsWithAnimationcleanly forwardsisAnimationActiveintoJavascriptAnimate.Looks good; just ensure
JavascriptAnimate’sisActiveprop supports the'auto'value consistently with other components.Also applies to: 91-135, 395-407, 268-316
omnidoc/componentsAndDefaultPropsMap.ts (1)
17-28: New component→defaultProps wiring looks consistentThe added imports and
componentMetaMapentries (AreaChart/BarChart/ComposedChart/Funnel/FunnelChart/Legend/LineChart/Pie/PolarAngleAxis/PolarRadiusAxis/Radar/RadialBar/Rectangle/ScatterChart/Sector/Tooltip/Trapezoid) all point to the matchingdefault*Propsexports shown in the runtime code. This should give Omnidoc an accurate view of actual defaults without affecting behavior.Also applies to: 36-63
src/polar/PolarAngleAxis.tsx (1)
31-93: Prop defaults are now explicitly documented and aligned with runtime defaultsThe added
@defaultValueannotations onPolarAngleAxisPropsmatch the values indefaultPolarAngleAxisProps(e.g.,axisLine: true,axisLineType: 'polygon',orientation: 'outer',tick: true,tickLine: true,tickSize: 8,type: 'category',zIndex: DefaultZIndexes.axis). This makes the public API surface much clearer without changing behavior.www/src/docs/api/Pie.ts (1)
5-8: Pie docs now accurately mirrordefaultPiePropsThe updated
defaultValentries and widenedisAnimationActivetype (Boolean | "auto") align withdefaultPiePropsinsrc/polar/Pie.tsx. This removes stale or misleading defaults for props likedata,shape,activeShape, andinactiveShapewhile accurately documenting the real runtime defaults.Also applies to: 16-19, 27-30, 39-42, 72-75, 82-85, 98-101, 108-111, 118-121, 128-131, 146-149, 208-211, 218-221, 228-231, 238-241, 248-251
src/polar/RadialBar.tsx (1)
187-268: Animation and default-props integration for RadialBar looks coherent
SectorsWithAnimationcleanly threadsisAnimationActive,animationBegin,animationDuration,animationEasing, and the newonAnimationStart/onAnimationEndcallbacks intoJavascriptAnimate, and uses a stablepreviousSectorsReffor smooth transitions.defaultRadialBarPropsnow centralizes the RadialBar defaults, andRadialBarusesresolveDefaultPropsplusSetPolarGraphicalItem/SetRadialBarPayloadLegend/RadialBarImplconsistently with those defaults.- Omnidoc and the RadialBar docs are wired to this same
defaultRadialBarProps, so the public documentation should stay in sync with runtime behavior going forward.Assuming existing tests for RadialBar animation still pass, the refactor looks good.
It’s worth running the RadialBar chart tests and a quick manual check of an animated RadialBarChart story to ensure the
'auto'animation mode behaves as expected withJavascriptAnimate.Also applies to: 488-505, 633-657
src/polar/Radar.tsx (3)
14-14: LGTM!The import of
ImplicitLabelListTypeis correctly used for thelabelprop type declaration and aligns with the component's labeling functionality.
503-516: Well-structured default props export!Exporting
defaultRadarPropsaligns with the PR's objective to make default values explicit and discoverable. The type assertionas const satisfies Partial<Props>provides excellent type safety while preserving literal types.The defaults correctly match their JSDoc documentation (pending zIndex verification already noted above).
60-120: JSDoc documentation is accurate—no changes needed.Verification confirms that the documented
@defaultValue 100forzIndexmatches the implementation:DefaultZIndexes.area = 100(line 515 in Radar.tsx).All JSDoc
@defaultValueannotations throughout this interface accurately reflect the corresponding default values indefaultRadarProps.
| name: 'margin', | ||
| type: 'Object', | ||
| defaultVal: '{ top: 5, right: 5, bottom: 5, left: 5 }', | ||
| defaultVal: '{"top":5,"right":5,"bottom":5,"left":5}', |
There was a problem hiding this comment.
Verify: inconsistent margin representations.
The defaultVal uses compact JSON format ('{"top":5,"right":5,"bottom":5,"left":5}') while the format field on line 81 shows a spaced JS object literal ({ top: 5, right: 5, bottom: 5, left: 5 }). Consider standardizing both to use the same representation for consistency, or clarify if they serve different purposes (machine parsing vs human readability).
Also applies to: 81-81
🤖 Prompt for AI Agents
In www/src/docs/api/ComposedChart.ts around lines 75 and 81, the margin
defaultVal is a compact JSON string ('{"top":5,"right":5,"bottom":5,"left":5}')
while the format example is a spaced JS object literal ({ top: 5, right: 5,
bottom: 5, left: 5 }), causing inconsistency; update one or the other so both
use the same representation (either change defaultVal to a spaced/pretty JSON
string matching the format example, or change the format example to the compact
JSON style) and ensure the chosen form is applied consistently across these
lines and any similar props in this file.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6673 +/- ##
==========================================
- Coverage 94.03% 94.01% -0.02%
==========================================
Files 497 497
Lines 42609 42485 -124
Branches 4871 4871
==========================================
- Hits 40066 39942 -124
Misses 2538 2538
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/polar/RadialBar.tsx (1)
326-326: Consider adding JSDoc default value documentation.The
labelprop has a default value offalsedefined at line 500, but lacks a@defaultValueJSDoc comment. For consistency with the other props that received JSDoc documentation in this PR, consider adding it.Apply this diff:
label?: ImplicitLabelListType; + /** + * @defaultValue false + */ + label?: ImplicitLabelListType;src/polar/PolarRadiusAxis.tsx (1)
31-49: Documented defaults are currently in sync; recommendation to add validation is valid but not yet implementedThe
@defaultValuetags forradiusAxisId(0),angle(0),orientation('right'), andreversed(false) match the values indefaultPolarRadiusAxisProps. However, no existing test or lint rule enforces this synchronization across the codebase. The suggestion to add a test or lint to prevent drift is valid and would improve long-term maintainability, but it is not currently implemented.src/polar/Pie.tsx (1)
199-278: Keep Pie's@defaultValueJSDoc anddefaultPiePropsin sync (especiallyzIndex)The new JSDoc defaults on
PiePropsare well-aligned withdefaultPieProps, which is excellent for documentation accuracy.However, there's a subtle coupling point: JSDoc documents
zIndexas@defaultValue 100, whiledefaultPiePropscorrectly useszIndex: DefaultZIndexes.area(which is currently100). IfDefaultZIndexes.areaever changes, the JSDoc will drift from reality.To prevent this:
- Replace the hardcoded
@defaultValue 100in PieProps with a reference to the constant (e.g.,@defaultValue DefaultZIndexes.area), or- Add a minimal test asserting that JSDoc
@defaultValuestrings match actual defaults where both are present.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/polar/Pie.tsx(4 hunks)src/polar/PolarRadiusAxis.tsx(2 hunks)src/polar/RadialBar.tsx(3 hunks)storybook/stories/API/props/TooltipArgTypes.tsx(2 hunks)www/src/docs/api/LabelList.ts(2 hunks)www/src/docs/api/Legend.ts(5 hunks)www/src/docs/api/RadialBar.ts(7 hunks)www/src/docs/api/types.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- storybook/stories/API/props/TooltipArgTypes.tsx
🧰 Additional context used
🧠 Learnings (3)
📚 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/polar/RadialBar.tsx
📚 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:
www/src/docs/api/RadialBar.tssrc/polar/Pie.tsx
📚 Learning: 2025-11-23T13:30:10.388Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.388Z
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/polar/Pie.tsx
🧬 Code graph analysis (4)
src/polar/PolarRadiusAxis.tsx (2)
src/util/types.ts (2)
TickItem(775-780)PolarViewBoxRequired(814-814)src/util/ChartUtils.ts (1)
RechartsScale(152-164)
www/src/docs/api/Legend.ts (1)
www/src/docs/api/types.ts (1)
ApiDoc(20-26)
src/polar/RadialBar.tsx (6)
src/util/types.ts (5)
ActiveShape(1051-1056)AnimationDuration(605-605)AnimationTiming(603-603)LegendType(69-80)TooltipType(81-81)src/zIndex/ZIndexLayer.tsx (1)
ZIndexable(14-23)src/state/cartesianAxisSlice.ts (1)
AxisId(8-8)src/component/LabelList.tsx (1)
ImplicitLabelListType(85-85)src/index.ts (1)
LegendType(111-111)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)
src/polar/Pie.tsx (3)
src/util/types.ts (6)
ActiveShape(1051-1056)AnimationDuration(605-605)AnimationTiming(603-603)DataKey(60-60)LegendType(69-80)TooltipType(81-81)src/index.ts (3)
PieSectorDataItem(56-56)PieLabel(56-56)LegendType(111-111)src/component/DefaultTooltipContent.tsx (1)
TooltipType(16-16)
⏰ 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 (13)
www/src/docs/api/LabelList.ts (2)
53-57: Verify that offset defaultVal numeric type matches the LabelList runtime defaultFrom examination of the codebase, the documentation change is verified as correct:
Runtime Default: The
defaultLabelPropsinsrc/component/Label.tsxexplicitly setsoffset: 5as a number, and LabelList inherits fromLabelPropswhich declaresoffsetasnumberwith JSDoc@defaultValue 5.Consistent Pattern: The
LabelAPI documentation inwww/src/docs/api/Label.tsuses the same numeric default:defaultVal: 5, confirming this is the established convention in the docs.Type Alignment: The change from string literal
"5"to numeric5properly aligns the documentation with the declared'Number'type and prevents type mismatches in documentation rendering.The docs are now in sync with the actual runtime behavior.
72-76: <!-- [scratchpad_start]
[task verify_labellist_props]
Verify that the underlying LabelList prop has type='boolean' and defaultVal=false in the implementation.[observations]
- www/src/docs/api/LabelList.ts lines 72-76: Shows clockWise documented as type: 'boolean', defaultVal: false, isOptional: true
- src/component/LabelList.tsx line 55: Interface shows
clockWise?: boolean;(optional boolean type)- src/component/LabelList.tsx line 49: PolarLabelListEntry shows
clockWise?: boolean;- src/component/LabelList.tsx line 106: LabelList function destructures clockWise from props
- src/polar/Pie.tsx line 681, 690: Usage shows clockWise: false
- src/polar/RadialBar.tsx line 96, 104: Usage shows clockWise: false
- src/component/Label.tsx line 223, 227, 231: Uses clockWise in boolean context
- Storybook LabelListProps.ts line 93: Shows clockWise documented with Boolean type summary
[analysis]
- TypeScript type is correctly declared as optional boolean (
clockWise?: boolean)- Default behavior aligns with false through usage patterns in polar components (Pie, RadialBar)
- Documentation accurately reflects the prop signature
- No string form usage found; prop is consistently used as boolean throughout codebase
[pending]
None - sufficient evidence gathered.[done]
Verification complete. Documentation changes are aligned with implementation.
[scratchpad_end]Documentation
clockWiseprop is correctly typed as boolean with default falseThe verification confirms the underlying LabelList prop is correctly declared as
clockWise?: booleanin the implementation (src/component/LabelList.tsx line 55), and the default behavior isfalseas shown throughout usage in polar components (Pie, RadialBar, etc.). The documentation update in www/src/docs/api/LabelList.ts is accurate and properly aligned with the implementation.www/src/docs/api/types.ts (1)
12-12: LGTM! Type extension supports object default values.Adding
Record<string, unknown>to thedefaultValunion type appropriately extends the type system to handle object-type default values in API documentation.www/src/docs/api/Legend.ts (3)
1-3: LGTM! Proper typing improves type safety.Adding the
ApiDoctype import and annotation toLegendAPIis good practice and ensures the documentation structure adheres to the defined schema.
74-74: Correct type alignment for iconSize default.Changing
iconSizefrom string'14'to number14properly aligns the default value with its documented type'Number'.
34-34: Documentation defaults match component implementation and are properly normalized.Verification confirms all three default values at lines 34, 44, and 59 are correctly normalized as plain strings and accurately reflect the Legend component's actual defaults:
- Line 34:
layoutdefaults to'horizontal'✓- Line 44:
aligndefaults to'center'✓- Line 59:
verticalAligndefaults to'bottom'✓src/polar/RadialBar.tsx (2)
74-74: Type widening is correct and consistent.The
RadialBarBackgroundtype now correctly acceptsbooleanvalues, which aligns with the default valuebackground: falseat line 493 and the documentation.
488-505: Default values export looks good.The exported
defaultRadialBarPropsobject correctly defines default values, uses proper TypeScript constraints withas const satisfies Partial<RadialBarProps>, and aligns with the updated prop interface. TheisAnimationActive: 'auto'default is appropriate as preparatory work for future SSR support.www/src/docs/api/RadialBar.ts (1)
1-203: Documentation is consistent with code defaults.All updated default values in this documentation file correctly match the defaults defined in
src/polar/RadialBar.tsx. The type forisAnimationActive(line 72) properly includes the"auto"literal, and the default value (line 73) correctly reflects the new'auto'default.src/polar/PolarRadiusAxis.tsx (1)
57-60: Inside props/viewBox wiring looks sound and makes radius-axis geometry explicitIntersecting
InsidePropswithPolarViewBoxRequiredand then spreading...viewBoxafter...defaultsAndInputsensurescx,cy, and radii are always present and that store-derived geometry wins over any legacy axis-level values. TighteningscaletoRechartsScalealso matches how ticks and coordinates are computed elsewhere.This looks like a clean refactor with no obvious behavioral regressions.
Also applies to: 195-210
src/polar/Pie.tsx (3)
225-231:hidedocumentation now matches actual Pie behaviorThe new doc block for
hide(“If set true, the pie will not be displayed. @DefaultValue false”) correctly reflects whatPieImpldoes: it short‑circuits whenhideis truthy and renders only an empty<Layer>, and the same flag is propagated into tooltip/legend settings viaSetPieTooltipEntrySettingsandSetPolarGraphicalItem.This resolves the earlier ambiguity around whether
hidewas a no‑op and makes the prop’s semantics clear in both code and docs.Also applies to: 833-848
808-821:defaultPiePropsexport andRequiresDefaultPropsusage look correctExporting
defaultPiePropsand using it withRequiresDefaultProps<Props, typeof defaultPieProps>plusresolveDefaultPropsgives omnidoc a single, typed source of defaults and ensures the component sees those defaults at runtime.The chosen defaults (e.g.,
isAnimationActive: 'auto',label: false,labelLine: true,legendType: 'rect',minAngle: 0,nameKey: 'name',dataKey: 'value') are consistent with the existing implementation and the new JSDoc, and thesatisfies Partial<Props>constraint will catch accidental divergence on the type side.No issues from a typing or behavior standpoint.
165-197:isAnimationActive: boolean | 'auto'is correctly wired for SSR-aware animation controlThe widening to
boolean | 'auto'in bothInternalPiePropsandPiePropsis sound.JavascriptAnimateacceptsisActive?: boolean | 'auto'and resolves'auto'to!Global.isSsr, enabling automatic animation control based on SSR context. This matches the intended behavior for future SSR support.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/polar/RadialBar.tsx(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/polar/RadialBar.tsx
⏰ 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/polar/RadialBar.tsx (4)
74-74: LGTM! Type widened to support boolean values.The type change correctly allows
booleanvalues, aligning with the default value offalse(line 496) and simplifying the API for users who want to enable/disable backgrounds without customization.
279-328: Excellent documentation consistency.The
@defaultValueJSDoc comments accurately match the corresponding values indefaultRadialBarProps(lines 491-508). This improves API discoverability and IDE autocomplete experience.
330-348: Documentation looks good.The remaining
@defaultValueJSDoc comments correctly match their corresponding values indefaultRadialBarProps. Props without defaults (likemaxBarSize,tooltipType,onAnimationStart) correctly omit the annotation.
491-508: Well-structured default props export.The exported
defaultRadialBarPropsenables external consumption (Storybook, docs, tests) and provides a single source of truth for defaults. Theas const satisfiespattern ensures type safety while maintaining immutability, which helps prevent unnecessary re-renders when these defaults are used throughout the component tree.Based on learnings, object-as-prop optimizations are important in Recharts for performance.
| * @defaultValue auto | ||
| */ | ||
| isAnimationActive?: boolean | 'auto'; | ||
| label?: ImplicitLabelListType; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Add missing JSDoc default value documentation.
The label prop has a default value of false defined at line 503, but is missing a @defaultValue JSDoc comment. For consistency with other props in this interface, please add the documentation.
Apply this diff:
+ /**
+ * @defaultValue false
+ */
label?: ImplicitLabelListType;📝 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.
| label?: ImplicitLabelListType; | |
| /** | |
| * @defaultValue false | |
| */ | |
| label?: ImplicitLabelListType; |
🤖 Prompt for AI Agents
In src/polar/RadialBar.tsx around line 329, the JSDoc for the `label` prop is
missing a `@defaultValue` annotation even though `label` defaults to `false` at
line 503; update the JSDoc immediately above `label?: ImplicitLabelListType;` to
include `@defaultValue false` (matching the style and wording used for other
props in this interface) so the default is documented consistently.
Bundle ReportChanges will increase total bundle size by 569 bytes (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
Description
On several occasions I have discovered and removed props that don't do anything.
Related Issue
#6069
Summary by CodeRabbit
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.