@mui/x-charts 7.3.0 → 7.3.2
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 +5 -3
- package/BarChart/BarChart.js +23 -102
- package/BarChart/BarElement.d.ts +63 -62
- package/BarChart/BarElement.js +1 -2
- package/BarChart/BarPlot.js +9 -9
- package/CHANGELOG.md +155 -7
- package/ChartContainer/ChartContainer.js +3 -1
- package/ChartsAxis/ChartsAxis.js +7 -99
- package/ChartsAxis/axisClasses.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
- package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
- package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
- package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
- package/ChartsOverlay/ChartsOverlay.js +41 -0
- package/ChartsOverlay/index.d.ts +3 -0
- package/ChartsOverlay/index.js +26 -0
- package/ChartsOverlay/package.json +6 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsSurface.js +1 -1
- package/ChartsText/ChartsText.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +18 -5
- package/ChartsTooltip/ChartsItemTooltipContent.js +20 -4
- package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
- package/ChartsTooltip/ChartsTooltip.js +3 -3
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -7
- package/ChartsTooltip/ChartsTooltipTable.js +8 -9
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -6
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -4
- package/ChartsTooltip/utils.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +8 -1
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxis.js +8 -1
- package/Gauge/Gauge.js +2 -2
- package/Gauge/GaugeContainer.js +2 -2
- package/Gauge/GaugeProvider.d.ts +2 -2
- package/Gauge/GaugeProvider.js +2 -2
- package/Gauge/GaugeReferenceArc.js +1 -1
- package/Gauge/GaugeValueArc.js +1 -1
- package/Gauge/GaugeValueText.js +1 -1
- package/Gauge/gaugeClasses.d.ts +2 -2
- package/Gauge/utils.d.ts +1 -1
- package/Gauge/utils.js +4 -4
- package/LineChart/AnimatedArea.d.ts +63 -62
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.d.ts +63 -62
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaPlot.js +1 -1
- package/LineChart/LineChart.d.ts +5 -3
- package/LineChart/LineChart.js +20 -99
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.js +1 -1
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/LinePlot.js +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkPlot.js +1 -1
- package/PieChart/PieArc.d.ts +2 -1
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArcLabel.d.ts +2 -1
- package/PieChart/PieArcLabel.js +2 -2
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +4 -4
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.js +4 -4
- package/PieChart/PieChart.d.ts +5 -3
- package/PieChart/PieChart.js +23 -99
- package/PieChart/PiePlot.js +1 -1
- package/PieChart/dataTransform/transition.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +1 -1
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.js +1 -1
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/ScatterChart.d.ts +6 -3
- package/ScatterChart/ScatterChart.js +74 -125
- package/ScatterChart/ScatterPlot.js +9 -2
- package/ScatterChart/getColor.d.ts +2 -1
- package/ScatterChart/getColor.js +18 -1
- package/SparkLineChart/SparkLineChart.js +1 -1
- package/context/CartesianContextProvider.d.ts +2 -1
- package/context/CartesianContextProvider.js +1 -1
- package/context/DrawingProvider.js +1 -1
- package/context/HighlightProvider.js +1 -1
- package/context/InteractionProvider.js +1 -1
- package/context/SeriesContextProvider.js +2 -2
- package/context/ZAxisContextProvider.d.ts +33 -0
- package/context/ZAxisContextProvider.js +98 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +8 -1
- package/esm/BarChart/BarChart.js +23 -103
- package/esm/BarChart/BarElement.js +0 -1
- package/esm/BarChart/BarPlot.js +8 -8
- package/esm/ChartContainer/ChartContainer.js +3 -2
- package/esm/ChartsAxis/ChartsAxis.js +7 -100
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
- package/esm/ChartsGrid/ChartsGrid.js +1 -2
- package/esm/ChartsLegend/DefaultChartsLegend.js +1 -2
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
- package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
- package/esm/ChartsOverlay/index.js +3 -0
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
- package/esm/ChartsSurface.js +1 -2
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipTable.js +8 -8
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
- package/esm/ChartsXAxis/ChartsXAxis.js +8 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +8 -2
- package/esm/Gauge/Gauge.js +2 -3
- package/esm/Gauge/GaugeContainer.js +1 -1
- package/esm/Gauge/GaugeProvider.js +1 -1
- package/esm/Gauge/utils.js +4 -4
- package/esm/LineChart/AnimatedArea.js +1 -2
- package/esm/LineChart/AnimatedLine.js +1 -2
- package/esm/LineChart/LineChart.js +20 -100
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/PieChart/PieArcLabelPlot.js +3 -3
- package/esm/PieChart/PieArcPlot.js +3 -3
- package/esm/PieChart/PieChart.js +23 -100
- package/esm/PieChart/PiePlot.js +1 -2
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
- package/esm/ScatterChart/ScatterChart.js +74 -126
- package/esm/ScatterChart/ScatterPlot.js +8 -1
- package/esm/ScatterChart/getColor.js +18 -1
- package/esm/SparkLineChart/SparkLineChart.js +1 -2
- package/esm/context/SeriesContextProvider.js +1 -1
- package/esm/context/ZAxisContextProvider.js +89 -0
- package/esm/context/index.js +1 -1
- package/esm/hooks/useReducedMotion.js +1 -1
- package/esm/hooks/useScale.js +1 -1
- package/esm/hooks/useTicks.js +4 -0
- package/esm/internals/colorGetter.js +2 -2
- package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
- package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
- package/esm/internals/utils.js +1 -1
- package/esm/models/z-axis.js +1 -0
- package/hooks/useAxisEvents.js +1 -1
- package/hooks/useChartDimensions.js +1 -1
- package/hooks/useChartId.js +1 -1
- package/hooks/useDrawingArea.js +1 -1
- package/hooks/useInteractionItemProps.js +1 -1
- package/hooks/useMounted.js +1 -1
- package/hooks/useReducedMotion.d.ts +1 -1
- package/hooks/useReducedMotion.js +1 -1
- package/hooks/useScale.d.ts +4 -4
- package/hooks/useScale.js +2 -2
- package/hooks/useSeries.js +1 -1
- package/hooks/useSvgRef.js +1 -1
- package/hooks/useTicks.js +5 -1
- package/index.js +1 -1
- package/internals/colorGetter.d.ts +3 -1
- package/internals/colorGetter.js +2 -2
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -6
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +4 -4
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -4
- package/internals/defaultizeColor.d.ts +1 -0
- package/internals/useAnimatedPath.d.ts +1 -0
- package/internals/useAnimatedPath.js +1 -1
- package/internals/utils.d.ts +1 -1
- package/internals/utils.js +1 -1
- package/models/axis.d.ts +1 -1
- package/models/colorMapping.d.ts +3 -2
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +9 -4
- package/models/seriesType/scatter.d.ts +5 -0
- package/models/z-axis.d.ts +14 -0
- package/models/z-axis.js +5 -0
- package/modern/BarChart/BarChart.js +23 -103
- package/modern/BarChart/BarElement.js +0 -1
- package/modern/BarChart/BarPlot.js +8 -8
- package/modern/ChartContainer/ChartContainer.js +3 -2
- package/modern/ChartsAxis/ChartsAxis.js +7 -100
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
- package/modern/ChartsGrid/ChartsGrid.js +1 -2
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -2
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
- package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
- package/modern/ChartsOverlay/index.js +3 -0
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
- package/modern/ChartsSurface.js +1 -2
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipTable.js +8 -8
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
- package/modern/ChartsXAxis/ChartsXAxis.js +8 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +8 -2
- package/modern/Gauge/Gauge.js +2 -3
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/Gauge/GaugeProvider.js +1 -1
- package/modern/Gauge/utils.js +4 -4
- package/modern/LineChart/AnimatedArea.js +1 -2
- package/modern/LineChart/AnimatedLine.js +1 -2
- package/modern/LineChart/LineChart.js +20 -100
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/PieChart/PieArcLabelPlot.js +3 -3
- package/modern/PieChart/PieArcPlot.js +3 -3
- package/modern/PieChart/PieChart.js +23 -100
- package/modern/PieChart/PiePlot.js +1 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
- package/modern/ScatterChart/ScatterChart.js +74 -126
- package/modern/ScatterChart/ScatterPlot.js +8 -1
- package/modern/ScatterChart/getColor.js +18 -1
- package/modern/SparkLineChart/SparkLineChart.js +1 -2
- package/modern/context/SeriesContextProvider.js +1 -1
- package/modern/context/ZAxisContextProvider.js +89 -0
- package/modern/context/index.js +1 -1
- package/modern/hooks/useReducedMotion.js +1 -1
- package/modern/hooks/useScale.js +1 -1
- package/modern/hooks/useTicks.js +4 -0
- package/modern/index.js +1 -1
- package/modern/internals/colorGetter.js +2 -2
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
- package/modern/internals/utils.js +1 -1
- package/modern/models/z-axis.js +1 -0
- package/package.json +3 -5
package/PieChart/PieChart.js
CHANGED
|
@@ -16,9 +16,10 @@ var _ChartsLegend = require("../ChartsLegend");
|
|
|
16
16
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
17
17
|
var _PiePlot = require("./PiePlot");
|
|
18
18
|
var _useIsRTL = require("../internals/useIsRTL");
|
|
19
|
+
var _ChartsOverlay = require("../ChartsOverlay/ChartsOverlay");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
23
|
const defaultMargin = {
|
|
23
24
|
top: 5,
|
|
24
25
|
bottom: 5,
|
|
@@ -68,7 +69,8 @@ function PieChart(props) {
|
|
|
68
69
|
children,
|
|
69
70
|
slots,
|
|
70
71
|
slotProps,
|
|
71
|
-
onItemClick
|
|
72
|
+
onItemClick,
|
|
73
|
+
loading
|
|
72
74
|
} = props;
|
|
73
75
|
const isRTL = (0, _useIsRTL.useIsRTL)();
|
|
74
76
|
const margin = (0, _extends2.default)({}, isRTL ? defaultRTLMargin : defaultMargin, marginProps);
|
|
@@ -107,10 +109,17 @@ function PieChart(props) {
|
|
|
107
109
|
slotProps: slotProps,
|
|
108
110
|
onItemClick: onItemClick,
|
|
109
111
|
skipAnimation: skipAnimation
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, {
|
|
113
|
+
loading: loading,
|
|
114
|
+
slots: slots,
|
|
115
|
+
slotProps: slotProps
|
|
110
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
111
117
|
slots: slots,
|
|
112
118
|
slotProps: slotProps
|
|
113
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
119
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
120
|
+
slots: slots,
|
|
121
|
+
slotProps: slotProps
|
|
122
|
+
})), children]
|
|
114
123
|
});
|
|
115
124
|
}
|
|
116
125
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -132,30 +141,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
132
141
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
133
142
|
* @default null
|
|
134
143
|
*/
|
|
135
|
-
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
136
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
137
|
-
classes: _propTypes.default.object,
|
|
138
|
-
disableLine: _propTypes.default.bool,
|
|
139
|
-
disableTicks: _propTypes.default.bool,
|
|
140
|
-
fill: _propTypes.default.string,
|
|
141
|
-
label: _propTypes.default.string,
|
|
142
|
-
labelFontSize: _propTypes.default.number,
|
|
143
|
-
labelStyle: _propTypes.default.object,
|
|
144
|
-
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
145
|
-
slotProps: _propTypes.default.object,
|
|
146
|
-
slots: _propTypes.default.object,
|
|
147
|
-
stroke: _propTypes.default.string,
|
|
148
|
-
tickFontSize: _propTypes.default.number,
|
|
149
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
150
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
151
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
152
|
-
tickLabelStyle: _propTypes.default.object,
|
|
153
|
-
tickMaxStep: _propTypes.default.number,
|
|
154
|
-
tickMinStep: _propTypes.default.number,
|
|
155
|
-
tickNumber: _propTypes.default.number,
|
|
156
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
157
|
-
tickSize: _propTypes.default.number
|
|
158
|
-
}), _propTypes.default.string]),
|
|
144
|
+
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
159
145
|
children: _propTypes.default.node,
|
|
160
146
|
className: _propTypes.default.string,
|
|
161
147
|
/**
|
|
@@ -183,30 +169,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
183
169
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
184
170
|
* @default null
|
|
185
171
|
*/
|
|
186
|
-
leftAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
187
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
188
|
-
classes: _propTypes.default.object,
|
|
189
|
-
disableLine: _propTypes.default.bool,
|
|
190
|
-
disableTicks: _propTypes.default.bool,
|
|
191
|
-
fill: _propTypes.default.string,
|
|
192
|
-
label: _propTypes.default.string,
|
|
193
|
-
labelFontSize: _propTypes.default.number,
|
|
194
|
-
labelStyle: _propTypes.default.object,
|
|
195
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
196
|
-
slotProps: _propTypes.default.object,
|
|
197
|
-
slots: _propTypes.default.object,
|
|
198
|
-
stroke: _propTypes.default.string,
|
|
199
|
-
tickFontSize: _propTypes.default.number,
|
|
200
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
201
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
202
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
203
|
-
tickLabelStyle: _propTypes.default.object,
|
|
204
|
-
tickMaxStep: _propTypes.default.number,
|
|
205
|
-
tickMinStep: _propTypes.default.number,
|
|
206
|
-
tickNumber: _propTypes.default.number,
|
|
207
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
208
|
-
tickSize: _propTypes.default.number
|
|
209
|
-
}), _propTypes.default.string]),
|
|
172
|
+
leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
210
173
|
/**
|
|
211
174
|
* The props of the legend.
|
|
212
175
|
* @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
|
|
@@ -223,6 +186,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
223
186
|
slotProps: _propTypes.default.object,
|
|
224
187
|
slots: _propTypes.default.object
|
|
225
188
|
}),
|
|
189
|
+
/**
|
|
190
|
+
* If `true`, a loading overlay is displayed.
|
|
191
|
+
*/
|
|
192
|
+
loading: _propTypes.default.bool,
|
|
226
193
|
/**
|
|
227
194
|
* The margin between the SVG and the drawing area.
|
|
228
195
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
@@ -244,32 +211,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
244
211
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
245
212
|
* @default null
|
|
246
213
|
*/
|
|
247
|
-
rightAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
248
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
249
|
-
classes: _propTypes.default.object,
|
|
250
|
-
disableLine: _propTypes.default.bool,
|
|
251
|
-
disableTicks: _propTypes.default.bool,
|
|
252
|
-
fill: _propTypes.default.string,
|
|
253
|
-
label: _propTypes.default.string,
|
|
254
|
-
labelFontSize: _propTypes.default.number,
|
|
255
|
-
labelStyle: _propTypes.default.object,
|
|
256
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
257
|
-
slotProps: _propTypes.default.object,
|
|
258
|
-
slots: _propTypes.default.object,
|
|
259
|
-
stroke: _propTypes.default.string,
|
|
260
|
-
tickFontSize: _propTypes.default.number,
|
|
261
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
262
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
263
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
264
|
-
tickLabelStyle: _propTypes.default.object,
|
|
265
|
-
tickMaxStep: _propTypes.default.number,
|
|
266
|
-
tickMinStep: _propTypes.default.number,
|
|
267
|
-
tickNumber: _propTypes.default.number,
|
|
268
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
269
|
-
tickSize: _propTypes.default.number
|
|
270
|
-
}), _propTypes.default.string]),
|
|
214
|
+
rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
271
215
|
/**
|
|
272
216
|
* The series to display in the pie chart.
|
|
217
|
+
* An array of [[PieSeriesType]] objects.
|
|
273
218
|
*/
|
|
274
219
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
275
220
|
/**
|
|
@@ -307,30 +252,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
307
252
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
308
253
|
* @default null
|
|
309
254
|
*/
|
|
310
|
-
topAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
311
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
312
|
-
classes: _propTypes.default.object,
|
|
313
|
-
disableLine: _propTypes.default.bool,
|
|
314
|
-
disableTicks: _propTypes.default.bool,
|
|
315
|
-
fill: _propTypes.default.string,
|
|
316
|
-
label: _propTypes.default.string,
|
|
317
|
-
labelFontSize: _propTypes.default.number,
|
|
318
|
-
labelStyle: _propTypes.default.object,
|
|
319
|
-
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
320
|
-
slotProps: _propTypes.default.object,
|
|
321
|
-
slots: _propTypes.default.object,
|
|
322
|
-
stroke: _propTypes.default.string,
|
|
323
|
-
tickFontSize: _propTypes.default.number,
|
|
324
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
325
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
326
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
327
|
-
tickLabelStyle: _propTypes.default.object,
|
|
328
|
-
tickMaxStep: _propTypes.default.number,
|
|
329
|
-
tickMinStep: _propTypes.default.number,
|
|
330
|
-
tickNumber: _propTypes.default.number,
|
|
331
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
332
|
-
tickSize: _propTypes.default.number
|
|
333
|
-
}), _propTypes.default.string]),
|
|
255
|
+
topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
334
256
|
viewBox: _propTypes.default.shape({
|
|
335
257
|
height: _propTypes.default.number,
|
|
336
258
|
width: _propTypes.default.number,
|
|
@@ -344,6 +266,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
344
266
|
/**
|
|
345
267
|
* The configuration of the x-axes.
|
|
346
268
|
* If not provided, a default axis config is used.
|
|
269
|
+
* An array of [[AxisConfig]] objects.
|
|
347
270
|
*/
|
|
348
271
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
349
272
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -396,6 +319,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
396
319
|
/**
|
|
397
320
|
* The configuration of the y-axes.
|
|
398
321
|
* If not provided, a default axis config is used.
|
|
322
|
+
* An array of [[AxisConfig]] objects.
|
|
399
323
|
*/
|
|
400
324
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
401
325
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
package/PieChart/PiePlot.js
CHANGED
|
@@ -15,7 +15,7 @@ var _utils = require("../internals/utils");
|
|
|
15
15
|
var _getPieCoordinates = require("./getPieCoordinates");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
/**
|
|
20
20
|
* Demos:
|
|
21
21
|
*
|
|
@@ -10,7 +10,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _InteractionProvider = require("../../context/InteractionProvider");
|
|
11
11
|
var _useInteractionItemProps = require("../../hooks/useInteractionItemProps");
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
function useTransformData(series) {
|
|
15
15
|
const {
|
|
16
16
|
id: seriesId,
|
|
@@ -15,7 +15,7 @@ var _useChartContainerDimensions = require("./useChartContainerDimensions");
|
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const _excluded = ["width", "height"];
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
const ResizableContainer = (0, _styles.styled)('div', {
|
|
20
20
|
name: 'MuiResponsiveChart',
|
|
21
21
|
slot: 'Container'
|
|
@@ -116,6 +116,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
116
116
|
/**
|
|
117
117
|
* The configuration of the x-axes.
|
|
118
118
|
* If not provided, a default axis config is used.
|
|
119
|
+
* An array of [[AxisConfig]] objects.
|
|
119
120
|
*/
|
|
120
121
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
121
122
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -168,6 +169,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
168
169
|
/**
|
|
169
170
|
* The configuration of the y-axes.
|
|
170
171
|
* If not provided, a default axis config is used.
|
|
172
|
+
* An array of [[AxisConfig]] objects.
|
|
171
173
|
*/
|
|
172
174
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
173
175
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -9,7 +9,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
10
10
|
var _ownerWindow = _interopRequireDefault(require("@mui/utils/ownerWindow"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
const useChartContainerDimensions = (inWidth, inHeight) => {
|
|
14
14
|
const rootRef = React.useRef(null);
|
|
15
15
|
const displayError = React.useRef(false);
|
package/ScatterChart/Scatter.js
CHANGED
|
@@ -13,7 +13,7 @@ var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
|
13
13
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
/**
|
|
18
18
|
* Demos:
|
|
19
19
|
*
|
|
@@ -6,17 +6,20 @@ import { ScatterSeriesType } from '../models/seriesType/scatter';
|
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
7
|
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
8
8
|
import { ChartsLegendProps, ChartsLegendSlotProps, ChartsLegendSlots } from '../ChartsLegend';
|
|
9
|
+
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '../ChartsOverlay/ChartsOverlay';
|
|
9
10
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
11
|
import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
|
|
11
12
|
import { ChartsVoronoiHandlerProps } from '../ChartsVoronoiHandler/ChartsVoronoiHandler';
|
|
12
13
|
import { ChartsGridProps } from '../ChartsGrid';
|
|
13
|
-
|
|
14
|
+
import { ZAxisContextProviderProps } from '../context/ZAxisContextProvider';
|
|
15
|
+
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots {
|
|
14
16
|
}
|
|
15
|
-
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
17
|
+
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps {
|
|
16
18
|
}
|
|
17
|
-
export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsVoronoiHandlerProps, 'onItemClick'> {
|
|
19
|
+
export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ZAxisContextProviderProps, 'children' | 'dataset'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Omit<ChartsVoronoiHandlerProps, 'onItemClick'> {
|
|
18
20
|
/**
|
|
19
21
|
* The series to display in the scatter chart.
|
|
22
|
+
* An array of [[ScatterSeriesType]] objects.
|
|
20
23
|
*/
|
|
21
24
|
series: MakeOptional<ScatterSeriesType, 'type'>[];
|
|
22
25
|
/**
|
|
@@ -13,12 +13,14 @@ var _ResponsiveChartContainer = require("../ResponsiveChartContainer");
|
|
|
13
13
|
var _ChartsAxis = require("../ChartsAxis");
|
|
14
14
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
15
15
|
var _ChartsLegend = require("../ChartsLegend");
|
|
16
|
+
var _ChartsOverlay = require("../ChartsOverlay/ChartsOverlay");
|
|
16
17
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
17
18
|
var _ChartsVoronoiHandler = require("../ChartsVoronoiHandler/ChartsVoronoiHandler");
|
|
18
19
|
var _ChartsGrid = require("../ChartsGrid");
|
|
20
|
+
var _ZAxisContextProvider = require("../context/ZAxisContextProvider");
|
|
19
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
24
|
/**
|
|
23
25
|
* Demos:
|
|
24
26
|
*
|
|
@@ -33,6 +35,7 @@ const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(functi
|
|
|
33
35
|
const {
|
|
34
36
|
xAxis,
|
|
35
37
|
yAxis,
|
|
38
|
+
zAxis,
|
|
36
39
|
series,
|
|
37
40
|
tooltip,
|
|
38
41
|
axisHighlight,
|
|
@@ -52,9 +55,10 @@ const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(functi
|
|
|
52
55
|
onItemClick,
|
|
53
56
|
children,
|
|
54
57
|
slots,
|
|
55
|
-
slotProps
|
|
58
|
+
slotProps,
|
|
59
|
+
loading
|
|
56
60
|
} = props;
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveChartContainer.ResponsiveChartContainer, {
|
|
58
62
|
ref: ref,
|
|
59
63
|
series: series.map(s => (0, _extends2.default)({
|
|
60
64
|
type: 'scatter'
|
|
@@ -66,32 +70,39 @@ const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(functi
|
|
|
66
70
|
xAxis: xAxis,
|
|
67
71
|
yAxis: yAxis,
|
|
68
72
|
sx: sx,
|
|
69
|
-
children:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ZAxisContextProvider.ZAxisContextProvider, {
|
|
74
|
+
zAxis: zAxis,
|
|
75
|
+
children: [!disableVoronoi && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsVoronoiHandler.ChartsVoronoiHandler, {
|
|
76
|
+
voronoiMaxRadius: voronoiMaxRadius,
|
|
77
|
+
onItemClick: onItemClick
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, {
|
|
79
|
+
topAxis: topAxis,
|
|
80
|
+
leftAxis: leftAxis,
|
|
81
|
+
rightAxis: rightAxis,
|
|
82
|
+
bottomAxis: bottomAxis,
|
|
83
|
+
slots: slots,
|
|
84
|
+
slotProps: slotProps
|
|
85
|
+
}), grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, {
|
|
86
|
+
vertical: grid.vertical,
|
|
87
|
+
horizontal: grid.horizontal
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterPlot.ScatterPlot, {
|
|
89
|
+
slots: slots,
|
|
90
|
+
slotProps: slotProps,
|
|
91
|
+
onItemClick: disableVoronoi ? onItemClick : undefined
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, {
|
|
93
|
+
loading: loading,
|
|
94
|
+
slots: slots,
|
|
95
|
+
slotProps: slotProps
|
|
96
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
97
|
+
slots: slots,
|
|
98
|
+
slotProps: slotProps
|
|
99
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({
|
|
100
|
+
x: "none",
|
|
101
|
+
y: "none"
|
|
102
|
+
}, axisHighlight)), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({
|
|
103
|
+
trigger: "item"
|
|
104
|
+
}, tooltip)), children]
|
|
105
|
+
})
|
|
95
106
|
});
|
|
96
107
|
});
|
|
97
108
|
process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
@@ -113,30 +124,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
113
124
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
114
125
|
* @default xAxisIds[0] The id of the first provided axis
|
|
115
126
|
*/
|
|
116
|
-
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
117
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
118
|
-
classes: _propTypes.default.object,
|
|
119
|
-
disableLine: _propTypes.default.bool,
|
|
120
|
-
disableTicks: _propTypes.default.bool,
|
|
121
|
-
fill: _propTypes.default.string,
|
|
122
|
-
label: _propTypes.default.string,
|
|
123
|
-
labelFontSize: _propTypes.default.number,
|
|
124
|
-
labelStyle: _propTypes.default.object,
|
|
125
|
-
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
126
|
-
slotProps: _propTypes.default.object,
|
|
127
|
-
slots: _propTypes.default.object,
|
|
128
|
-
stroke: _propTypes.default.string,
|
|
129
|
-
tickFontSize: _propTypes.default.number,
|
|
130
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
131
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
132
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
133
|
-
tickLabelStyle: _propTypes.default.object,
|
|
134
|
-
tickMaxStep: _propTypes.default.number,
|
|
135
|
-
tickMinStep: _propTypes.default.number,
|
|
136
|
-
tickNumber: _propTypes.default.number,
|
|
137
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
138
|
-
tickSize: _propTypes.default.number
|
|
139
|
-
}), _propTypes.default.string]),
|
|
127
|
+
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
140
128
|
children: _propTypes.default.node,
|
|
141
129
|
className: _propTypes.default.string,
|
|
142
130
|
/**
|
|
@@ -176,30 +164,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
176
164
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
177
165
|
* @default yAxisIds[0] The id of the first provided axis
|
|
178
166
|
*/
|
|
179
|
-
leftAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
180
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
181
|
-
classes: _propTypes.default.object,
|
|
182
|
-
disableLine: _propTypes.default.bool,
|
|
183
|
-
disableTicks: _propTypes.default.bool,
|
|
184
|
-
fill: _propTypes.default.string,
|
|
185
|
-
label: _propTypes.default.string,
|
|
186
|
-
labelFontSize: _propTypes.default.number,
|
|
187
|
-
labelStyle: _propTypes.default.object,
|
|
188
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
189
|
-
slotProps: _propTypes.default.object,
|
|
190
|
-
slots: _propTypes.default.object,
|
|
191
|
-
stroke: _propTypes.default.string,
|
|
192
|
-
tickFontSize: _propTypes.default.number,
|
|
193
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
194
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
195
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
196
|
-
tickLabelStyle: _propTypes.default.object,
|
|
197
|
-
tickMaxStep: _propTypes.default.number,
|
|
198
|
-
tickMinStep: _propTypes.default.number,
|
|
199
|
-
tickNumber: _propTypes.default.number,
|
|
200
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
201
|
-
tickSize: _propTypes.default.number
|
|
202
|
-
}), _propTypes.default.string]),
|
|
167
|
+
leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
203
168
|
/**
|
|
204
169
|
* @deprecated Consider using `slotProps.legend` instead.
|
|
205
170
|
*/
|
|
@@ -214,6 +179,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
214
179
|
slotProps: _propTypes.default.object,
|
|
215
180
|
slots: _propTypes.default.object
|
|
216
181
|
}),
|
|
182
|
+
/**
|
|
183
|
+
* If `true`, a loading overlay is displayed.
|
|
184
|
+
*/
|
|
185
|
+
loading: _propTypes.default.bool,
|
|
217
186
|
/**
|
|
218
187
|
* The margin between the SVG and the drawing area.
|
|
219
188
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
@@ -237,32 +206,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
237
206
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
238
207
|
* @default null
|
|
239
208
|
*/
|
|
240
|
-
rightAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
241
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
242
|
-
classes: _propTypes.default.object,
|
|
243
|
-
disableLine: _propTypes.default.bool,
|
|
244
|
-
disableTicks: _propTypes.default.bool,
|
|
245
|
-
fill: _propTypes.default.string,
|
|
246
|
-
label: _propTypes.default.string,
|
|
247
|
-
labelFontSize: _propTypes.default.number,
|
|
248
|
-
labelStyle: _propTypes.default.object,
|
|
249
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
250
|
-
slotProps: _propTypes.default.object,
|
|
251
|
-
slots: _propTypes.default.object,
|
|
252
|
-
stroke: _propTypes.default.string,
|
|
253
|
-
tickFontSize: _propTypes.default.number,
|
|
254
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
255
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
256
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
257
|
-
tickLabelStyle: _propTypes.default.object,
|
|
258
|
-
tickMaxStep: _propTypes.default.number,
|
|
259
|
-
tickMinStep: _propTypes.default.number,
|
|
260
|
-
tickNumber: _propTypes.default.number,
|
|
261
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
262
|
-
tickSize: _propTypes.default.number
|
|
263
|
-
}), _propTypes.default.string]),
|
|
209
|
+
rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
264
210
|
/**
|
|
265
211
|
* The series to display in the scatter chart.
|
|
212
|
+
* An array of [[ScatterSeriesType]] objects.
|
|
266
213
|
*/
|
|
267
214
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
268
215
|
/**
|
|
@@ -295,30 +242,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
295
242
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
296
243
|
* @default null
|
|
297
244
|
*/
|
|
298
|
-
topAxis: _propTypes.default.oneOfType([_propTypes.default.
|
|
299
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
300
|
-
classes: _propTypes.default.object,
|
|
301
|
-
disableLine: _propTypes.default.bool,
|
|
302
|
-
disableTicks: _propTypes.default.bool,
|
|
303
|
-
fill: _propTypes.default.string,
|
|
304
|
-
label: _propTypes.default.string,
|
|
305
|
-
labelFontSize: _propTypes.default.number,
|
|
306
|
-
labelStyle: _propTypes.default.object,
|
|
307
|
-
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
308
|
-
slotProps: _propTypes.default.object,
|
|
309
|
-
slots: _propTypes.default.object,
|
|
310
|
-
stroke: _propTypes.default.string,
|
|
311
|
-
tickFontSize: _propTypes.default.number,
|
|
312
|
-
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
313
|
-
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
314
|
-
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
315
|
-
tickLabelStyle: _propTypes.default.object,
|
|
316
|
-
tickMaxStep: _propTypes.default.number,
|
|
317
|
-
tickMinStep: _propTypes.default.number,
|
|
318
|
-
tickNumber: _propTypes.default.number,
|
|
319
|
-
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
320
|
-
tickSize: _propTypes.default.number
|
|
321
|
-
}), _propTypes.default.string]),
|
|
245
|
+
topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
322
246
|
viewBox: _propTypes.default.shape({
|
|
323
247
|
height: _propTypes.default.number,
|
|
324
248
|
width: _propTypes.default.number,
|
|
@@ -337,6 +261,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
337
261
|
/**
|
|
338
262
|
* The configuration of the x-axes.
|
|
339
263
|
* If not provided, a default axis config is used.
|
|
264
|
+
* An array of [[AxisConfig]] objects.
|
|
340
265
|
*/
|
|
341
266
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
342
267
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -389,6 +314,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
389
314
|
/**
|
|
390
315
|
* The configuration of the y-axes.
|
|
391
316
|
* If not provided, a default axis config is used.
|
|
317
|
+
* An array of [[AxisConfig]] objects.
|
|
392
318
|
*/
|
|
393
319
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
394
320
|
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -437,5 +363,28 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
437
363
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
438
364
|
tickSize: _propTypes.default.number,
|
|
439
365
|
valueFormatter: _propTypes.default.func
|
|
366
|
+
})),
|
|
367
|
+
/**
|
|
368
|
+
* The configuration of the z-axes.
|
|
369
|
+
*/
|
|
370
|
+
zAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
371
|
+
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
372
|
+
color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
|
|
373
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
374
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
375
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
376
|
+
}), _propTypes.default.shape({
|
|
377
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
378
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
379
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
380
|
+
}), _propTypes.default.shape({
|
|
381
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
382
|
+
type: _propTypes.default.oneOf(['ordinal']).isRequired,
|
|
383
|
+
unknownColor: _propTypes.default.string,
|
|
384
|
+
values: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired)
|
|
385
|
+
})]),
|
|
386
|
+
data: _propTypes.default.array,
|
|
387
|
+
dataKey: _propTypes.default.string,
|
|
388
|
+
id: _propTypes.default.string
|
|
440
389
|
}))
|
|
441
390
|
} : void 0;
|
|
@@ -12,9 +12,10 @@ var _Scatter = require("./Scatter");
|
|
|
12
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
13
13
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
14
14
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
15
|
+
var _ZAxisContextProvider = require("../context/ZAxisContextProvider");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
19
|
/**
|
|
19
20
|
* Demos:
|
|
20
21
|
*
|
|
@@ -33,6 +34,10 @@ function ScatterPlot(props) {
|
|
|
33
34
|
} = props;
|
|
34
35
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).scatter;
|
|
35
36
|
const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
|
|
37
|
+
const {
|
|
38
|
+
zAxis,
|
|
39
|
+
zAxisIds
|
|
40
|
+
} = React.useContext(_ZAxisContextProvider.ZAxisContext);
|
|
36
41
|
if (seriesData === undefined) {
|
|
37
42
|
return null;
|
|
38
43
|
}
|
|
@@ -48,6 +53,7 @@ function ScatterPlot(props) {
|
|
|
48
53
|
} = axisData;
|
|
49
54
|
const defaultXAxisId = xAxisIds[0];
|
|
50
55
|
const defaultYAxisId = yAxisIds[0];
|
|
56
|
+
const defaultZAxisId = zAxisIds[0];
|
|
51
57
|
const ScatterItems = slots?.scatter ?? _Scatter.Scatter;
|
|
52
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
53
59
|
children: seriesOrder.map(seriesId => {
|
|
@@ -55,10 +61,11 @@ function ScatterPlot(props) {
|
|
|
55
61
|
id,
|
|
56
62
|
xAxisKey,
|
|
57
63
|
yAxisKey,
|
|
64
|
+
zAxisKey,
|
|
58
65
|
markerSize,
|
|
59
66
|
color
|
|
60
67
|
} = series[seriesId];
|
|
61
|
-
const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisKey ?? defaultXAxisId], yAxis[yAxisKey ?? defaultYAxisId]);
|
|
68
|
+
const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisKey ?? defaultXAxisId], yAxis[yAxisKey ?? defaultYAxisId], zAxis[zAxisKey ?? defaultZAxisId]);
|
|
62
69
|
const xScale = xAxis[xAxisKey ?? defaultXAxisId].scale;
|
|
63
70
|
const yScale = yAxis[yAxisKey ?? defaultYAxisId].scale;
|
|
64
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScatterItems, (0, _extends2.default)({
|