@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
|
@@ -51,7 +51,9 @@ function PieChart(props) {
|
|
|
51
51
|
rightAxis = _props$rightAxis === void 0 ? null : _props$rightAxis,
|
|
52
52
|
_props$bottomAxis = props.bottomAxis,
|
|
53
53
|
bottomAxis = _props$bottomAxis === void 0 ? null : _props$bottomAxis,
|
|
54
|
-
children = props.children
|
|
54
|
+
children = props.children,
|
|
55
|
+
slots = props.slots,
|
|
56
|
+
slotProps = props.slotProps;
|
|
55
57
|
var margin = _extends({}, defaultMargin, marginProps);
|
|
56
58
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
57
59
|
series: series.map(function (s) {
|
|
@@ -79,8 +81,16 @@ function PieChart(props) {
|
|
|
79
81
|
topAxis: topAxis,
|
|
80
82
|
leftAxis: leftAxis,
|
|
81
83
|
rightAxis: rightAxis,
|
|
82
|
-
bottomAxis: bottomAxis
|
|
83
|
-
|
|
84
|
+
bottomAxis: bottomAxis,
|
|
85
|
+
slots: slots,
|
|
86
|
+
slotProps: slotProps
|
|
87
|
+
}), /*#__PURE__*/_jsx(PiePlot, {
|
|
88
|
+
slots: slots,
|
|
89
|
+
slotProps: slotProps
|
|
90
|
+
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
91
|
+
slots: slots,
|
|
92
|
+
slotProps: slotProps
|
|
93
|
+
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), children]
|
|
84
94
|
});
|
|
85
95
|
}
|
|
86
96
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -106,8 +116,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
106
116
|
label: PropTypes.string,
|
|
107
117
|
labelFontSize: PropTypes.number,
|
|
108
118
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
119
|
+
slotProps: PropTypes.object,
|
|
120
|
+
slots: PropTypes.object,
|
|
109
121
|
stroke: PropTypes.string,
|
|
110
122
|
tickFontSize: PropTypes.number,
|
|
123
|
+
tickMaxStep: PropTypes.number,
|
|
124
|
+
tickMinStep: PropTypes.number,
|
|
125
|
+
tickNumber: PropTypes.number,
|
|
111
126
|
tickSize: PropTypes.number
|
|
112
127
|
}), PropTypes.string]),
|
|
113
128
|
children: PropTypes.node,
|
|
@@ -116,6 +131,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
116
131
|
* Color palette used to colorize multiple series.
|
|
117
132
|
*/
|
|
118
133
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
134
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
119
135
|
desc: PropTypes.string,
|
|
120
136
|
disableAxisListener: PropTypes.bool,
|
|
121
137
|
height: PropTypes.number,
|
|
@@ -133,8 +149,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
133
149
|
label: PropTypes.string,
|
|
134
150
|
labelFontSize: PropTypes.number,
|
|
135
151
|
position: PropTypes.oneOf(['left', 'right']),
|
|
152
|
+
slotProps: PropTypes.object,
|
|
153
|
+
slots: PropTypes.object,
|
|
136
154
|
stroke: PropTypes.string,
|
|
137
155
|
tickFontSize: PropTypes.number,
|
|
156
|
+
tickMaxStep: PropTypes.number,
|
|
157
|
+
tickMinStep: PropTypes.number,
|
|
158
|
+
tickNumber: PropTypes.number,
|
|
138
159
|
tickSize: PropTypes.number
|
|
139
160
|
}), PropTypes.string]),
|
|
140
161
|
legend: PropTypes.shape({
|
|
@@ -151,6 +172,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
151
172
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
152
173
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
153
174
|
}),
|
|
175
|
+
slotProps: PropTypes.object,
|
|
176
|
+
slots: PropTypes.object,
|
|
154
177
|
spacing: PropTypes.number
|
|
155
178
|
}),
|
|
156
179
|
margin: PropTypes.shape({
|
|
@@ -173,8 +196,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
173
196
|
label: PropTypes.string,
|
|
174
197
|
labelFontSize: PropTypes.number,
|
|
175
198
|
position: PropTypes.oneOf(['left', 'right']),
|
|
199
|
+
slotProps: PropTypes.object,
|
|
200
|
+
slots: PropTypes.object,
|
|
176
201
|
stroke: PropTypes.string,
|
|
177
202
|
tickFontSize: PropTypes.number,
|
|
203
|
+
tickMaxStep: PropTypes.number,
|
|
204
|
+
tickMinStep: PropTypes.number,
|
|
205
|
+
tickNumber: PropTypes.number,
|
|
178
206
|
tickSize: PropTypes.number
|
|
179
207
|
}), PropTypes.string]),
|
|
180
208
|
series: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -216,6 +244,12 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
216
244
|
type: PropTypes.oneOf(['pie']),
|
|
217
245
|
valueFormatter: PropTypes.func
|
|
218
246
|
})).isRequired,
|
|
247
|
+
/**
|
|
248
|
+
* The props used for each component slot.
|
|
249
|
+
* @default {}
|
|
250
|
+
*/
|
|
251
|
+
slotProps: PropTypes.object,
|
|
252
|
+
slots: PropTypes.object,
|
|
219
253
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
220
254
|
title: PropTypes.string,
|
|
221
255
|
tooltip: PropTypes.shape({
|
|
@@ -238,8 +272,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
238
272
|
label: PropTypes.string,
|
|
239
273
|
labelFontSize: PropTypes.number,
|
|
240
274
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
275
|
+
slotProps: PropTypes.object,
|
|
276
|
+
slots: PropTypes.object,
|
|
241
277
|
stroke: PropTypes.string,
|
|
242
278
|
tickFontSize: PropTypes.number,
|
|
279
|
+
tickMaxStep: PropTypes.number,
|
|
280
|
+
tickMinStep: PropTypes.number,
|
|
281
|
+
tickNumber: PropTypes.number,
|
|
243
282
|
tickSize: PropTypes.number
|
|
244
283
|
}), PropTypes.string]),
|
|
245
284
|
viewBox: PropTypes.shape({
|
|
@@ -253,44 +292,52 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
253
292
|
axisId: PropTypes.string,
|
|
254
293
|
classes: PropTypes.object,
|
|
255
294
|
data: PropTypes.array,
|
|
295
|
+
dataKey: PropTypes.string,
|
|
256
296
|
disableLine: PropTypes.bool,
|
|
257
297
|
disableTicks: PropTypes.bool,
|
|
258
298
|
fill: PropTypes.string,
|
|
299
|
+
hideTooltip: PropTypes.bool,
|
|
259
300
|
id: PropTypes.string,
|
|
260
301
|
label: PropTypes.string,
|
|
261
302
|
labelFontSize: PropTypes.number,
|
|
262
|
-
max: PropTypes.number,
|
|
263
|
-
|
|
264
|
-
min: PropTypes.number,
|
|
265
|
-
minTicks: PropTypes.number,
|
|
303
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
304
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
266
305
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
267
306
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
307
|
+
slotProps: PropTypes.object,
|
|
308
|
+
slots: PropTypes.object,
|
|
268
309
|
stroke: PropTypes.string,
|
|
269
310
|
tickFontSize: PropTypes.number,
|
|
311
|
+
tickMaxStep: PropTypes.number,
|
|
312
|
+
tickMinStep: PropTypes.number,
|
|
313
|
+
tickNumber: PropTypes.number,
|
|
270
314
|
tickSize: PropTypes.number,
|
|
271
|
-
tickSpacing: PropTypes.number,
|
|
272
315
|
valueFormatter: PropTypes.func
|
|
273
316
|
})),
|
|
274
317
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
275
318
|
axisId: PropTypes.string,
|
|
276
319
|
classes: PropTypes.object,
|
|
277
320
|
data: PropTypes.array,
|
|
321
|
+
dataKey: PropTypes.string,
|
|
278
322
|
disableLine: PropTypes.bool,
|
|
279
323
|
disableTicks: PropTypes.bool,
|
|
280
324
|
fill: PropTypes.string,
|
|
325
|
+
hideTooltip: PropTypes.bool,
|
|
281
326
|
id: PropTypes.string,
|
|
282
327
|
label: PropTypes.string,
|
|
283
328
|
labelFontSize: PropTypes.number,
|
|
284
|
-
max: PropTypes.number,
|
|
285
|
-
|
|
286
|
-
min: PropTypes.number,
|
|
287
|
-
minTicks: PropTypes.number,
|
|
329
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
330
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
288
331
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
289
332
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
333
|
+
slotProps: PropTypes.object,
|
|
334
|
+
slots: PropTypes.object,
|
|
290
335
|
stroke: PropTypes.string,
|
|
291
336
|
tickFontSize: PropTypes.number,
|
|
337
|
+
tickMaxStep: PropTypes.number,
|
|
338
|
+
tickMinStep: PropTypes.number,
|
|
339
|
+
tickNumber: PropTypes.number,
|
|
292
340
|
tickSize: PropTypes.number,
|
|
293
|
-
tickSpacing: PropTypes.number,
|
|
294
341
|
valueFormatter: PropTypes.func
|
|
295
342
|
}))
|
|
296
343
|
} : void 0;
|
|
@@ -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,10 @@ 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
|
+
var slots = props.slots,
|
|
29
|
+
slotProps = props.slotProps;
|
|
26
30
|
var seriesData = React.useContext(SeriesContext).pie;
|
|
27
31
|
var _React$useContext = React.useContext(DrawingContext),
|
|
28
32
|
left = _React$useContext.left,
|
|
@@ -39,6 +43,8 @@ export function PiePlot() {
|
|
|
39
43
|
};
|
|
40
44
|
var series = seriesData.series,
|
|
41
45
|
seriesOrder = seriesData.seriesOrder;
|
|
46
|
+
var Arc = (_slots$pieArc = slots == null ? void 0 : slots.pieArc) != null ? _slots$pieArc : PieArc;
|
|
47
|
+
var ArcLabel = (_slots$pieArcLabel = slots == null ? void 0 : slots.pieArcLabel) != null ? _slots$pieArcLabel : PieArcLabel;
|
|
42
48
|
return /*#__PURE__*/_jsx("g", {
|
|
43
49
|
children: seriesOrder.map(function (seriesId) {
|
|
44
50
|
var _series$seriesId = series[seriesId],
|
|
@@ -57,7 +63,7 @@ export function PiePlot() {
|
|
|
57
63
|
transform: "translate(".concat(cx === undefined ? center.x : left + cx, ", ").concat(cy === undefined ? center.y : top + cy, ")"),
|
|
58
64
|
children: /*#__PURE__*/_jsxs("g", {
|
|
59
65
|
children: [data.map(function (item, index) {
|
|
60
|
-
return /*#__PURE__*/_createElement(
|
|
66
|
+
return /*#__PURE__*/_createElement(Arc, _extends({}, item, {
|
|
61
67
|
key: item.id,
|
|
62
68
|
innerRadius: innerRadius,
|
|
63
69
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -68,9 +74,9 @@ export function PiePlot() {
|
|
|
68
74
|
highlightScope: series[seriesId].highlightScope,
|
|
69
75
|
highlighted: highlighted,
|
|
70
76
|
faded: faded
|
|
71
|
-
}));
|
|
77
|
+
}, slotProps == null ? void 0 : slotProps.pieArc));
|
|
72
78
|
}), data.map(function (item, index) {
|
|
73
|
-
return /*#__PURE__*/_createElement(
|
|
79
|
+
return /*#__PURE__*/_createElement(ArcLabel, _extends({}, item, {
|
|
74
80
|
key: item.id,
|
|
75
81
|
innerRadius: innerRadius,
|
|
76
82
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -80,10 +86,27 @@ export function PiePlot() {
|
|
|
80
86
|
dataIndex: index,
|
|
81
87
|
highlightScope: series[seriesId].highlightScope,
|
|
82
88
|
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
83
|
-
}));
|
|
89
|
+
}, slotProps == null ? void 0 : slotProps.pieArcLabel));
|
|
84
90
|
})]
|
|
85
91
|
})
|
|
86
92
|
}, seriesId);
|
|
87
93
|
})
|
|
88
94
|
});
|
|
89
|
-
}
|
|
95
|
+
}
|
|
96
|
+
process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
97
|
+
// ----------------------------- Warning --------------------------------
|
|
98
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
99
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
100
|
+
// ----------------------------------------------------------------------
|
|
101
|
+
/**
|
|
102
|
+
* The props used for each component slot.
|
|
103
|
+
* @default {}
|
|
104
|
+
*/
|
|
105
|
+
slotProps: PropTypes.object,
|
|
106
|
+
/**
|
|
107
|
+
* Overridable component slots.
|
|
108
|
+
* @default {}
|
|
109
|
+
*/
|
|
110
|
+
slots: PropTypes.object
|
|
111
|
+
} : void 0;
|
|
112
|
+
export { PiePlot };
|
|
@@ -25,7 +25,9 @@ var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, re
|
|
|
25
25
|
leftAxis = props.leftAxis,
|
|
26
26
|
rightAxis = props.rightAxis,
|
|
27
27
|
bottomAxis = props.bottomAxis,
|
|
28
|
-
children = props.children
|
|
28
|
+
children = props.children,
|
|
29
|
+
slots = props.slots,
|
|
30
|
+
slotProps = props.slotProps;
|
|
29
31
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
30
32
|
ref: ref,
|
|
31
33
|
series: series.map(function (s) {
|
|
@@ -44,8 +46,16 @@ var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, re
|
|
|
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,14 @@
|
|
|
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
|
+
var slots = props.slots,
|
|
11
|
+
slotProps = props.slotProps;
|
|
7
12
|
var seriesData = React.useContext(SeriesContext).scatter;
|
|
8
13
|
var axisData = React.useContext(CartesianContext);
|
|
9
14
|
if (seriesData === undefined) {
|
|
@@ -17,6 +22,7 @@ export function ScatterPlot() {
|
|
|
17
22
|
yAxisIds = axisData.yAxisIds;
|
|
18
23
|
var defaultXAxisId = xAxisIds[0];
|
|
19
24
|
var defaultYAxisId = yAxisIds[0];
|
|
25
|
+
var ScatterItems = (_slots$scatter = slots == null ? void 0 : slots.scatter) != null ? _slots$scatter : Scatter;
|
|
20
26
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
21
27
|
children: seriesOrder.map(function (seriesId) {
|
|
22
28
|
var _series$seriesId = series[seriesId],
|
|
@@ -27,13 +33,30 @@ export function ScatterPlot() {
|
|
|
27
33
|
color = _series$seriesId.color;
|
|
28
34
|
var xScale = xAxis[xAxisKey != null ? xAxisKey : defaultXAxisId].scale;
|
|
29
35
|
var yScale = yAxis[yAxisKey != null ? yAxisKey : defaultYAxisId].scale;
|
|
30
|
-
return /*#__PURE__*/_jsx(
|
|
36
|
+
return /*#__PURE__*/_jsx(ScatterItems, _extends({
|
|
31
37
|
xScale: xScale,
|
|
32
38
|
yScale: yScale,
|
|
33
39
|
color: color,
|
|
34
40
|
markerSize: markerSize != null ? markerSize : 4,
|
|
35
41
|
series: series[seriesId]
|
|
36
|
-
}, id);
|
|
42
|
+
}, slotProps == null ? void 0 : slotProps.scatter), id);
|
|
37
43
|
})
|
|
38
44
|
});
|
|
39
|
-
}
|
|
45
|
+
}
|
|
46
|
+
process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
47
|
+
// ----------------------------- Warning --------------------------------
|
|
48
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
49
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
50
|
+
// ----------------------------------------------------------------------
|
|
51
|
+
/**
|
|
52
|
+
* The props used for each component slot.
|
|
53
|
+
* @default {}
|
|
54
|
+
*/
|
|
55
|
+
slotProps: PropTypes.object,
|
|
56
|
+
/**
|
|
57
|
+
* Overridable component slots.
|
|
58
|
+
* @default {}
|
|
59
|
+
*/
|
|
60
|
+
slots: PropTypes.object
|
|
61
|
+
} : void 0;
|
|
62
|
+
export { ScatterPlot };
|