@mui/x-charts 6.0.0-alpha.5 → 6.0.0-alpha.7
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/BarChart/BarChart.d.ts +18 -2
- package/BarChart/BarChart.js +74 -17
- package/BarChart/BarElement.d.ts +22 -0
- package/BarChart/BarElement.js +21 -10
- package/BarChart/BarPlot.d.ts +14 -1
- package/BarChart/BarPlot.js +23 -4
- package/BarChart/formatter.js +23 -12
- package/CHANGELOG.md +154 -0
- package/ChartContainer/index.js +3 -0
- package/ChartsAxis/ChartsAxis.d.ts +11 -1
- package/ChartsAxis/ChartsAxis.js +51 -6
- package/ChartsLegend/ChartsLegend.d.ts +25 -2
- package/ChartsLegend/ChartsLegend.js +49 -17
- package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
- package/ChartsXAxis/ChartsXAxis.js +44 -9
- package/ChartsYAxis/ChartsYAxis.js +44 -9
- package/LineChart/AreaElement.d.ts +22 -0
- package/LineChart/AreaElement.js +31 -11
- package/LineChart/AreaPlot.d.ts +14 -1
- package/LineChart/AreaPlot.js +32 -5
- package/LineChart/LineChart.d.ts +20 -2
- package/LineChart/LineChart.js +76 -16
- package/LineChart/LineElement.d.ts +22 -0
- package/LineChart/LineElement.js +31 -10
- package/LineChart/LinePlot.d.ts +14 -1
- package/LineChart/LinePlot.js +38 -6
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkPlot.d.ts +24 -1
- package/LineChart/MarkPlot.js +30 -6
- package/LineChart/formatter.js +23 -12
- package/PieChart/PieArcLabel.js +0 -1
- package/PieChart/PieChart.d.ts +14 -2
- package/PieChart/PieChart.js +60 -13
- package/PieChart/PiePlot.d.ts +27 -1
- package/PieChart/PiePlot.js +29 -6
- package/ScatterChart/ScatterChart.d.ts +18 -2
- package/ScatterChart/ScatterChart.js +64 -13
- package/ScatterChart/ScatterPlot.d.ts +24 -1
- package/ScatterChart/ScatterPlot.js +28 -4
- package/SparkLineChart/SparkLineChart.d.ts +73 -0
- package/SparkLineChart/SparkLineChart.js +218 -0
- package/SparkLineChart/index.d.ts +1 -0
- package/SparkLineChart/index.js +12 -0
- package/SparkLineChart/package.json +6 -0
- package/colorPalettes/colorPalettes.js +2 -2
- package/context/CartesianContextProvider.d.ts +3 -1
- package/context/CartesianContextProvider.js +50 -14
- package/context/SeriesContextProvider.d.ts +3 -2
- package/context/SeriesContextProvider.js +5 -3
- package/esm/BarChart/BarChart.js +77 -17
- package/esm/BarChart/BarElement.js +21 -11
- package/esm/BarChart/BarPlot.js +23 -4
- package/esm/BarChart/formatter.js +23 -12
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +51 -6
- package/esm/ChartsLegend/ChartsLegend.js +47 -14
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
- package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
- package/esm/LineChart/AreaElement.js +31 -11
- package/esm/LineChart/AreaPlot.js +33 -5
- package/esm/LineChart/LineChart.js +79 -16
- package/esm/LineChart/LineElement.js +31 -11
- package/esm/LineChart/LinePlot.js +45 -9
- package/esm/LineChart/MarkElement.js +1 -1
- package/esm/LineChart/MarkPlot.js +31 -6
- package/esm/LineChart/formatter.js +23 -13
- package/esm/PieChart/PieArcLabel.js +0 -1
- package/esm/PieChart/PieChart.js +60 -13
- package/esm/PieChart/PiePlot.js +31 -6
- package/esm/ScatterChart/ScatterChart.js +64 -13
- package/esm/ScatterChart/ScatterPlot.js +29 -4
- package/esm/SparkLineChart/SparkLineChart.js +210 -0
- package/esm/SparkLineChart/index.js +1 -0
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/context/CartesianContextProvider.js +50 -14
- package/esm/context/SeriesContextProvider.js +5 -3
- package/esm/hooks/useTicks.js +9 -6
- package/esm/index.js +1 -0
- package/esm/internals/components/AxisSharedComponents.js +10 -10
- package/esm/models/index.js +3 -1
- package/hooks/useTicks.d.ts +20 -5
- package/hooks/useTicks.js +9 -6
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/components/AxisSharedComponents.d.ts +4 -4
- package/internals/components/AxisSharedComponents.js +15 -15
- package/internals/defaultizeColor.d.ts +4 -2
- package/legacy/BarChart/BarChart.js +75 -17
- package/legacy/BarChart/BarElement.js +20 -10
- package/legacy/BarChart/BarPlot.js +23 -4
- package/legacy/BarChart/formatter.js +23 -10
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +51 -6
- package/legacy/ChartsLegend/ChartsLegend.js +46 -15
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
- package/legacy/LineChart/AreaElement.js +30 -10
- package/legacy/LineChart/AreaPlot.js +31 -5
- package/legacy/LineChart/LineChart.js +77 -16
- package/legacy/LineChart/LineElement.js +30 -10
- package/legacy/LineChart/LinePlot.js +38 -6
- package/legacy/LineChart/MarkElement.js +1 -1
- package/legacy/LineChart/MarkPlot.js +29 -6
- package/legacy/LineChart/formatter.js +23 -11
- package/legacy/PieChart/PieArcLabel.js +0 -1
- package/legacy/PieChart/PieChart.js +60 -13
- package/legacy/PieChart/PiePlot.js +29 -6
- package/legacy/ScatterChart/ScatterChart.js +64 -13
- package/legacy/ScatterChart/ScatterPlot.js +27 -4
- package/legacy/SparkLineChart/SparkLineChart.js +214 -0
- package/legacy/SparkLineChart/index.js +1 -0
- package/legacy/colorPalettes/colorPalettes.js +2 -2
- package/legacy/context/CartesianContextProvider.js +59 -15
- package/legacy/context/SeriesContextProvider.js +6 -4
- package/legacy/hooks/useTicks.js +9 -9
- package/legacy/index.js +2 -1
- package/legacy/internals/components/AxisSharedComponents.js +10 -10
- package/legacy/models/index.js +3 -1
- package/models/axis.d.ts +34 -3
- package/models/index.d.ts +2 -0
- package/models/index.js +11 -0
- package/models/seriesType/bar.d.ts +8 -1
- package/models/seriesType/common.d.ts +2 -2
- package/models/seriesType/config.d.ts +4 -1
- package/models/seriesType/line.d.ts +8 -1
- package/modern/BarChart/BarChart.js +74 -17
- package/modern/BarChart/BarElement.js +20 -11
- package/modern/BarChart/BarPlot.js +23 -4
- package/modern/BarChart/formatter.js +23 -12
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +51 -6
- package/modern/ChartsLegend/ChartsLegend.js +46 -14
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
- package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
- package/modern/LineChart/AreaElement.js +30 -11
- package/modern/LineChart/AreaPlot.js +33 -5
- package/modern/LineChart/LineChart.js +76 -16
- package/modern/LineChart/LineElement.js +30 -11
- package/modern/LineChart/LinePlot.js +39 -6
- package/modern/LineChart/MarkElement.js +1 -1
- package/modern/LineChart/MarkPlot.js +30 -6
- package/modern/LineChart/formatter.js +23 -13
- package/modern/PieChart/PieArcLabel.js +0 -1
- package/modern/PieChart/PieChart.js +60 -13
- package/modern/PieChart/PiePlot.js +30 -6
- package/modern/ScatterChart/ScatterChart.js +64 -13
- package/modern/ScatterChart/ScatterPlot.js +28 -4
- package/modern/SparkLineChart/SparkLineChart.js +210 -0
- package/modern/SparkLineChart/index.js +1 -0
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/context/CartesianContextProvider.js +50 -14
- package/modern/context/SeriesContextProvider.js +5 -3
- package/modern/hooks/useTicks.js +9 -6
- package/modern/index.js +2 -1
- package/modern/internals/components/AxisSharedComponents.js +10 -10
- package/modern/models/index.js +3 -1
- package/package.json +4 -2
- package/themeAugmentation/components.d.ts +0 -10
- package/themeAugmentation/overrides.d.ts +0 -2
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -44,7 +44,9 @@ function PieChart(props) {
|
|
|
44
44
|
leftAxis = null,
|
|
45
45
|
rightAxis = null,
|
|
46
46
|
bottomAxis = null,
|
|
47
|
-
children
|
|
47
|
+
children,
|
|
48
|
+
slots,
|
|
49
|
+
slotProps
|
|
48
50
|
} = props;
|
|
49
51
|
const margin = _extends({}, defaultMargin, marginProps);
|
|
50
52
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
@@ -67,8 +69,16 @@ function PieChart(props) {
|
|
|
67
69
|
topAxis: topAxis,
|
|
68
70
|
leftAxis: leftAxis,
|
|
69
71
|
rightAxis: rightAxis,
|
|
70
|
-
bottomAxis: bottomAxis
|
|
71
|
-
|
|
72
|
+
bottomAxis: bottomAxis,
|
|
73
|
+
slots: slots,
|
|
74
|
+
slotProps: slotProps
|
|
75
|
+
}), /*#__PURE__*/_jsx(PiePlot, {
|
|
76
|
+
slots: slots,
|
|
77
|
+
slotProps: slotProps
|
|
78
|
+
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
79
|
+
slots: slots,
|
|
80
|
+
slotProps: slotProps
|
|
81
|
+
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), children]
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
84
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -94,8 +104,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
94
104
|
label: PropTypes.string,
|
|
95
105
|
labelFontSize: PropTypes.number,
|
|
96
106
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
107
|
+
slotProps: PropTypes.object,
|
|
108
|
+
slots: PropTypes.object,
|
|
97
109
|
stroke: PropTypes.string,
|
|
98
110
|
tickFontSize: PropTypes.number,
|
|
111
|
+
tickMaxStep: PropTypes.number,
|
|
112
|
+
tickMinStep: PropTypes.number,
|
|
113
|
+
tickNumber: PropTypes.number,
|
|
99
114
|
tickSize: PropTypes.number
|
|
100
115
|
}), PropTypes.string]),
|
|
101
116
|
children: PropTypes.node,
|
|
@@ -104,6 +119,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
104
119
|
* Color palette used to colorize multiple series.
|
|
105
120
|
*/
|
|
106
121
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
122
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
107
123
|
desc: PropTypes.string,
|
|
108
124
|
disableAxisListener: PropTypes.bool,
|
|
109
125
|
height: PropTypes.number,
|
|
@@ -121,8 +137,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
121
137
|
label: PropTypes.string,
|
|
122
138
|
labelFontSize: PropTypes.number,
|
|
123
139
|
position: PropTypes.oneOf(['left', 'right']),
|
|
140
|
+
slotProps: PropTypes.object,
|
|
141
|
+
slots: PropTypes.object,
|
|
124
142
|
stroke: PropTypes.string,
|
|
125
143
|
tickFontSize: PropTypes.number,
|
|
144
|
+
tickMaxStep: PropTypes.number,
|
|
145
|
+
tickMinStep: PropTypes.number,
|
|
146
|
+
tickNumber: PropTypes.number,
|
|
126
147
|
tickSize: PropTypes.number
|
|
127
148
|
}), PropTypes.string]),
|
|
128
149
|
legend: PropTypes.shape({
|
|
@@ -139,6 +160,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
139
160
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
140
161
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
141
162
|
}),
|
|
163
|
+
slotProps: PropTypes.object,
|
|
164
|
+
slots: PropTypes.object,
|
|
142
165
|
spacing: PropTypes.number
|
|
143
166
|
}),
|
|
144
167
|
margin: PropTypes.shape({
|
|
@@ -161,8 +184,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
161
184
|
label: PropTypes.string,
|
|
162
185
|
labelFontSize: PropTypes.number,
|
|
163
186
|
position: PropTypes.oneOf(['left', 'right']),
|
|
187
|
+
slotProps: PropTypes.object,
|
|
188
|
+
slots: PropTypes.object,
|
|
164
189
|
stroke: PropTypes.string,
|
|
165
190
|
tickFontSize: PropTypes.number,
|
|
191
|
+
tickMaxStep: PropTypes.number,
|
|
192
|
+
tickMinStep: PropTypes.number,
|
|
193
|
+
tickNumber: PropTypes.number,
|
|
166
194
|
tickSize: PropTypes.number
|
|
167
195
|
}), PropTypes.string]),
|
|
168
196
|
series: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -204,6 +232,12 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
204
232
|
type: PropTypes.oneOf(['pie']),
|
|
205
233
|
valueFormatter: PropTypes.func
|
|
206
234
|
})).isRequired,
|
|
235
|
+
/**
|
|
236
|
+
* The props used for each component slot.
|
|
237
|
+
* @default {}
|
|
238
|
+
*/
|
|
239
|
+
slotProps: PropTypes.object,
|
|
240
|
+
slots: PropTypes.object,
|
|
207
241
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
208
242
|
title: PropTypes.string,
|
|
209
243
|
tooltip: PropTypes.shape({
|
|
@@ -226,8 +260,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
226
260
|
label: PropTypes.string,
|
|
227
261
|
labelFontSize: PropTypes.number,
|
|
228
262
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
263
|
+
slotProps: PropTypes.object,
|
|
264
|
+
slots: PropTypes.object,
|
|
229
265
|
stroke: PropTypes.string,
|
|
230
266
|
tickFontSize: PropTypes.number,
|
|
267
|
+
tickMaxStep: PropTypes.number,
|
|
268
|
+
tickMinStep: PropTypes.number,
|
|
269
|
+
tickNumber: PropTypes.number,
|
|
231
270
|
tickSize: PropTypes.number
|
|
232
271
|
}), PropTypes.string]),
|
|
233
272
|
viewBox: PropTypes.shape({
|
|
@@ -241,44 +280,52 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
241
280
|
axisId: PropTypes.string,
|
|
242
281
|
classes: PropTypes.object,
|
|
243
282
|
data: PropTypes.array,
|
|
283
|
+
dataKey: PropTypes.string,
|
|
244
284
|
disableLine: PropTypes.bool,
|
|
245
285
|
disableTicks: PropTypes.bool,
|
|
246
286
|
fill: PropTypes.string,
|
|
287
|
+
hideTooltip: PropTypes.bool,
|
|
247
288
|
id: PropTypes.string,
|
|
248
289
|
label: PropTypes.string,
|
|
249
290
|
labelFontSize: PropTypes.number,
|
|
250
|
-
max: PropTypes.number,
|
|
251
|
-
|
|
252
|
-
min: PropTypes.number,
|
|
253
|
-
minTicks: PropTypes.number,
|
|
291
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
292
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
254
293
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
255
294
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
295
|
+
slotProps: PropTypes.object,
|
|
296
|
+
slots: PropTypes.object,
|
|
256
297
|
stroke: PropTypes.string,
|
|
257
298
|
tickFontSize: PropTypes.number,
|
|
299
|
+
tickMaxStep: PropTypes.number,
|
|
300
|
+
tickMinStep: PropTypes.number,
|
|
301
|
+
tickNumber: PropTypes.number,
|
|
258
302
|
tickSize: PropTypes.number,
|
|
259
|
-
tickSpacing: PropTypes.number,
|
|
260
303
|
valueFormatter: PropTypes.func
|
|
261
304
|
})),
|
|
262
305
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
263
306
|
axisId: PropTypes.string,
|
|
264
307
|
classes: PropTypes.object,
|
|
265
308
|
data: PropTypes.array,
|
|
309
|
+
dataKey: PropTypes.string,
|
|
266
310
|
disableLine: PropTypes.bool,
|
|
267
311
|
disableTicks: PropTypes.bool,
|
|
268
312
|
fill: PropTypes.string,
|
|
313
|
+
hideTooltip: PropTypes.bool,
|
|
269
314
|
id: PropTypes.string,
|
|
270
315
|
label: PropTypes.string,
|
|
271
316
|
labelFontSize: PropTypes.number,
|
|
272
|
-
max: PropTypes.number,
|
|
273
|
-
|
|
274
|
-
min: PropTypes.number,
|
|
275
|
-
minTicks: PropTypes.number,
|
|
317
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
318
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
276
319
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
277
320
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
321
|
+
slotProps: PropTypes.object,
|
|
322
|
+
slots: PropTypes.object,
|
|
278
323
|
stroke: PropTypes.string,
|
|
279
324
|
tickFontSize: PropTypes.number,
|
|
325
|
+
tickMaxStep: PropTypes.number,
|
|
326
|
+
tickMinStep: PropTypes.number,
|
|
327
|
+
tickNumber: PropTypes.number,
|
|
280
328
|
tickSize: PropTypes.number,
|
|
281
|
-
tickSpacing: PropTypes.number,
|
|
282
329
|
valueFormatter: PropTypes.func
|
|
283
330
|
}))
|
|
284
331
|
} : void 0;
|
package/esm/PieChart/PiePlot.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
4
5
|
import PieArc from './PieArc';
|
|
5
6
|
import PieArcLabel from './PieArcLabel';
|
|
@@ -22,7 +23,12 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
|
22
23
|
}
|
|
23
24
|
return arcLabel(item);
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
function PiePlot(props) {
|
|
27
|
+
var _slots$pieArc, _slots$pieArcLabel;
|
|
28
|
+
const {
|
|
29
|
+
slots,
|
|
30
|
+
slotProps
|
|
31
|
+
} = props;
|
|
26
32
|
const seriesData = React.useContext(SeriesContext).pie;
|
|
27
33
|
const {
|
|
28
34
|
left,
|
|
@@ -42,6 +48,8 @@ export function PiePlot() {
|
|
|
42
48
|
series,
|
|
43
49
|
seriesOrder
|
|
44
50
|
} = seriesData;
|
|
51
|
+
const Arc = (_slots$pieArc = slots == null ? void 0 : slots.pieArc) != null ? _slots$pieArc : PieArc;
|
|
52
|
+
const ArcLabel = (_slots$pieArcLabel = slots == null ? void 0 : slots.pieArcLabel) != null ? _slots$pieArcLabel : PieArcLabel;
|
|
45
53
|
return /*#__PURE__*/_jsx("g", {
|
|
46
54
|
children: seriesOrder.map(seriesId => {
|
|
47
55
|
const {
|
|
@@ -60,7 +68,7 @@ export function PiePlot() {
|
|
|
60
68
|
transform: `translate(${cx === undefined ? center.x : left + cx}, ${cy === undefined ? center.y : top + cy})`,
|
|
61
69
|
children: /*#__PURE__*/_jsxs("g", {
|
|
62
70
|
children: [data.map((item, index) => {
|
|
63
|
-
return /*#__PURE__*/_createElement(
|
|
71
|
+
return /*#__PURE__*/_createElement(Arc, _extends({}, item, {
|
|
64
72
|
key: item.id,
|
|
65
73
|
innerRadius: innerRadius,
|
|
66
74
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -71,9 +79,9 @@ export function PiePlot() {
|
|
|
71
79
|
highlightScope: series[seriesId].highlightScope,
|
|
72
80
|
highlighted: highlighted,
|
|
73
81
|
faded: faded
|
|
74
|
-
}));
|
|
82
|
+
}, slotProps == null ? void 0 : slotProps.pieArc));
|
|
75
83
|
}), data.map((item, index) => {
|
|
76
|
-
return /*#__PURE__*/_createElement(
|
|
84
|
+
return /*#__PURE__*/_createElement(ArcLabel, _extends({}, item, {
|
|
77
85
|
key: item.id,
|
|
78
86
|
innerRadius: innerRadius,
|
|
79
87
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -83,10 +91,27 @@ export function PiePlot() {
|
|
|
83
91
|
dataIndex: index,
|
|
84
92
|
highlightScope: series[seriesId].highlightScope,
|
|
85
93
|
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
86
|
-
}));
|
|
94
|
+
}, slotProps == null ? void 0 : slotProps.pieArcLabel));
|
|
87
95
|
})]
|
|
88
96
|
})
|
|
89
97
|
}, seriesId);
|
|
90
98
|
})
|
|
91
99
|
});
|
|
92
|
-
}
|
|
100
|
+
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* The props used for each component slot.
|
|
108
|
+
* @default {}
|
|
109
|
+
*/
|
|
110
|
+
slotProps: PropTypes.object,
|
|
111
|
+
/**
|
|
112
|
+
* Overridable component slots.
|
|
113
|
+
* @default {}
|
|
114
|
+
*/
|
|
115
|
+
slots: PropTypes.object
|
|
116
|
+
} : void 0;
|
|
117
|
+
export { PiePlot };
|
|
@@ -26,7 +26,9 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
26
26
|
leftAxis,
|
|
27
27
|
rightAxis,
|
|
28
28
|
bottomAxis,
|
|
29
|
-
children
|
|
29
|
+
children,
|
|
30
|
+
slots,
|
|
31
|
+
slotProps
|
|
30
32
|
} = props;
|
|
31
33
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
32
34
|
ref: ref,
|
|
@@ -44,8 +46,16 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
44
46
|
topAxis: topAxis,
|
|
45
47
|
leftAxis: leftAxis,
|
|
46
48
|
rightAxis: rightAxis,
|
|
47
|
-
bottomAxis: bottomAxis
|
|
48
|
-
|
|
49
|
+
bottomAxis: bottomAxis,
|
|
50
|
+
slots: slots,
|
|
51
|
+
slotProps: slotProps
|
|
52
|
+
}), /*#__PURE__*/_jsx(ScatterPlot, {
|
|
53
|
+
slots: slots,
|
|
54
|
+
slotProps: slotProps
|
|
55
|
+
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
56
|
+
slots: slots,
|
|
57
|
+
slotProps: slotProps
|
|
58
|
+
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({
|
|
49
59
|
x: "none",
|
|
50
60
|
y: "none"
|
|
51
61
|
}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({
|
|
@@ -76,8 +86,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
76
86
|
label: PropTypes.string,
|
|
77
87
|
labelFontSize: PropTypes.number,
|
|
78
88
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
89
|
+
slotProps: PropTypes.object,
|
|
90
|
+
slots: PropTypes.object,
|
|
79
91
|
stroke: PropTypes.string,
|
|
80
92
|
tickFontSize: PropTypes.number,
|
|
93
|
+
tickMaxStep: PropTypes.number,
|
|
94
|
+
tickMinStep: PropTypes.number,
|
|
95
|
+
tickNumber: PropTypes.number,
|
|
81
96
|
tickSize: PropTypes.number
|
|
82
97
|
}), PropTypes.string]),
|
|
83
98
|
children: PropTypes.node,
|
|
@@ -86,6 +101,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
86
101
|
* Color palette used to colorize multiple series.
|
|
87
102
|
*/
|
|
88
103
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
104
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
89
105
|
desc: PropTypes.string,
|
|
90
106
|
disableAxisListener: PropTypes.bool,
|
|
91
107
|
height: PropTypes.number,
|
|
@@ -103,8 +119,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
103
119
|
label: PropTypes.string,
|
|
104
120
|
labelFontSize: PropTypes.number,
|
|
105
121
|
position: PropTypes.oneOf(['left', 'right']),
|
|
122
|
+
slotProps: PropTypes.object,
|
|
123
|
+
slots: PropTypes.object,
|
|
106
124
|
stroke: PropTypes.string,
|
|
107
125
|
tickFontSize: PropTypes.number,
|
|
126
|
+
tickMaxStep: PropTypes.number,
|
|
127
|
+
tickMinStep: PropTypes.number,
|
|
128
|
+
tickNumber: PropTypes.number,
|
|
108
129
|
tickSize: PropTypes.number
|
|
109
130
|
}), PropTypes.string]),
|
|
110
131
|
legend: PropTypes.shape({
|
|
@@ -121,6 +142,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
121
142
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
122
143
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
123
144
|
}),
|
|
145
|
+
slotProps: PropTypes.object,
|
|
146
|
+
slots: PropTypes.object,
|
|
124
147
|
spacing: PropTypes.number
|
|
125
148
|
}),
|
|
126
149
|
margin: PropTypes.shape({
|
|
@@ -143,8 +166,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
143
166
|
label: PropTypes.string,
|
|
144
167
|
labelFontSize: PropTypes.number,
|
|
145
168
|
position: PropTypes.oneOf(['left', 'right']),
|
|
169
|
+
slotProps: PropTypes.object,
|
|
170
|
+
slots: PropTypes.object,
|
|
146
171
|
stroke: PropTypes.string,
|
|
147
172
|
tickFontSize: PropTypes.number,
|
|
173
|
+
tickMaxStep: PropTypes.number,
|
|
174
|
+
tickMinStep: PropTypes.number,
|
|
175
|
+
tickNumber: PropTypes.number,
|
|
148
176
|
tickSize: PropTypes.number
|
|
149
177
|
}), PropTypes.string]),
|
|
150
178
|
series: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -166,6 +194,16 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
166
194
|
xAxisKey: PropTypes.string,
|
|
167
195
|
yAxisKey: PropTypes.string
|
|
168
196
|
})).isRequired,
|
|
197
|
+
/**
|
|
198
|
+
* The props used for each component slot.
|
|
199
|
+
* @default {}
|
|
200
|
+
*/
|
|
201
|
+
slotProps: PropTypes.object,
|
|
202
|
+
/**
|
|
203
|
+
* Overridable component slots.
|
|
204
|
+
* @default {}
|
|
205
|
+
*/
|
|
206
|
+
slots: PropTypes.object,
|
|
169
207
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
170
208
|
title: PropTypes.string,
|
|
171
209
|
tooltip: PropTypes.shape({
|
|
@@ -188,8 +226,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
188
226
|
label: PropTypes.string,
|
|
189
227
|
labelFontSize: PropTypes.number,
|
|
190
228
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
229
|
+
slotProps: PropTypes.object,
|
|
230
|
+
slots: PropTypes.object,
|
|
191
231
|
stroke: PropTypes.string,
|
|
192
232
|
tickFontSize: PropTypes.number,
|
|
233
|
+
tickMaxStep: PropTypes.number,
|
|
234
|
+
tickMinStep: PropTypes.number,
|
|
235
|
+
tickNumber: PropTypes.number,
|
|
193
236
|
tickSize: PropTypes.number
|
|
194
237
|
}), PropTypes.string]),
|
|
195
238
|
viewBox: PropTypes.shape({
|
|
@@ -203,44 +246,52 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
203
246
|
axisId: PropTypes.string,
|
|
204
247
|
classes: PropTypes.object,
|
|
205
248
|
data: PropTypes.array,
|
|
249
|
+
dataKey: PropTypes.string,
|
|
206
250
|
disableLine: PropTypes.bool,
|
|
207
251
|
disableTicks: PropTypes.bool,
|
|
208
252
|
fill: PropTypes.string,
|
|
253
|
+
hideTooltip: PropTypes.bool,
|
|
209
254
|
id: PropTypes.string,
|
|
210
255
|
label: PropTypes.string,
|
|
211
256
|
labelFontSize: PropTypes.number,
|
|
212
|
-
max: PropTypes.number,
|
|
213
|
-
|
|
214
|
-
min: PropTypes.number,
|
|
215
|
-
minTicks: PropTypes.number,
|
|
257
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
258
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
216
259
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
217
260
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
261
|
+
slotProps: PropTypes.object,
|
|
262
|
+
slots: PropTypes.object,
|
|
218
263
|
stroke: PropTypes.string,
|
|
219
264
|
tickFontSize: PropTypes.number,
|
|
265
|
+
tickMaxStep: PropTypes.number,
|
|
266
|
+
tickMinStep: PropTypes.number,
|
|
267
|
+
tickNumber: PropTypes.number,
|
|
220
268
|
tickSize: PropTypes.number,
|
|
221
|
-
tickSpacing: PropTypes.number,
|
|
222
269
|
valueFormatter: PropTypes.func
|
|
223
270
|
})),
|
|
224
271
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
225
272
|
axisId: PropTypes.string,
|
|
226
273
|
classes: PropTypes.object,
|
|
227
274
|
data: PropTypes.array,
|
|
275
|
+
dataKey: PropTypes.string,
|
|
228
276
|
disableLine: PropTypes.bool,
|
|
229
277
|
disableTicks: PropTypes.bool,
|
|
230
278
|
fill: PropTypes.string,
|
|
279
|
+
hideTooltip: PropTypes.bool,
|
|
231
280
|
id: PropTypes.string,
|
|
232
281
|
label: PropTypes.string,
|
|
233
282
|
labelFontSize: PropTypes.number,
|
|
234
|
-
max: PropTypes.number,
|
|
235
|
-
|
|
236
|
-
min: PropTypes.number,
|
|
237
|
-
minTicks: PropTypes.number,
|
|
283
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
284
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
238
285
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
239
286
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
287
|
+
slotProps: PropTypes.object,
|
|
288
|
+
slots: PropTypes.object,
|
|
240
289
|
stroke: PropTypes.string,
|
|
241
290
|
tickFontSize: PropTypes.number,
|
|
291
|
+
tickMaxStep: PropTypes.number,
|
|
292
|
+
tickMinStep: PropTypes.number,
|
|
293
|
+
tickNumber: PropTypes.number,
|
|
242
294
|
tickSize: PropTypes.number,
|
|
243
|
-
tickSpacing: PropTypes.number,
|
|
244
295
|
valueFormatter: PropTypes.func
|
|
245
296
|
}))
|
|
246
297
|
} : void 0;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
2
4
|
import { Scatter } from './Scatter';
|
|
3
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
4
6
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
8
|
+
function ScatterPlot(props) {
|
|
9
|
+
var _slots$scatter;
|
|
10
|
+
const {
|
|
11
|
+
slots,
|
|
12
|
+
slotProps
|
|
13
|
+
} = props;
|
|
7
14
|
const seriesData = React.useContext(SeriesContext).scatter;
|
|
8
15
|
const axisData = React.useContext(CartesianContext);
|
|
9
16
|
if (seriesData === undefined) {
|
|
@@ -21,6 +28,7 @@ export function ScatterPlot() {
|
|
|
21
28
|
} = axisData;
|
|
22
29
|
const defaultXAxisId = xAxisIds[0];
|
|
23
30
|
const defaultYAxisId = yAxisIds[0];
|
|
31
|
+
const ScatterItems = (_slots$scatter = slots == null ? void 0 : slots.scatter) != null ? _slots$scatter : Scatter;
|
|
24
32
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
25
33
|
children: seriesOrder.map(seriesId => {
|
|
26
34
|
const {
|
|
@@ -32,13 +40,30 @@ export function ScatterPlot() {
|
|
|
32
40
|
} = series[seriesId];
|
|
33
41
|
const xScale = xAxis[xAxisKey != null ? xAxisKey : defaultXAxisId].scale;
|
|
34
42
|
const yScale = yAxis[yAxisKey != null ? yAxisKey : defaultYAxisId].scale;
|
|
35
|
-
return /*#__PURE__*/_jsx(
|
|
43
|
+
return /*#__PURE__*/_jsx(ScatterItems, _extends({
|
|
36
44
|
xScale: xScale,
|
|
37
45
|
yScale: yScale,
|
|
38
46
|
color: color,
|
|
39
47
|
markerSize: markerSize != null ? markerSize : 4,
|
|
40
48
|
series: series[seriesId]
|
|
41
|
-
}, id);
|
|
49
|
+
}, slotProps == null ? void 0 : slotProps.scatter), id);
|
|
42
50
|
})
|
|
43
51
|
});
|
|
44
|
-
}
|
|
52
|
+
}
|
|
53
|
+
process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
54
|
+
// ----------------------------- Warning --------------------------------
|
|
55
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
57
|
+
// ----------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* The props used for each component slot.
|
|
60
|
+
* @default {}
|
|
61
|
+
*/
|
|
62
|
+
slotProps: PropTypes.object,
|
|
63
|
+
/**
|
|
64
|
+
* Overridable component slots.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
67
|
+
slots: PropTypes.object
|
|
68
|
+
} : void 0;
|
|
69
|
+
export { ScatterPlot };
|