@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
@@ -11,16 +11,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];
11
11
  * @provides CartesianViewBoxContext
12
12
  * @provides CartesianChartContext
13
13
  */
14
- export function ScatterChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
15
- ref?: Ref<SVGSVGElement>;
16
- }) {
14
+ export function ScatterChart<DataPointType = unknown>(
15
+ props: CartesianChartProps<DataPointType> & {
16
+ ref?: Ref<SVGSVGElement>;
17
+ },
18
+ ) {
17
19
  const { ref, ...rest } = props;
18
- return <CartesianChart
19
- chartName="ScatterChart"
20
- defaultTooltipEventType="item"
21
- validateTooltipEventTypes={allowedTooltipTypes}
22
- tooltipPayloadSearcher={arrayTooltipSearcher}
23
- categoricalChartProps={rest}
24
- ref={ref}
25
- />;
20
+ return (
21
+ <CartesianChart
22
+ chartName="ScatterChart"
23
+ defaultTooltipEventType="item"
24
+ validateTooltipEventTypes={allowedTooltipTypes}
25
+ tooltipPayloadSearcher={arrayTooltipSearcher}
26
+ categoricalChartProps={rest}
27
+ ref={ref}
28
+ />
29
+ );
26
30
  }
@@ -62,85 +62,85 @@ interface SunburstNode extends SunburstData {
62
62
  export interface SunburstChartProps extends EventThrottlingProps {
63
63
  className?: string;
64
64
  /**
65
- * The source data. Each element should be an object.
66
- * The properties of each object represent the values of different data dimensions.
67
- *
68
- * Use the `dataKey` prop to specify which properties to use.
69
- *
70
- * @example data={[{ name: 'a', value: 12, fill: '#8884d8' }, { name: 'b', value: 5, fill: '#83a6ed' }]}
71
- */
65
+ * The source data. Each element should be an object.
66
+ * The properties of each object represent the values of different data dimensions.
67
+ *
68
+ * Use the `dataKey` prop to specify which properties to use.
69
+ *
70
+ * @example data={[{ name: 'a', value: 12, fill: '#8884d8' }, { name: 'b', value: 5, fill: '#83a6ed' }]}
71
+ */
72
72
  data: SunburstData;
73
73
  /**
74
- * The width of chart container.
75
- * Can be a number or a percent string like "100%".
76
- *
77
- * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}
78
- */
74
+ * The width of chart container.
75
+ * Can be a number or a percent string like "100%".
76
+ *
77
+ * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}
78
+ */
79
79
  width?: number | Percent;
80
80
  /**
81
- * The height of chart container.
82
- * Can be a number or a percent string like "100%".
83
- *
84
- * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}
85
- */
81
+ * The height of chart container.
82
+ * Can be a number or a percent string like "100%".
83
+ *
84
+ * @see {@link https://recharts.github.io/en-US/guide/sizes/ Chart sizing guide}
85
+ */
86
86
  height?: number | Percent;
87
87
  /**
88
- * If true, then it will listen to container size changes and adapt the SVG chart accordingly.
89
- * If false, then it renders the chart at the specified width and height and will stay that way
90
- * even if the container size changes.
91
- *
92
- * This is similar to ResponsiveContainer but without the need for an extra wrapper component.
93
- * The `responsive` prop also uses standard CSS sizing rules, instead of custom resolution logic (like ResponsiveContainer does).
94
- * @default false
95
- */
88
+ * If true, then it will listen to container size changes and adapt the SVG chart accordingly.
89
+ * If false, then it renders the chart at the specified width and height and will stay that way
90
+ * even if the container size changes.
91
+ *
92
+ * This is similar to ResponsiveContainer but without the need for an extra wrapper component.
93
+ * The `responsive` prop also uses standard CSS sizing rules, instead of custom resolution logic (like ResponsiveContainer does).
94
+ * @default false
95
+ */
96
96
  responsive?: boolean;
97
97
  /**
98
- * Distance between sectors.
99
- *
100
- * @defaultValue 2
101
- */
98
+ * Distance between sectors.
99
+ *
100
+ * @defaultValue 2
101
+ */
102
102
  padding?: number;
103
103
  /**
104
- * Decides how to extract value from the data.
105
- *
106
- * @defaultValue value
107
- */
104
+ * Decides how to extract value from the data.
105
+ *
106
+ * @defaultValue value
107
+ */
108
108
  dataKey?: string;
109
109
  /**
110
- * Name represents each sector in the tooltip.
111
- * This allows you to extract the name from the data:
112
- *
113
- * - `string`: the name of the field in the data object;
114
- * - `number`: the index of the field in the data;
115
- * - `function`: a function that receives the data object and returns the name.
116
- *
117
- * @defaultValue name
118
- */
110
+ * Name represents each sector in the tooltip.
111
+ * This allows you to extract the name from the data:
112
+ *
113
+ * - `string`: the name of the field in the data object;
114
+ * - `number`: the index of the field in the data;
115
+ * - `function`: a function that receives the data object and returns the name.
116
+ *
117
+ * @defaultValue name
118
+ */
119
119
  nameKey?: DataKey<any>;
120
120
  /**
121
- * Padding between each hierarchical level.
122
- */
121
+ * Padding between each hierarchical level.
122
+ */
123
123
  ringPadding?: number;
124
124
  /**
125
- * The radius of the inner circle at the center of the chart.
126
- *
127
- * @defaultValue 50
128
- */
125
+ * The radius of the inner circle at the center of the chart.
126
+ *
127
+ * @defaultValue 50
128
+ */
129
129
  innerRadius?: number;
130
130
  /**
131
- * Outermost edge of the chart.
132
- * Defaults to the max possible radius for a circle inscribed in the chart container
133
- */
131
+ * Outermost edge of the chart.
132
+ * Defaults to the max possible radius for a circle inscribed in the chart container
133
+ */
134
134
  outerRadius?: number;
135
135
  /**
136
- * The x-coordinate of center in pixels.
137
- * If undefined, it will be set to half of the chart width.
138
- */
136
+ * The x-coordinate of center in pixels.
137
+ * If undefined, it will be set to half of the chart width.
138
+ */
139
139
  cx?: number;
140
140
  /**
141
- * The y-coordinate of center in pixels.
142
- * If undefined, it will be set to half of the chart height.
143
- */
141
+ * The y-coordinate of center in pixels.
142
+ * If undefined, it will be set to half of the chart height.
143
+ */
144
144
  cy?: number;
145
145
  /** Angle in degrees from which the chart should start. */
146
146
  startAngle?: number;
@@ -150,8 +150,8 @@ export interface SunburstChartProps extends EventThrottlingProps {
150
150
  fill?: string;
151
151
  stroke?: string;
152
152
  /**
153
- * An object with svg text options to control the appearance of the chart labels.
154
- */
153
+ * An object with svg text options to control the appearance of the chart labels.
154
+ */
155
155
  textOptions?: TextProps;
156
156
  onMouseEnter?: (node: SunburstData, e: NativeMouseEvent) => void;
157
157
  onMouseLeave?: (node: SunburstData, e: NativeMouseEvent) => void;
@@ -185,41 +185,43 @@ function getMaxDepthOf(node: SunburstData): number {
185
185
  return 1 + Math.max(...childDepths);
186
186
  }
187
187
 
188
- const SetSunburstTooltipEntrySettings = React.memo(({
189
- dataKey,
190
- nameKey,
191
- data,
192
- stroke,
193
- fill,
194
- positions,
195
- id,
196
- }: Pick<
197
- WithIdRequired<SunburstChartProps>,
198
- 'dataKey' | 'data' | 'stroke' | 'fill' | 'nameKey' | 'id'
199
- > & {
200
- positions: SunburstPositionMap;
201
- }) => {
202
- const tooltipEntrySettings: TooltipPayloadConfiguration = {
203
- dataDefinedOnItem: data.children,
204
- getPosition: (index) => positions.get(index),
205
- // Sunburst does not support many of the properties as other charts do so there's plenty of defaults here
206
- settings: {
207
- stroke,
208
- strokeWidth: undefined,
209
- fill,
210
- nameKey,
211
- dataKey,
212
- // if there is a nameKey use it, otherwise make the name of the tooltip the dataKey itself
213
- name: nameKey ? undefined : dataKey,
214
- hide: false,
215
- type: undefined,
216
- color: fill,
217
- unit: '',
218
- graphicalItemId: id,
219
- },
220
- };
221
- return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;
222
- });
188
+ const SetSunburstTooltipEntrySettings = React.memo(
189
+ ({
190
+ dataKey,
191
+ nameKey,
192
+ data,
193
+ stroke,
194
+ fill,
195
+ positions,
196
+ id,
197
+ }: Pick<
198
+ WithIdRequired<SunburstChartProps>,
199
+ 'dataKey' | 'data' | 'stroke' | 'fill' | 'nameKey' | 'id'
200
+ > & {
201
+ positions: SunburstPositionMap;
202
+ }) => {
203
+ const tooltipEntrySettings: TooltipPayloadConfiguration = {
204
+ dataDefinedOnItem: data.children,
205
+ getPosition: (index) => positions.get(index),
206
+ // Sunburst does not support many of the properties as other charts do so there's plenty of defaults here
207
+ settings: {
208
+ stroke,
209
+ strokeWidth: undefined,
210
+ fill,
211
+ nameKey,
212
+ dataKey,
213
+ // if there is a nameKey use it, otherwise make the name of the tooltip the dataKey itself
214
+ name: nameKey ? undefined : dataKey,
215
+ hide: false,
216
+ type: undefined,
217
+ color: fill,
218
+ unit: '',
219
+ graphicalItemId: id,
220
+ },
221
+ };
222
+ return <SetTooltipEntrySettings tooltipEntrySettings={tooltipEntrySettings} />;
223
+ },
224
+ );
223
225
 
224
226
  // Why is margin not a sunburst prop? No clue. Probably it should be
225
227
  const defaultSunburstMargin: Margin = {
@@ -273,8 +275,9 @@ export const defaultSunburstChartProps = {
273
275
  ...initialEventSettingsState,
274
276
  } as const satisfies Partial<SunburstChartProps>;
275
277
 
276
- type InternalSunburstChartProps =
277
- WithIdRequired<RequiresDefaultProps<SunburstChartProps, typeof defaultSunburstChartProps>>;
278
+ type InternalSunburstChartProps = WithIdRequired<
279
+ RequiresDefaultProps<SunburstChartProps, typeof defaultSunburstChartProps>
280
+ >;
278
281
 
279
282
  const SunburstChartImpl = ({
280
283
  className,
@@ -383,14 +386,12 @@ const SunburstChartImpl = ({
383
386
  <g key={`sunburst-sector-${d.name}-${i}`}>
384
387
  <Sector
385
388
  onClick={() => handleClick(nodeWithIndex)}
386
- onMouseEnter={(e: NativeMouseEvent<SVGPathElement>) => handleMouseEnter(
387
- nodeWithIndex,
388
- e,
389
- )}
390
- onMouseLeave={(e: NativeMouseEvent<SVGPathElement>) => handleMouseLeave(
391
- nodeWithIndex,
392
- e,
393
- )}
389
+ onMouseEnter={(e: NativeMouseEvent<SVGPathElement>) =>
390
+ handleMouseEnter(nodeWithIndex, e)
391
+ }
392
+ onMouseLeave={(e: NativeMouseEvent<SVGPathElement>) =>
393
+ handleMouseLeave(nodeWithIndex, e)
394
+ }
394
395
  fill={fillColor}
395
396
  stroke={stroke}
396
397
  strokeWidth={padding}
@@ -407,7 +408,9 @@ const SunburstChartImpl = ({
407
408
  textAnchor="middle"
408
409
  x={textX + cx}
409
410
  y={cy - textY}
410
- >{d[dataKey]}</Text>
411
+ >
412
+ {d[dataKey]}
413
+ </Text>
411
414
  </g>,
412
415
  );
413
416
 
@@ -431,19 +434,21 @@ const SunburstChartImpl = ({
431
434
  drawArcs(data.children, { radius: thickness, innerR: innerRadius, initialAngle: startAngle });
432
435
 
433
436
  const layerClass = clsx('recharts-sunburst', className);
434
- return <Surface width={width} height={height}>
435
- <Layer className={layerClass}>{sectors}</Layer>
436
- <SetSunburstTooltipEntrySettings
437
- dataKey={dataKey}
438
- nameKey={nameKey}
439
- data={data}
440
- stroke={stroke}
441
- fill={fill}
442
- positions={positions}
443
- id={id}
444
- />
445
- {children}
446
- </Surface>;
437
+ return (
438
+ <Surface width={width} height={height}>
439
+ <Layer className={layerClass}>{sectors}</Layer>
440
+ <SetSunburstTooltipEntrySettings
441
+ dataKey={dataKey}
442
+ nameKey={nameKey}
443
+ data={data}
444
+ stroke={stroke}
445
+ fill={fill}
446
+ positions={positions}
447
+ id={id}
448
+ />
449
+ {children}
450
+ </Surface>
451
+ );
447
452
  };
448
453
 
449
454
  /**
@@ -468,41 +473,43 @@ export const SunburstChart = (outsideProps: SunburstChartProps) => {
468
473
  throttledEvents,
469
474
  } = props;
470
475
  const [tooltipPortal, setTooltipPortal] = useState<HTMLElement | null>(null);
471
- return <RechartsStoreProvider
472
- preloadedState={preloadedState}
473
- reduxStoreName={className ?? 'SunburstChart'}
474
- >
475
- <ReportChartSize width={width} height={height} />
476
- <ReportChartMargin margin={defaultSunburstMargin} />
477
- <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />
478
- <TooltipPortalContext value={tooltipPortal}>
479
- <RechartsWrapper
480
- className={className}
481
- width={width}
482
- height={height}
483
- responsive={responsive}
484
- style={style}
485
- ref={(node: HTMLDivElement) => {
486
- if (tooltipPortal == null && node != null) {
487
- setTooltipPortal(node);
488
- }
489
- }}
490
- onMouseEnter={undefined}
491
- onMouseLeave={undefined}
492
- onClick={undefined}
493
- onMouseMove={undefined}
494
- onMouseDown={undefined}
495
- onMouseUp={undefined}
496
- onContextMenu={undefined}
497
- onDoubleClick={undefined}
498
- onTouchStart={undefined}
499
- onTouchMove={undefined}
500
- onTouchEnd={undefined}
501
- >
502
- <RegisterGraphicalItemId id={externalId} type="sunburst">
503
- {(id) => <SunburstChartImpl {...props} id={id} />}
504
- </RegisterGraphicalItemId>
505
- </RechartsWrapper>
506
- </TooltipPortalContext>
507
- </RechartsStoreProvider>;
476
+ return (
477
+ <RechartsStoreProvider
478
+ preloadedState={preloadedState}
479
+ reduxStoreName={className ?? 'SunburstChart'}
480
+ >
481
+ <ReportChartSize width={width} height={height} />
482
+ <ReportChartMargin margin={defaultSunburstMargin} />
483
+ <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />
484
+ <TooltipPortalContext value={tooltipPortal}>
485
+ <RechartsWrapper
486
+ className={className}
487
+ width={width}
488
+ height={height}
489
+ responsive={responsive}
490
+ style={style}
491
+ ref={(node: HTMLDivElement) => {
492
+ if (tooltipPortal == null && node != null) {
493
+ setTooltipPortal(node);
494
+ }
495
+ }}
496
+ onMouseEnter={undefined}
497
+ onMouseLeave={undefined}
498
+ onClick={undefined}
499
+ onMouseMove={undefined}
500
+ onMouseDown={undefined}
501
+ onMouseUp={undefined}
502
+ onContextMenu={undefined}
503
+ onDoubleClick={undefined}
504
+ onTouchStart={undefined}
505
+ onTouchMove={undefined}
506
+ onTouchEnd={undefined}
507
+ >
508
+ <RegisterGraphicalItemId id={externalId} type="sunburst">
509
+ {(id) => <SunburstChartImpl {...props} id={id} />}
510
+ </RegisterGraphicalItemId>
511
+ </RechartsWrapper>
512
+ </TooltipPortalContext>
513
+ </RechartsStoreProvider>
514
+ );
508
515
  };
@@ -65,7 +65,11 @@ function ActivePoint(activePointProps: {
65
65
  } else {
66
66
  dot = <Dot {...dotProps} />;
67
67
  }
68
- return <Layer className="recharts-active-dot" clipPath={clipPath}>{dot}</Layer>;
68
+ return (
69
+ <Layer className="recharts-active-dot" clipPath={clipPath}>
70
+ {dot}
71
+ </Layer>
72
+ );
69
73
  }
70
74
 
71
75
  export function ActivePoints(props: ActivePointsProps) {
@@ -82,20 +86,22 @@ export function ActivePoints(props: ActivePointsProps) {
82
86
  if (points == null || activeDataPoints == null) {
83
87
  return null;
84
88
  }
85
- const activePoint: PointType | undefined = points.find(
86
- (p) => activeDataPoints.includes(p.payload),
89
+ const activePoint: PointType | undefined = points.find((p) =>
90
+ activeDataPoints.includes(p.payload),
87
91
  );
88
92
  if (isNullish(activePoint)) {
89
93
  return null;
90
94
  }
91
- return <ZIndexLayer zIndex={zIndex}>
92
- <ActivePoint
93
- point={activePoint}
94
- childIndex={Number(activeTooltipIndex)}
95
- mainColor={mainColor}
96
- dataKey={itemDataKey}
97
- activeDot={activeDot}
98
- clipPath={clipPath}
99
- />
100
- </ZIndexLayer>;
95
+ return (
96
+ <ZIndexLayer zIndex={zIndex}>
97
+ <ActivePoint
98
+ point={activePoint}
99
+ childIndex={Number(activeTooltipIndex)}
100
+ mainColor={mainColor}
101
+ dataKey={itemDataKey}
102
+ activeDot={activeDot}
103
+ clipPath={clipPath}
104
+ />
105
+ </ZIndexLayer>
106
+ );
101
107
  }
@@ -39,13 +39,12 @@ export interface CursorProps extends ZIndexable {
39
39
  index: TooltipIndex | undefined;
40
40
  }
41
41
 
42
- export type CursorConnectedProps =
43
- CursorProps & {
44
- tooltipAxisBandSize: number;
45
- layout: LayoutType;
46
- offset: ChartOffsetInternal;
47
- chartName: string;
48
- };
42
+ export type CursorConnectedProps = CursorProps & {
43
+ tooltipAxisBandSize: number;
44
+ layout: LayoutType;
45
+ offset: ChartOffsetInternal;
46
+ chartName: string;
47
+ };
49
48
 
50
49
  function RenderCursor({
51
50
  cursor,
@@ -79,7 +78,11 @@ export function CursorInternal(props: CursorConnectedProps) {
79
78
  const activeCoordinate = coordinate;
80
79
  const activePayload = payload;
81
80
  const activeTooltipIndex = index;
82
- if (!cursor || !activeCoordinate || chartName !== 'ScatterChart' && tooltipEventType !== 'axis') {
81
+ if (
82
+ !cursor ||
83
+ !activeCoordinate ||
84
+ (chartName !== 'ScatterChart' && tooltipEventType !== 'axis')
85
+ ) {
83
86
  return null;
84
87
  }
85
88
  let restProps, cursorComp: ComponentType<any>, preferredZIndex: number;
@@ -124,9 +127,11 @@ export function CursorInternal(props: CursorConnectedProps) {
124
127
  className: clsx('recharts-tooltip-cursor', extraClassName),
125
128
  };
126
129
 
127
- return <ZIndexLayer zIndex={props.zIndex ?? preferredZIndex}>
128
- <RenderCursor cursor={cursor} cursorComp={cursorComp} cursorProps={cursorProps} />
129
- </ZIndexLayer>;
130
+ return (
131
+ <ZIndexLayer zIndex={props.zIndex ?? preferredZIndex}>
132
+ <RenderCursor cursor={cursor} cursorComp={cursorComp} cursorProps={cursorProps} />
133
+ </ZIndexLayer>
134
+ );
130
135
  }
131
136
 
132
137
  /*
@@ -147,11 +152,13 @@ export function Cursor(props: CursorProps) {
147
152
  return null;
148
153
  }
149
154
 
150
- return <CursorInternal
151
- {...props}
152
- offset={offset}
153
- layout={layout}
154
- tooltipAxisBandSize={tooltipAxisBandSize}
155
- chartName={chartName}
156
- />;
155
+ return (
156
+ <CursorInternal
157
+ {...props}
158
+ offset={offset}
159
+ layout={layout}
160
+ tooltipAxisBandSize={tooltipAxisBandSize}
161
+ chartName={chartName}
162
+ />
163
+ );
157
164
  }