@octanejs/recharts 0.1.62 → 0.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/package.json +5 -5
  2. package/src/animation/AnimatedItems.tsrx +36 -31
  3. package/src/animation/CSSTransitionAnimate.tsrx +1 -2
  4. package/src/animation/JavascriptAnimate.tsrx +1 -2
  5. package/src/cartesian/Area.tsrx +414 -386
  6. package/src/cartesian/AreaRevealShape.tsrx +103 -84
  7. package/src/cartesian/Bar.tsrx +343 -317
  8. package/src/cartesian/BarStack.tsrx +33 -28
  9. package/src/cartesian/CartesianAxis.tsrx +168 -165
  10. package/src/cartesian/CartesianGrid.tsrx +256 -272
  11. package/src/cartesian/ErrorBar.tsrx +108 -104
  12. package/src/cartesian/Funnel.tsrx +405 -382
  13. package/src/cartesian/GraphicalItemClipPath.tsrx +4 -8
  14. package/src/cartesian/Line.tsrx +190 -177
  15. package/src/cartesian/LineDrawShape.tsrx +14 -15
  16. package/src/cartesian/ReferenceLine.tsrx +119 -105
  17. package/src/cartesian/Scatter.tsrx +416 -398
  18. package/src/cartesian/XAxis.tsrx +39 -32
  19. package/src/cartesian/YAxis.tsrx +47 -37
  20. package/src/cartesian/ZAxis.tsrx +76 -73
  21. package/src/chart/AreaChart.tsrx +15 -11
  22. package/src/chart/BarChart.tsrx +15 -11
  23. package/src/chart/CategoricalChart.tsrx +32 -26
  24. package/src/chart/ComposedChart.tsrx +15 -11
  25. package/src/chart/FunnelChart.tsrx +15 -11
  26. package/src/chart/LineChart.tsrx +15 -11
  27. package/src/chart/PieChart.tsrx +15 -11
  28. package/src/chart/PolarChart.tsrx +45 -48
  29. package/src/chart/RadarChart.tsrx +38 -32
  30. package/src/chart/RadialBarChart.tsrx +15 -11
  31. package/src/chart/RechartsWrapper.tsrx +214 -162
  32. package/src/chart/Sankey.tsrx +412 -378
  33. package/src/chart/ScatterChart.tsrx +15 -11
  34. package/src/chart/SunburstChart.tsrx +162 -155
  35. package/src/component/ActivePoints.tsrx +19 -13
  36. package/src/component/Cursor.tsrx +25 -18
  37. package/src/component/DefaultLegendContent.tsrx +131 -127
  38. package/src/component/DefaultTooltipContent.tsrx +46 -42
  39. package/src/component/Dots.tsrx +11 -5
  40. package/src/component/Label.tsrx +69 -55
  41. package/src/component/LabelList.tsrx +32 -27
  42. package/src/component/Legend.tsrx +120 -123
  43. package/src/component/ResponsiveContainer.tsrx +18 -11
  44. package/src/component/Text.tsrx +50 -43
  45. package/src/component/Tooltip.tsrx +234 -223
  46. package/src/component/TooltipBoundingBox.tsrx +34 -34
  47. package/src/container/ClipPathProvider.tsrx +1 -3
  48. package/src/container/Layer.tsrx +5 -1
  49. package/src/container/RootSurface.tsrx +31 -21
  50. package/src/container/Surface.tsrx +15 -13
  51. package/src/context/ErrorBarContext.tsrx +5 -5
  52. package/src/polar/Pie.tsrx +541 -487
  53. package/src/polar/PolarAngleAxis.tsrx +245 -227
  54. package/src/polar/PolarGrid.tsrx +139 -127
  55. package/src/polar/PolarRadiusAxis.tsrx +204 -185
  56. package/src/polar/Radar.tsrx +274 -264
  57. package/src/polar/RadialBar.tsrx +408 -361
  58. package/src/shape/Cross.tsrx +13 -7
  59. package/src/shape/Curve.tsrx +54 -44
  60. package/src/shape/Dot.tsrx +10 -8
  61. package/src/shape/Polygon.tsrx +38 -29
  62. package/src/shape/Rectangle.tsrx +73 -28
  63. package/src/shape/Sector.tsrx +30 -18
  64. package/src/shape/Symbols.tsrx +13 -11
  65. package/src/shape/Trapezoid.tsrx +16 -11
  66. package/src/state/RechartsStoreProvider.tsrx +5 -1
  67. package/src/synchronisation/useChartSynchronisation.tsrx +8 -7
  68. package/src/util/BarUtils.tsrx +43 -40
  69. package/src/util/FunnelUtils.tsrx +5 -5
  70. package/src/util/RadialBarUtils.tsrx +3 -4
  71. package/src/util/ScatterUtils.tsrx +13 -8
  72. package/src/zIndex/ZIndexLayer.tsrx +2 -2
  73. package/src/zIndex/ZIndexPortal.tsrx +2 -8
@@ -51,193 +51,203 @@ import { getClassNameFromUnknown } from '../util/getClassNameFromUnknown';
51
51
 
52
52
  type TickOrientation = 'left' | 'right' | 'middle';
53
53
 
54
- export interface PolarRadiusAxisProps<DataPointType = any, DataValueType = any> extends Omit<
55
- RenderableAxisProps<DataPointType, DataValueType>,
56
- 'axisLine' | 'angle' | 'type' | 'tickSize' | 'domain' | 'scale' | 'tick'
57
- >, ZIndexable {
54
+ export interface PolarRadiusAxisProps<DataPointType = any, DataValueType = any>
55
+ extends
56
+ Omit<
57
+ RenderableAxisProps<DataPointType, DataValueType>,
58
+ 'axisLine' | 'angle' | 'type' | 'tickSize' | 'domain' | 'scale' | 'tick'
59
+ >,
60
+ ZIndexable {
58
61
  /**
59
- * Determines how the axis line is drawn. Options:
60
- * - `true`: the axis line is drawn with default props;
61
- * - `false`: the axis line is not visible;
62
- * - `object`: passed as props to SVG `<line>` element representing the axis line.
63
- *
64
- * @example <PolarRadiusAxis axisLine={false} />
65
- * @example <PolarRadiusAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />
66
- * @defaultValue true
67
- */
62
+ * Determines how the axis line is drawn. Options:
63
+ * - `true`: the axis line is drawn with default props;
64
+ * - `false`: the axis line is not visible;
65
+ * - `object`: passed as props to SVG `<line>` element representing the axis line.
66
+ *
67
+ * @example <PolarRadiusAxis axisLine={false} />
68
+ * @example <PolarRadiusAxis axisLine={{ stroke: 'red', strokeWidth: 2 }} />
69
+ * @defaultValue true
70
+ */
68
71
  axisLine?: boolean | SVGProps<SVGLineElement>;
69
72
  /**
70
- * The angle of the whole axis: the line, ticks and labels, everything.
71
- *
72
- * This is different from other graphical elements where angle usually means
73
- * the angle of text. Here, it means the angle of everything.
74
- *
75
- * @defaultValue 0
76
- */
73
+ * The angle of the whole axis: the line, ticks and labels, everything.
74
+ *
75
+ * This is different from other graphical elements where angle usually means
76
+ * the angle of text. Here, it means the angle of everything.
77
+ *
78
+ * @defaultValue 0
79
+ */
77
80
  angle?: number;
78
81
  /**
79
- * The type of axis.
80
- *
81
- * `category`: Treats data as distinct values.
82
- * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.
83
- *
84
- * `number`: Treats data as continuous range.
85
- * Values that are numerically closer are placed closer together on the axis.
86
- *
87
- * `auto`: the type is inferred based on the chart layout.
88
- *
89
- * @defaultValue auto
90
- */
82
+ * The type of axis.
83
+ *
84
+ * `category`: Treats data as distinct values.
85
+ * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.
86
+ *
87
+ * `number`: Treats data as continuous range.
88
+ * Values that are numerically closer are placed closer together on the axis.
89
+ *
90
+ * `auto`: the type is inferred based on the chart layout.
91
+ *
92
+ * @defaultValue auto
93
+ */
91
94
  type?: AxisDomainTypeInput;
92
95
  /**
93
- * The orientation of axis text.
94
- * @defaultValue right
95
- */
96
+ * The orientation of axis text.
97
+ * @defaultValue right
98
+ */
96
99
  orientation?: TickOrientation;
97
100
  /**
98
- * Specify the domain of axis when the axis is a number axis.
99
- *
100
- * If undefined, then the domain is calculated based on the data and dataKeys.
101
- *
102
- * The length of domain should be 2, and we will validate the values in domain.
103
- *
104
- * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',
105
- * or a function that accepts a single argument and returns a number.
106
- *
107
- * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.
108
- * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.
109
- *
110
- * @example <PolarRadiusAxis type="number" domain={['dataMin', 'dataMax']} />
111
- * @example <PolarRadiusAxis type="number" domain={[0, 'dataMax']} />
112
- * @example <PolarRadiusAxis type="number" domain={['auto', 'auto']} />
113
- * @example <PolarRadiusAxis type="number" domain={[0, 'dataMax + 1000']} />
114
- * @example <PolarRadiusAxis type="number" domain={['dataMin - 100', 'dataMax + 100']} />
115
- * @example <PolarRadiusAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />
116
- * @example <PolarRadiusAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />
117
- * @example <PolarRadiusAxis type="number" domain={[0, 100]} allowDataOverflow />
118
- */
101
+ * Specify the domain of axis when the axis is a number axis.
102
+ *
103
+ * If undefined, then the domain is calculated based on the data and dataKeys.
104
+ *
105
+ * The length of domain should be 2, and we will validate the values in domain.
106
+ *
107
+ * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',
108
+ * or a function that accepts a single argument and returns a number.
109
+ *
110
+ * If any element of domain is set to be 'auto', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.
111
+ * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.
112
+ *
113
+ * @example <PolarRadiusAxis type="number" domain={['dataMin', 'dataMax']} />
114
+ * @example <PolarRadiusAxis type="number" domain={[0, 'dataMax']} />
115
+ * @example <PolarRadiusAxis type="number" domain={['auto', 'auto']} />
116
+ * @example <PolarRadiusAxis type="number" domain={[0, 'dataMax + 1000']} />
117
+ * @example <PolarRadiusAxis type="number" domain={['dataMin - 100', 'dataMax + 100']} />
118
+ * @example <PolarRadiusAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />
119
+ * @example <PolarRadiusAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />
120
+ * @example <PolarRadiusAxis type="number" domain={[0, 100]} allowDataOverflow />
121
+ */
119
122
  domain?: AxisDomain;
120
123
  /**
121
- * Scale function determines how data values are mapped to visual values.
122
- * In other words, decided the mapping between data domain and coordinate range.
123
- *
124
- * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.
125
- *
126
- * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.
127
- *
128
- * @defaultValue auto
129
- * @example <PolarRadiusAxis scale="log" />
130
- * @example
131
- * import { scaleLog } from 'd3-scale';
132
- * const scale = scaleLog().base(Math.E);
133
- * <PolarRadiusAxis scale={scale} />
134
- */
135
- scale?: | ScaleType
136
- | CustomScaleDefinition
137
- | CustomScaleDefinition<string>
138
- | CustomScaleDefinition<number>
139
- | CustomScaleDefinition<Date>;
124
+ * Scale function determines how data values are mapped to visual values.
125
+ * In other words, decided the mapping between data domain and coordinate range.
126
+ *
127
+ * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.
128
+ *
129
+ * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.
130
+ *
131
+ * @defaultValue auto
132
+ * @example <PolarRadiusAxis scale="log" />
133
+ * @example
134
+ * import { scaleLog } from 'd3-scale';
135
+ * const scale = scaleLog().base(Math.E);
136
+ * <PolarRadiusAxis scale={scale} />
137
+ */
138
+ scale?:
139
+ | ScaleType
140
+ | CustomScaleDefinition
141
+ | CustomScaleDefinition<string>
142
+ | CustomScaleDefinition<number>
143
+ | CustomScaleDefinition<Date>;
140
144
  /**
141
- * The customized event handler of click on the ticks of this axis
142
- */
145
+ * The customized event handler of click on the ticks of this axis
146
+ */
143
147
  onClick?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
144
148
  /**
145
- * The customized event handler of mousedown on the ticks of this axis
146
- */
149
+ * The customized event handler of mousedown on the ticks of this axis
150
+ */
147
151
  onMouseDown?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
148
152
  /**
149
- * The customized event handler of mouseup on the ticks of this axis
150
- */
153
+ * The customized event handler of mouseup on the ticks of this axis
154
+ */
151
155
  onMouseUp?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
152
156
  /**
153
- * The customized event handler of mousemove on the ticks of this axis
154
- */
157
+ * The customized event handler of mousemove on the ticks of this axis
158
+ */
155
159
  onMouseMove?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
156
160
  /**
157
- * The customized event handler of mouseover on the ticks of this axis
158
- */
161
+ * The customized event handler of mouseover on the ticks of this axis
162
+ */
159
163
  onMouseOver?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
160
164
  /**
161
- * The customized event handler of mouseout on the ticks of this axis
162
- */
165
+ * The customized event handler of mouseout on the ticks of this axis
166
+ */
163
167
  onMouseOut?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
164
168
  /**
165
- * The customized event handler of mouseenter on the ticks of this axis
166
- */
169
+ * The customized event handler of mouseenter on the ticks of this axis
170
+ */
167
171
  onMouseEnter?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
168
172
  /**
169
- * The customized event handler of mouseleave on the ticks of this axis
170
- */
173
+ * The customized event handler of mouseleave on the ticks of this axis
174
+ */
171
175
  onMouseLeave?: (data: any, index: number, e: NativeMouseEvent<SVGGElement>) => void;
172
176
  /**
173
- * Allow the ticks of axis to be decimals or not.
174
- *
175
- * @defaultValue false
176
- */
177
+ * Allow the ticks of axis to be decimals or not.
178
+ *
179
+ * @defaultValue false
180
+ */
177
181
  allowDecimals?: boolean;
178
182
  /**
179
- * Controls how Recharts calculates "nice" tick values for this axis.
180
- * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.
181
- * See {@link NiceTicksAlgorithm} for a full description of each option.
182
- *
183
- * @defaultValue 'auto'
184
- */
183
+ * Controls how Recharts calculates "nice" tick values for this axis.
184
+ * Options: `'none'`, `'auto'`, `'adaptive'`, `'snap125'`.
185
+ * See {@link NiceTicksAlgorithm} for a full description of each option.
186
+ *
187
+ * @defaultValue 'auto'
188
+ */
185
189
  niceTicks?: NiceTicksAlgorithm;
186
190
  /**
187
- * @defaultValue 0
188
- */
191
+ * @defaultValue 0
192
+ */
189
193
  radiusAxisId?: string | number;
190
194
  /**
191
- * Defines how the individual label text is rendered.
192
- * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.
193
- *
194
- * If you want to customize the overall axis label, use the `label` prop instead.
195
- *
196
- * Options:
197
- * - `false`: Do not render any tick labels.
198
- * - `true`: Render tick labels with default settings.
199
- * - `object`: An object of props to be merged into the internally calculated tick props.
200
- * - `OctaneElement`: A custom React element to be used as the tick label.
201
- * - `function`: A function that returns a React element for custom rendering of tick labels.
202
- *
203
- * @defaultValue true
204
- */
195
+ * Defines how the individual label text is rendered.
196
+ * This controls the settings for individual ticks; on a typical axis, there are multiple ticks, depending on your data.
197
+ *
198
+ * If you want to customize the overall axis label, use the `label` prop instead.
199
+ *
200
+ * Options:
201
+ * - `false`: Do not render any tick labels.
202
+ * - `true`: Render tick labels with default settings.
203
+ * - `object`: An object of props to be merged into the internally calculated tick props.
204
+ * - `OctaneElement`: A custom React element to be used as the tick label.
205
+ * - `function`: A function that returns a React element for custom rendering of tick labels.
206
+ *
207
+ * @defaultValue true
208
+ */
205
209
  tick?: TickProp<PolarTickContentProps>;
206
210
  ticks?: ReadonlyArray<AxisTick>;
207
211
  /**
208
- * Z-Index of this component and its children. The higher the value,
209
- * the more on top it will be rendered.
210
- * Components with higher zIndex will appear in front of components with lower zIndex.
211
- * If undefined or 0, the content is rendered in the default layer without portals.
212
- *
213
- * @since 3.4
214
- * @defaultValue 500
215
- * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}
216
- */
212
+ * Z-Index of this component and its children. The higher the value,
213
+ * the more on top it will be rendered.
214
+ * Components with higher zIndex will appear in front of components with lower zIndex.
215
+ * If undefined or 0, the content is rendered in the default layer without portals.
216
+ *
217
+ * @since 3.4
218
+ * @defaultValue 500
219
+ * @see {@link https://recharts.github.io/en-US/guide/zIndex/ Z-Index and layers guide}
220
+ */
217
221
  zIndex?: number;
218
222
  }
219
223
 
220
- type AxisSvgProps =
221
- Omit<PresentationAttributesAdaptChildEvent<any, SVGGElement>, 'scale' | 'type' | 'ref'> & {
222
- ref?: never;
223
- };
224
+ type AxisSvgProps = Omit<
225
+ PresentationAttributesAdaptChildEvent<any, SVGGElement>,
226
+ 'scale' | 'type' | 'ref'
227
+ > & {
228
+ ref?: never;
229
+ };
224
230
 
225
- export type Props<DataPointType = any, DataValueType = any> =
226
- AxisSvgProps & PolarRadiusAxisProps<DataPointType, DataValueType>;
231
+ export type Props<DataPointType = any, DataValueType = any> = AxisSvgProps &
232
+ PolarRadiusAxisProps<DataPointType, DataValueType>;
227
233
 
228
- type PropsWithDefaults<DataPointType = any, DataValueType = any> =
229
- RequiresDefaultProps<Props<DataPointType, DataValueType>, typeof defaultPolarRadiusAxisProps>;
234
+ type PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<
235
+ Props<DataPointType, DataValueType>,
236
+ typeof defaultPolarRadiusAxisProps
237
+ >;
230
238
 
231
- type InsideProps =
232
- Omit<PropsWithDefaults, 'scale'> & PolarViewBoxRequired & {
239
+ type InsideProps = Omit<PropsWithDefaults, 'scale'> &
240
+ PolarViewBoxRequired & {
233
241
  scale: RechartsScale;
234
242
  };
235
243
 
236
244
  const AXIS_TYPE = 'radiusAxis';
237
245
 
238
- function SetRadiusAxisSettings(props: Omit<RadiusAxisSettings, 'type'> & {
239
- type: AxisDomainTypeInput;
240
- }): null {
246
+ function SetRadiusAxisSettings(
247
+ props: Omit<RadiusAxisSettings, 'type'> & {
248
+ type: AxisDomainTypeInput;
249
+ },
250
+ ): null {
241
251
  const dispatch = useAppDispatch();
242
252
  const layout = usePolarChartLayout();
243
253
  const settings: RadiusAxisSettings | undefined = useMemo(() => {
@@ -356,10 +366,11 @@ const renderTickItem = (
356
366
  } else if (typeof option === 'function') {
357
367
  tickItem = option(tickProps);
358
368
  } else {
359
- tickItem = <Text
360
- {...tickProps}
361
- className="recharts-polar-radius-axis-tick-value"
362
- >{value}</Text>;
369
+ tickItem = (
370
+ <Text {...tickProps} className="recharts-polar-radius-axis-tick-value">
371
+ {value}
372
+ </Text>
373
+ );
363
374
  }
364
375
 
365
376
  return tickItem;
@@ -385,15 +396,19 @@ const renderTicks = (props: InsideProps, ticks: ReadonlyArray<TickItem>): Octane
385
396
  payload: entry,
386
397
  };
387
398
 
388
- return <Layer
389
- className={clsx('recharts-polar-radius-axis-tick', getClassNameFromUnknown(tick))}
390
- key={`tick-${entry.coordinate}`}
391
- {...adaptEventsOfChild(props, entry, i)}
392
- >{renderTickItem(
393
- tick,
394
- tickProps,
395
- tickFormatter ? tickFormatter(entry.value, i) : entry.value,
396
- )}</Layer>;
399
+ return (
400
+ <Layer
401
+ className={clsx('recharts-polar-radius-axis-tick', getClassNameFromUnknown(tick))}
402
+ key={`tick-${entry.coordinate}`}
403
+ {...adaptEventsOfChild(props, entry, i)}
404
+ >
405
+ {renderTickItem(
406
+ tick,
407
+ tickProps,
408
+ tickFormatter ? tickFormatter(entry.value, i) : entry.value,
409
+ )}
410
+ </Layer>
411
+ );
397
412
  });
398
413
 
399
414
  return <Layer className="recharts-polar-radius-axis-ticks">{items}</Layer>;
@@ -406,8 +421,8 @@ export const PolarRadiusAxisWrapper: FunctionComponent<PropsWithDefaults> = (
406
421
 
407
422
  const viewBox = useAppSelector(selectPolarViewBox);
408
423
  const scale = useAppSelector((state) => selectPolarAxisScale(state, 'radiusAxis', radiusAxisId));
409
- const ticks = useAppSelector(
410
- (state) => selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, false),
424
+ const ticks = useAppSelector((state) =>
425
+ selectPolarAxisTicks(state, 'radiusAxis', radiusAxisId, false),
411
426
  );
412
427
 
413
428
  if (viewBox == null || !ticks || !ticks.length || scale == null) {
@@ -422,16 +437,18 @@ export const PolarRadiusAxisWrapper: FunctionComponent<PropsWithDefaults> = (
422
437
 
423
438
  const { tick, axisLine } = props;
424
439
 
425
- return <ZIndexLayer zIndex={props.zIndex}>
426
- <Layer className={clsx('recharts-polar-radius-axis', AXIS_TYPE, props.className)}>
427
- {axisLine && renderAxisLine(props, ticks)}
428
- {tick && renderTicks(props, ticks)}
429
- <PolarLabelContextProvider {...getViewBox(props.angle, props.cx, props.cy, ticks)}>
430
- <PolarLabelFromLabelProp label={props.label} />
431
- {props.children}
432
- </PolarLabelContextProvider>
433
- </Layer>
434
- </ZIndexLayer>;
440
+ return (
441
+ <ZIndexLayer zIndex={props.zIndex}>
442
+ <Layer className={clsx('recharts-polar-radius-axis', AXIS_TYPE, props.className)}>
443
+ {axisLine && renderAxisLine(props, ticks)}
444
+ {tick && renderTicks(props, ticks)}
445
+ <PolarLabelContextProvider {...getViewBox(props.angle, props.cx, props.cy, ticks)}>
446
+ <PolarLabelFromLabelProp label={props.label} />
447
+ {props.children}
448
+ </PolarLabelContextProvider>
449
+ </Layer>
450
+ </ZIndexLayer>
451
+ );
435
452
  };
436
453
 
437
454
  /**
@@ -445,27 +462,29 @@ export function PolarRadiusAxis<DataPointType = any, DataValueType = any>(
445
462
  outsideProps,
446
463
  defaultPolarRadiusAxisProps,
447
464
  );
448
- return <>
449
- <SetRadiusAxisSettings
450
- domain={props.domain}
451
- id={props.radiusAxisId}
452
- scale={props.scale}
453
- type={props.type}
454
- dataKey={props.dataKey}
455
- unit={undefined}
456
- name={props.name}
457
- allowDuplicatedCategory={props.allowDuplicatedCategory}
458
- allowDataOverflow={props.allowDataOverflow}
459
- reversed={props.reversed}
460
- includeHidden={props.includeHidden}
461
- allowDecimals={props.allowDecimals}
462
- niceTicks={props.niceTicks ?? 'auto'}
463
- ticks={props.ticks}
464
- tickCount={props.tickCount}
465
- tick={props.tick}
466
- />
467
- <PolarRadiusAxisWrapper {...props} />
468
- </>;
465
+ return (
466
+ <>
467
+ <SetRadiusAxisSettings
468
+ domain={props.domain}
469
+ id={props.radiusAxisId}
470
+ scale={props.scale}
471
+ type={props.type}
472
+ dataKey={props.dataKey}
473
+ unit={undefined}
474
+ name={props.name}
475
+ allowDuplicatedCategory={props.allowDuplicatedCategory}
476
+ allowDataOverflow={props.allowDataOverflow}
477
+ reversed={props.reversed}
478
+ includeHidden={props.includeHidden}
479
+ allowDecimals={props.allowDecimals}
480
+ niceTicks={props.niceTicks ?? 'auto'}
481
+ ticks={props.ticks}
482
+ tickCount={props.tickCount}
483
+ tick={props.tick}
484
+ />
485
+ <PolarRadiusAxisWrapper {...props} />
486
+ </>
487
+ );
469
488
  }
470
489
 
471
490
  PolarRadiusAxis.displayName = 'PolarRadiusAxis';