@octanejs/recharts 0.1.62 → 0.1.64

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
@@ -30,11 +30,12 @@ interface XAxisProps<DataPointType = any, DataValueType = any> extends Omit<
30
30
  mirror?: boolean;
31
31
  orientation?: XAxisOrientation;
32
32
  domain?: AxisDomain;
33
- scale?: | ScaleType
34
- | CustomScaleDefinition
35
- | CustomScaleDefinition<string>
36
- | CustomScaleDefinition<number>
37
- | CustomScaleDefinition<Date>;
33
+ scale?:
34
+ | ScaleType
35
+ | CustomScaleDefinition
36
+ | CustomScaleDefinition<string>
37
+ | CustomScaleDefinition<number>
38
+ | CustomScaleDefinition<Date>;
38
39
  tick?: TickProp<XAxisTickContentProps>;
39
40
  ticks?: ReadonlyArray<AxisTick>;
40
41
  padding?: XAxisPadding;
@@ -45,13 +46,15 @@ interface XAxisProps<DataPointType = any, DataValueType = any> extends Omit<
45
46
  letterSpacing?: number | string;
46
47
  niceTicks?: NiceTicksAlgorithm;
47
48
  }
48
- export type Props<DataPointType = any, DataValueType = any> =
49
- Omit<
50
- PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,
51
- 'scale' | 'ref'
52
- > & XAxisProps<DataPointType, DataValueType>;
53
- type PropsWithDefaults<DataPointType = any, DataValueType = any> =
54
- RequiresDefaultProps<Props<DataPointType, DataValueType>, typeof xAxisDefaultProps>;
49
+ export type Props<DataPointType = any, DataValueType = any> = Omit<
50
+ PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,
51
+ 'scale' | 'ref'
52
+ > &
53
+ XAxisProps<DataPointType, DataValueType>;
54
+ type PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<
55
+ Props<DataPointType, DataValueType>,
56
+ typeof xAxisDefaultProps
57
+ >;
55
58
  // Port of cartesian/XAxis.tsx — registers x-axis settings in the store and
56
59
  // renders through CartesianAxis with store-synchronized settings.
57
60
  import { useLayoutEffect, useMemo, useRef, memo } from 'octane';
@@ -73,9 +76,11 @@ import { axisPropsAreEqual } from '../util/axisPropsAreEqual';
73
76
  import { useCartesianChartLayout } from '../context/chartLayoutContext.ts';
74
77
  import { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';
75
78
 
76
- function SetXAxisSettings(props: Omit<XAxisSettings, 'type'> & {
77
- type: AxisDomainTypeInput;
78
- }) {
79
+ function SetXAxisSettings(
80
+ props: Omit<XAxisSettings, 'type'> & {
81
+ type: AxisDomainTypeInput;
82
+ },
83
+ ) {
79
84
  const dispatch = useAppDispatch();
80
85
  const prevSettingsRef = useRef<XAxisSettings | null>(null);
81
86
  const layout = useCartesianChartLayout();
@@ -118,34 +123,36 @@ function XAxisImpl(props: PropsWithDefaults) {
118
123
  const viewBox = useAppSelector(selectAxisViewBox);
119
124
  const isPanorama = useIsPanorama();
120
125
  const axisType = 'xAxis';
121
- const cartesianTickItems = useAppSelector(
122
- (state) => selectTicksOfAxis(state, axisType, xAxisId, isPanorama),
126
+ const cartesianTickItems = useAppSelector((state) =>
127
+ selectTicksOfAxis(state, axisType, xAxisId, isPanorama),
123
128
  );
124
129
  const axisSize = useAppSelector((state) => selectXAxisSize(state, xAxisId));
125
130
  const position = useAppSelector((state) => selectXAxisPosition(state, xAxisId));
126
131
  // Settings come back from the store (not props) so every component renders
127
132
  // one consistent view of the axis (recharts#6257).
128
- const synchronizedSettings = useAppSelector(
129
- (state) => selectXAxisSettingsNoDefaults(state, xAxisId),
133
+ const synchronizedSettings = useAppSelector((state) =>
134
+ selectXAxisSettingsNoDefaults(state, xAxisId),
130
135
  );
131
136
  if (axisSize == null || position == null || synchronizedSettings == null) {
132
137
  return null;
133
138
  }
134
139
  const { dangerouslySetInnerHTML, ticks, scale: _del, ...allOtherProps } = props;
135
140
  const { id, scale: _del2, ...restSynchronizedSettings } = synchronizedSettings;
136
- return <CartesianAxis
137
- {...allOtherProps}
138
- {...restSynchronizedSettings}
139
- x={position.x}
140
- y={position.y}
141
- width={axisSize.width}
142
- height={axisSize.height}
143
- className={clsx('recharts-' + axisType + ' ' + axisType, className)}
144
- viewBox={viewBox}
145
- ticks={cartesianTickItems}
146
- axisType={axisType}
147
- axisId={xAxisId}
148
- />;
141
+ return (
142
+ <CartesianAxis
143
+ {...allOtherProps}
144
+ {...restSynchronizedSettings}
145
+ x={position.x}
146
+ y={position.y}
147
+ width={axisSize.width}
148
+ height={axisSize.height}
149
+ className={clsx('recharts-' + axisType + ' ' + axisType, className)}
150
+ viewBox={viewBox}
151
+ ticks={cartesianTickItems}
152
+ axisType={axisType}
153
+ axisId={xAxisId}
154
+ />
155
+ );
149
156
  }
150
157
 
151
158
  export const xAxisDefaultProps = {
@@ -31,11 +31,12 @@ interface YAxisProps<DataPointType = any, DataValueType = any> extends Omit<
31
31
  axisLine?: boolean | SVGProps<SVGLineElement>;
32
32
  type?: AxisDomainTypeInput;
33
33
  domain?: AxisDomain;
34
- scale?: | ScaleType
35
- | CustomScaleDefinition
36
- | CustomScaleDefinition<string>
37
- | CustomScaleDefinition<number>
38
- | CustomScaleDefinition<Date>;
34
+ scale?:
35
+ | ScaleType
36
+ | CustomScaleDefinition
37
+ | CustomScaleDefinition<string>
38
+ | CustomScaleDefinition<number>
39
+ | CustomScaleDefinition<Date>;
39
40
  yAxisId?: string | number;
40
41
  tick?: TickProp<YAxisTickContentProps>;
41
42
  ticks?: ReadonlyArray<AxisTick>;
@@ -50,13 +51,15 @@ interface YAxisProps<DataPointType = any, DataValueType = any> extends Omit<
50
51
  letterSpacing?: number | string;
51
52
  niceTicks?: NiceTicksAlgorithm;
52
53
  }
53
- export type Props<DataPointType = any, DataValueType = any> =
54
- Omit<
55
- PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,
56
- 'scale' | 'ref'
57
- > & YAxisProps<DataPointType, DataValueType>;
58
- type PropsWithDefaults<DataPointType = any, DataValueType = any> =
59
- RequiresDefaultProps<Props<DataPointType, DataValueType>, typeof yAxisDefaultProps>;
54
+ export type Props<DataPointType = any, DataValueType = any> = Omit<
55
+ PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement>,
56
+ 'scale' | 'ref'
57
+ > &
58
+ YAxisProps<DataPointType, DataValueType>;
59
+ type PropsWithDefaults<DataPointType = any, DataValueType = any> = RequiresDefaultProps<
60
+ Props<DataPointType, DataValueType>,
61
+ typeof yAxisDefaultProps
62
+ >;
60
63
  // Port of cartesian/YAxis.tsx — registers y-axis settings in the store,
61
64
  // renders through CartesianAxis, and drives width="auto" via the axis
62
65
  // component's imperative getCalculatedWidth handle.
@@ -80,9 +83,11 @@ import { axisPropsAreEqual } from '../util/axisPropsAreEqual';
80
83
  import { useCartesianChartLayout } from '../context/chartLayoutContext.ts';
81
84
  import { getAxisTypeBasedOnLayout } from '../util/getAxisTypeBasedOnLayout';
82
85
 
83
- function SetYAxisSettings(props: Omit<YAxisSettings, 'type'> & {
84
- type: AxisDomainTypeInput;
85
- }) {
86
+ function SetYAxisSettings(
87
+ props: Omit<YAxisSettings, 'type'> & {
88
+ type: AxisDomainTypeInput;
89
+ },
90
+ ) {
86
91
  const dispatch = useAppDispatch();
87
92
  const prevSettingsRef = useRef<YAxisSettings | null>(null);
88
93
  const layout = useCartesianChartLayout();
@@ -130,20 +135,23 @@ function YAxisImpl(props: PropsWithDefaults) {
130
135
  const axisType = 'yAxis';
131
136
  const axisSize: Size | undefined = useAppSelector((state) => selectYAxisSize(state, yAxisId));
132
137
  const position = useAppSelector((state) => selectYAxisPosition(state, yAxisId));
133
- const cartesianTickItems = useAppSelector(
134
- (state) => selectTicksOfAxis(state, axisType, yAxisId, isPanorama),
138
+ const cartesianTickItems = useAppSelector((state) =>
139
+ selectTicksOfAxis(state, axisType, yAxisId, isPanorama),
135
140
  );
136
141
  // Settings come back from the store (not props) so every component renders
137
142
  // one consistent view of the axis (recharts#6257).
138
- const synchronizedSettings = useAppSelector(
139
- (state) => selectYAxisSettingsNoDefaults(state, yAxisId),
143
+ const synchronizedSettings = useAppSelector((state) =>
144
+ selectYAxisSettingsNoDefaults(state, yAxisId),
140
145
  );
141
146
  useLayoutEffect(() => {
142
147
  // No dynamic width calculation when width !== 'auto', or when a
143
148
  // function/element label is used.
144
149
  if (
145
- width !== 'auto' || !axisSize || isLabelContentAFunction(label) || isValidElement(label) ||
146
- synchronizedSettings == null
150
+ width !== 'auto' ||
151
+ !axisSize ||
152
+ isLabelContentAFunction(label) ||
153
+ isValidElement(label) ||
154
+ synchronizedSettings == null
147
155
  ) {
148
156
  return;
149
157
  }
@@ -162,22 +170,24 @@ function YAxisImpl(props: PropsWithDefaults) {
162
170
  }
163
171
  const { dangerouslySetInnerHTML, ticks, scale: _del, ...allOtherProps } = props;
164
172
  const { id, scale: _del2, ...restSynchronizedSettings } = synchronizedSettings;
165
- return <CartesianAxis
166
- {...allOtherProps}
167
- {...restSynchronizedSettings}
168
- ref={cartesianAxisRef}
169
- labelRef={labelRef}
170
- x={position.x}
171
- y={position.y}
172
- tickTextProps={width === 'auto' ? { width: undefined } : { width }}
173
- width={axisSize.width}
174
- height={axisSize.height}
175
- className={clsx('recharts-' + axisType + ' ' + axisType, className)}
176
- viewBox={viewBox}
177
- ticks={cartesianTickItems}
178
- axisType={axisType}
179
- axisId={yAxisId}
180
- />;
173
+ return (
174
+ <CartesianAxis
175
+ {...allOtherProps}
176
+ {...restSynchronizedSettings}
177
+ ref={cartesianAxisRef}
178
+ labelRef={labelRef}
179
+ x={position.x}
180
+ y={position.y}
181
+ tickTextProps={width === 'auto' ? { width: undefined } : { width }}
182
+ width={axisSize.width}
183
+ height={axisSize.height}
184
+ className={clsx('recharts-' + axisType + ' ' + axisType, className)}
185
+ viewBox={viewBox}
186
+ ticks={cartesianTickItems}
187
+ axisType={axisType}
188
+ axisId={yAxisId}
189
+ />
190
+ );
181
191
  }
182
192
 
183
193
  export const yAxisDefaultProps = {
@@ -42,73 +42,74 @@ export interface Props<DataPointType = any, DataValueType = any> extends Omit<
42
42
  'domain'
43
43
  > {
44
44
  /**
45
- * The type of axis.
46
- *
47
- * `category`: Treats data as distinct values.
48
- * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.
49
- *
50
- * `number`: Treats data as continuous range.
51
- * Values that are numerically closer are placed closer together on the axis.
52
- *
53
- * @defaultValue number
54
- */
45
+ * The type of axis.
46
+ *
47
+ * `category`: Treats data as distinct values.
48
+ * Each value is in the same distance from its neighbors, regardless of their actual numeric difference.
49
+ *
50
+ * `number`: Treats data as continuous range.
51
+ * Values that are numerically closer are placed closer together on the axis.
52
+ *
53
+ * @defaultValue number
54
+ */
55
55
  type?: 'number' | 'category';
56
56
  /**
57
- * The unique id of z-axis.
58
- *
59
- * @defaultValue 0
60
- */
57
+ * The unique id of z-axis.
58
+ *
59
+ * @defaultValue 0
60
+ */
61
61
  zAxisId?: AxisId;
62
62
  /**
63
- * The range of axis.
64
- * Unlike other axes, the range of z-axis is not informed by chart dimensions.
65
- *
66
- * @defaultValue [64,64]
67
- */
63
+ * The range of axis.
64
+ * Unlike other axes, the range of z-axis is not informed by chart dimensions.
65
+ *
66
+ * @defaultValue [64,64]
67
+ */
68
68
  range?: AxisRange;
69
69
  /**
70
- * Specify the domain of axis when the axis is a number axis.
71
- *
72
- * If undefined, then the domain is calculated based on the data and dataKeys.
73
- *
74
- * The length of domain should be 2, and we will validate the values in domain.
75
- *
76
- * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',
77
- * or a function that accepts a single argument and returns a number.
78
- *
79
- * 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.
80
- * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.
81
- *
82
- * @example <ZAxis type="number" domain={['dataMin', 'dataMax']} />
83
- * @example <ZAxis type="number" domain={[0, 'dataMax']} />
84
- * @example <ZAxis type="number" domain={['auto', 'auto']} />
85
- * @example <ZAxis type="number" domain={[0, 'dataMax + 1000']} />
86
- * @example <ZAxis type="number" domain={['dataMin - 100', 'dataMax + 100']} />
87
- * @example <ZAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />
88
- * @example <ZAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />
89
- * @example <ZAxis type="number" domain={[0, 100]} allowDataOverflow />
90
- */
70
+ * Specify the domain of axis when the axis is a number axis.
71
+ *
72
+ * If undefined, then the domain is calculated based on the data and dataKeys.
73
+ *
74
+ * The length of domain should be 2, and we will validate the values in domain.
75
+ *
76
+ * Each element in the array can be a number, 'auto', 'dataMin', 'dataMax', a string like 'dataMin - 20', 'dataMax + 100',
77
+ * or a function that accepts a single argument and returns a number.
78
+ *
79
+ * 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.
80
+ * If a function, receives '[dataMin, dataMax]', and must return a computed domain as '[min, max]'.
81
+ *
82
+ * @example <ZAxis type="number" domain={['dataMin', 'dataMax']} />
83
+ * @example <ZAxis type="number" domain={[0, 'dataMax']} />
84
+ * @example <ZAxis type="number" domain={['auto', 'auto']} />
85
+ * @example <ZAxis type="number" domain={[0, 'dataMax + 1000']} />
86
+ * @example <ZAxis type="number" domain={['dataMin - 100', 'dataMax + 100']} />
87
+ * @example <ZAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />
88
+ * @example <ZAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />
89
+ * @example <ZAxis type="number" domain={[0, 100]} allowDataOverflow />
90
+ */
91
91
  domain?: AxisDomain;
92
92
  /**
93
- * Scale function determines how data values are mapped to visual values.
94
- * In other words, decided the mapping between data domain and coordinate range.
95
- *
96
- * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.
97
- *
98
- * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.
99
- *
100
- * @defaultValue auto
101
- * @example <ZAxis scale="log" />
102
- * @example
103
- * import { scaleLog } from 'd3-scale';
104
- * const scale = scaleLog().base(Math.E);
105
- * <ZAxis scale={scale} />
106
- */
107
- scale?: | ScaleType
108
- | CustomScaleDefinition
109
- | CustomScaleDefinition<string>
110
- | CustomScaleDefinition<number>
111
- | CustomScaleDefinition<Date>;
93
+ * Scale function determines how data values are mapped to visual values.
94
+ * In other words, decided the mapping between data domain and coordinate range.
95
+ *
96
+ * If undefined, or 'auto', the scale function is created internally according to the type of axis and data.
97
+ *
98
+ * You can define a custom scale, either as a string shortcut to a d3 scale, or as a complete scale definition object.
99
+ *
100
+ * @defaultValue auto
101
+ * @example <ZAxis scale="log" />
102
+ * @example
103
+ * import { scaleLog } from 'd3-scale';
104
+ * const scale = scaleLog().base(Math.E);
105
+ * <ZAxis scale={scale} />
106
+ */
107
+ scale?:
108
+ | ScaleType
109
+ | CustomScaleDefinition
110
+ | CustomScaleDefinition<string>
111
+ | CustomScaleDefinition<number>
112
+ | CustomScaleDefinition<Date>;
112
113
  }
113
114
 
114
115
  export const zAxisDefaultProps = {
@@ -128,20 +129,22 @@ export function ZAxis<DataPointType = any, DataValueType = any>(
128
129
  outsideProps: Props<DataPointType, DataValueType>,
129
130
  ) {
130
131
  const props = resolveDefaultProps(outsideProps, zAxisDefaultProps);
131
- return <SetZAxisSettings
132
- domain={props.domain}
133
- id={props.zAxisId}
134
- dataKey={props.dataKey}
135
- name={props.name}
136
- unit={props.unit}
137
- range={props.range}
138
- scale={props.scale}
139
- type={props.type}
140
- allowDuplicatedCategory={implicitZAxis.allowDuplicatedCategory}
141
- allowDataOverflow={implicitZAxis.allowDataOverflow}
142
- reversed={implicitZAxis.reversed}
143
- includeHidden={implicitZAxis.includeHidden}
144
- />;
132
+ return (
133
+ <SetZAxisSettings
134
+ domain={props.domain}
135
+ id={props.zAxisId}
136
+ dataKey={props.dataKey}
137
+ name={props.name}
138
+ unit={props.unit}
139
+ range={props.range}
140
+ scale={props.scale}
141
+ type={props.type}
142
+ allowDuplicatedCategory={implicitZAxis.allowDuplicatedCategory}
143
+ allowDataOverflow={implicitZAxis.allowDataOverflow}
144
+ reversed={implicitZAxis.reversed}
145
+ includeHidden={implicitZAxis.includeHidden}
146
+ />
147
+ );
145
148
  }
146
149
 
147
150
  ZAxis.displayName = 'ZAxis';
@@ -11,16 +11,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];
11
11
  * @provides CartesianViewBoxContext
12
12
  * @provides CartesianChartContext
13
13
  */
14
- export function AreaChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
15
- ref?: Ref<SVGSVGElement>;
16
- }) {
14
+ export function AreaChart<DataPointType = unknown>(
15
+ props: CartesianChartProps<DataPointType> & {
16
+ ref?: Ref<SVGSVGElement>;
17
+ },
18
+ ) {
17
19
  const { ref, ...rest } = props;
18
- return <CartesianChart
19
- chartName="AreaChart"
20
- defaultTooltipEventType="axis"
21
- validateTooltipEventTypes={allowedTooltipTypes}
22
- tooltipPayloadSearcher={arrayTooltipSearcher}
23
- categoricalChartProps={rest}
24
- ref={ref}
25
- />;
20
+ return (
21
+ <CartesianChart
22
+ chartName="AreaChart"
23
+ defaultTooltipEventType="axis"
24
+ validateTooltipEventTypes={allowedTooltipTypes}
25
+ tooltipPayloadSearcher={arrayTooltipSearcher}
26
+ categoricalChartProps={rest}
27
+ ref={ref}
28
+ />
29
+ );
26
30
  }
@@ -13,16 +13,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis', 'item'];
13
13
  * @provides CartesianViewBoxContext
14
14
  * @provides CartesianChartContext
15
15
  */
16
- export function BarChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
17
- ref?: Ref<SVGSVGElement>;
18
- }) {
16
+ export function BarChart<DataPointType = unknown>(
17
+ props: CartesianChartProps<DataPointType> & {
18
+ ref?: Ref<SVGSVGElement>;
19
+ },
20
+ ) {
19
21
  const { ref, ...rest } = props;
20
- return <CartesianChart
21
- chartName="BarChart"
22
- defaultTooltipEventType="axis"
23
- validateTooltipEventTypes={allowedTooltipTypes}
24
- tooltipPayloadSearcher={arrayTooltipSearcher}
25
- categoricalChartProps={rest}
26
- ref={ref}
27
- />;
22
+ return (
23
+ <CartesianChart
24
+ chartName="BarChart"
25
+ defaultTooltipEventType="axis"
26
+ validateTooltipEventTypes={allowedTooltipTypes}
27
+ tooltipPayloadSearcher={arrayTooltipSearcher}
28
+ categoricalChartProps={rest}
29
+ ref={ref}
30
+ />
31
+ );
28
32
  }
@@ -27,31 +27,37 @@ export function CategoricalChart(props: CartesianChartProps & { ref?: Ref<SVGSVG
27
27
  // "compact" is the Brush panorama mode (but it's public, so it can render
28
28
  // outside Brush too).
29
29
  if (compact) {
30
- return <>
31
- <ReportChartSize width={width} height={height} />
32
- <RootSurface otherAttributes={attrs} title={title} desc={desc}>{children}</RootSurface>
33
- </>;
30
+ return (
31
+ <>
32
+ <ReportChartSize width={width} height={height} />
33
+ <RootSurface otherAttributes={attrs} title={title} desc={desc}>
34
+ {children}
35
+ </RootSurface>
36
+ </>
37
+ );
34
38
  }
35
- return <RechartsWrapper
36
- className={className}
37
- style={style}
38
- width={width}
39
- height={height}
40
- responsive={responsive ?? false}
41
- onClick={props.onClick}
42
- onMouseLeave={props.onMouseLeave}
43
- onMouseEnter={props.onMouseEnter}
44
- onMouseMove={props.onMouseMove}
45
- onMouseDown={props.onMouseDown}
46
- onMouseUp={props.onMouseUp}
47
- onContextMenu={props.onContextMenu}
48
- onDoubleClick={props.onDoubleClick}
49
- onTouchStart={props.onTouchStart}
50
- onTouchMove={props.onTouchMove}
51
- onTouchEnd={props.onTouchEnd}
52
- >
53
- <RootSurface otherAttributes={attrs} title={title} desc={desc} ref={ref}>
54
- <ClipPathProvider>{children}</ClipPathProvider>
55
- </RootSurface>
56
- </RechartsWrapper>;
39
+ return (
40
+ <RechartsWrapper
41
+ className={className}
42
+ style={style}
43
+ width={width}
44
+ height={height}
45
+ responsive={responsive ?? false}
46
+ onClick={props.onClick}
47
+ onMouseLeave={props.onMouseLeave}
48
+ onMouseEnter={props.onMouseEnter}
49
+ onMouseMove={props.onMouseMove}
50
+ onMouseDown={props.onMouseDown}
51
+ onMouseUp={props.onMouseUp}
52
+ onContextMenu={props.onContextMenu}
53
+ onDoubleClick={props.onDoubleClick}
54
+ onTouchStart={props.onTouchStart}
55
+ onTouchMove={props.onTouchMove}
56
+ onTouchEnd={props.onTouchEnd}
57
+ >
58
+ <RootSurface otherAttributes={attrs} title={title} desc={desc} ref={ref}>
59
+ <ClipPathProvider>{children}</ClipPathProvider>
60
+ </RootSurface>
61
+ </RechartsWrapper>
62
+ );
57
63
  }
@@ -11,16 +11,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];
11
11
  * @provides CartesianViewBoxContext
12
12
  * @provides CartesianChartContext
13
13
  */
14
- export function ComposedChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
15
- ref?: Ref<SVGSVGElement>;
16
- }) {
14
+ export function ComposedChart<DataPointType = unknown>(
15
+ props: CartesianChartProps<DataPointType> & {
16
+ ref?: Ref<SVGSVGElement>;
17
+ },
18
+ ) {
17
19
  const { ref, ...rest } = props;
18
- return <CartesianChart
19
- chartName="ComposedChart"
20
- defaultTooltipEventType="axis"
21
- validateTooltipEventTypes={allowedTooltipTypes}
22
- tooltipPayloadSearcher={arrayTooltipSearcher}
23
- categoricalChartProps={rest}
24
- ref={ref}
25
- />;
20
+ return (
21
+ <CartesianChart
22
+ chartName="ComposedChart"
23
+ defaultTooltipEventType="axis"
24
+ validateTooltipEventTypes={allowedTooltipTypes}
25
+ tooltipPayloadSearcher={arrayTooltipSearcher}
26
+ categoricalChartProps={rest}
27
+ ref={ref}
28
+ />
29
+ );
26
30
  }
@@ -11,16 +11,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['item'];
11
11
  * @provides CartesianViewBoxContext
12
12
  * @provides CartesianChartContext
13
13
  */
14
- export function FunnelChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
15
- ref?: Ref<SVGSVGElement>;
16
- }) {
14
+ export function FunnelChart<DataPointType = unknown>(
15
+ props: CartesianChartProps<DataPointType> & {
16
+ ref?: Ref<SVGSVGElement>;
17
+ },
18
+ ) {
17
19
  const { ref, ...rest } = props;
18
- return <CartesianChart
19
- chartName="FunnelChart"
20
- defaultTooltipEventType="item"
21
- validateTooltipEventTypes={allowedTooltipTypes}
22
- tooltipPayloadSearcher={arrayTooltipSearcher}
23
- categoricalChartProps={rest}
24
- ref={ref}
25
- />;
20
+ return (
21
+ <CartesianChart
22
+ chartName="FunnelChart"
23
+ defaultTooltipEventType="item"
24
+ validateTooltipEventTypes={allowedTooltipTypes}
25
+ tooltipPayloadSearcher={arrayTooltipSearcher}
26
+ categoricalChartProps={rest}
27
+ ref={ref}
28
+ />
29
+ );
26
30
  }
@@ -13,16 +13,20 @@ const allowedTooltipTypes: ReadonlyArray<TooltipEventType> = ['axis'];
13
13
  * @provides CartesianViewBoxContext
14
14
  * @provides CartesianChartContext
15
15
  */
16
- export function LineChart<DataPointType = unknown>(props: CartesianChartProps<DataPointType> & {
17
- ref?: Ref<SVGSVGElement>;
18
- }) {
16
+ export function LineChart<DataPointType = unknown>(
17
+ props: CartesianChartProps<DataPointType> & {
18
+ ref?: Ref<SVGSVGElement>;
19
+ },
20
+ ) {
19
21
  const { ref, ...rest } = props;
20
- return <CartesianChart
21
- chartName="LineChart"
22
- defaultTooltipEventType="axis"
23
- validateTooltipEventTypes={allowedTooltipTypes}
24
- tooltipPayloadSearcher={arrayTooltipSearcher}
25
- categoricalChartProps={rest}
26
- ref={ref}
27
- />;
22
+ return (
23
+ <CartesianChart
24
+ chartName="LineChart"
25
+ defaultTooltipEventType="axis"
26
+ validateTooltipEventTypes={allowedTooltipTypes}
27
+ tooltipPayloadSearcher={arrayTooltipSearcher}
28
+ categoricalChartProps={rest}
29
+ ref={ref}
30
+ />
31
+ );
28
32
  }