@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.
- package/package.json +5 -5
- package/src/animation/AnimatedItems.tsrx +36 -31
- package/src/animation/CSSTransitionAnimate.tsrx +1 -2
- package/src/animation/JavascriptAnimate.tsrx +1 -2
- package/src/cartesian/Area.tsrx +414 -386
- package/src/cartesian/AreaRevealShape.tsrx +103 -84
- package/src/cartesian/Bar.tsrx +343 -317
- package/src/cartesian/BarStack.tsrx +33 -28
- package/src/cartesian/CartesianAxis.tsrx +168 -165
- package/src/cartesian/CartesianGrid.tsrx +256 -272
- package/src/cartesian/ErrorBar.tsrx +108 -104
- package/src/cartesian/Funnel.tsrx +405 -382
- package/src/cartesian/GraphicalItemClipPath.tsrx +4 -8
- package/src/cartesian/Line.tsrx +190 -177
- package/src/cartesian/LineDrawShape.tsrx +14 -15
- package/src/cartesian/ReferenceLine.tsrx +119 -105
- package/src/cartesian/Scatter.tsrx +416 -398
- package/src/cartesian/XAxis.tsrx +39 -32
- package/src/cartesian/YAxis.tsrx +47 -37
- package/src/cartesian/ZAxis.tsrx +76 -73
- package/src/chart/AreaChart.tsrx +15 -11
- package/src/chart/BarChart.tsrx +15 -11
- package/src/chart/CategoricalChart.tsrx +32 -26
- package/src/chart/ComposedChart.tsrx +15 -11
- package/src/chart/FunnelChart.tsrx +15 -11
- package/src/chart/LineChart.tsrx +15 -11
- package/src/chart/PieChart.tsrx +15 -11
- package/src/chart/PolarChart.tsrx +45 -48
- package/src/chart/RadarChart.tsrx +38 -32
- package/src/chart/RadialBarChart.tsrx +15 -11
- package/src/chart/RechartsWrapper.tsrx +214 -162
- package/src/chart/Sankey.tsrx +412 -378
- package/src/chart/ScatterChart.tsrx +15 -11
- package/src/chart/SunburstChart.tsrx +162 -155
- package/src/component/ActivePoints.tsrx +19 -13
- package/src/component/Cursor.tsrx +25 -18
- package/src/component/DefaultLegendContent.tsrx +131 -127
- package/src/component/DefaultTooltipContent.tsrx +46 -42
- package/src/component/Dots.tsrx +11 -5
- package/src/component/Label.tsrx +69 -55
- package/src/component/LabelList.tsrx +32 -27
- package/src/component/Legend.tsrx +120 -123
- package/src/component/ResponsiveContainer.tsrx +18 -11
- package/src/component/Text.tsrx +50 -43
- package/src/component/Tooltip.tsrx +234 -223
- package/src/component/TooltipBoundingBox.tsrx +34 -34
- package/src/container/ClipPathProvider.tsrx +1 -3
- package/src/container/Layer.tsrx +5 -1
- package/src/container/RootSurface.tsrx +31 -21
- package/src/container/Surface.tsrx +15 -13
- package/src/context/ErrorBarContext.tsrx +5 -5
- package/src/polar/Pie.tsrx +541 -487
- package/src/polar/PolarAngleAxis.tsrx +245 -227
- package/src/polar/PolarGrid.tsrx +139 -127
- package/src/polar/PolarRadiusAxis.tsrx +204 -185
- package/src/polar/Radar.tsrx +274 -264
- package/src/polar/RadialBar.tsrx +408 -361
- package/src/shape/Cross.tsrx +13 -7
- package/src/shape/Curve.tsrx +54 -44
- package/src/shape/Dot.tsrx +10 -8
- package/src/shape/Polygon.tsrx +38 -29
- package/src/shape/Rectangle.tsrx +73 -28
- package/src/shape/Sector.tsrx +30 -18
- package/src/shape/Symbols.tsrx +13 -11
- package/src/shape/Trapezoid.tsrx +16 -11
- package/src/state/RechartsStoreProvider.tsrx +5 -1
- package/src/synchronisation/useChartSynchronisation.tsrx +8 -7
- package/src/util/BarUtils.tsrx +43 -40
- package/src/util/FunnelUtils.tsrx +5 -5
- package/src/util/RadialBarUtils.tsrx +3 -4
- package/src/util/ScatterUtils.tsrx +13 -8
- package/src/zIndex/ZIndexLayer.tsrx +2 -2
- package/src/zIndex/ZIndexPortal.tsrx +2 -8
package/src/cartesian/XAxis.tsrx
CHANGED
|
@@ -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?:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
type PropsWithDefaults<DataPointType = any, DataValueType = any> =
|
|
54
|
-
|
|
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(
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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 = {
|
package/src/cartesian/YAxis.tsrx
CHANGED
|
@@ -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?:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
type PropsWithDefaults<DataPointType = any, DataValueType = any> =
|
|
59
|
-
|
|
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(
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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' ||
|
|
146
|
-
|
|
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
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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 = {
|
package/src/cartesian/ZAxis.tsrx
CHANGED
|
@@ -42,73 +42,74 @@ export interface Props<DataPointType = any, DataValueType = any> extends Omit<
|
|
|
42
42
|
'domain'
|
|
43
43
|
> {
|
|
44
44
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
* The unique id of z-axis.
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue 0
|
|
60
|
+
*/
|
|
61
61
|
zAxisId?: AxisId;
|
|
62
62
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
scale?:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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';
|
package/src/chart/AreaChart.tsrx
CHANGED
|
@@ -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>(
|
|
15
|
-
|
|
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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
}
|
package/src/chart/BarChart.tsrx
CHANGED
|
@@ -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>(
|
|
17
|
-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
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>(
|
|
15
|
-
|
|
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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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>(
|
|
15
|
-
|
|
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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
}
|
package/src/chart/LineChart.tsrx
CHANGED
|
@@ -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>(
|
|
17
|
-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
}
|