@mui/x-charts 6.18.2 → 6.18.4
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/BarElement.d.ts +5 -1
- package/BarChart/BarElement.js +24 -1
- package/BarChart/BarPlot.js +7 -6
- package/BarChart/formatter.js +15 -3
- package/BarChart/index.d.ts +3 -2
- package/BarChart/index.js +31 -12
- package/CHANGELOG.md +192 -1
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsLegend/ChartsLegend.d.ts +1 -1
- package/ChartsLegend/ChartsLegend.js +3 -2
- package/ChartsLegend/index.d.ts +1 -0
- package/ChartsLegend/index.js +11 -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/ChartsText/ChartsText.d.ts +17 -0
- package/{internals/components → ChartsText}/ChartsText.js +32 -17
- package/ChartsText/index.d.ts +3 -0
- package/ChartsText/index.js +12 -0
- package/ChartsText/package.json +6 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +5 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +93 -73
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +38 -57
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +7 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +174 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +8 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +99 -0
- package/ChartsTooltip/index.d.ts +4 -0
- package/ChartsTooltip/index.js +44 -0
- package/ChartsXAxis/ChartsXAxis.js +3 -2
- package/ChartsYAxis/ChartsYAxis.js +7 -5
- package/LineChart/AreaPlot.js +3 -2
- package/LineChart/LineHighlightPlot.js +2 -1
- package/LineChart/LinePlot.js +3 -2
- package/LineChart/MarkPlot.js +2 -1
- package/LineChart/extremums.js +25 -8
- package/LineChart/formatter.js +14 -2
- package/LineChart/index.d.ts +5 -5
- package/LineChart/index.js +50 -41
- package/PieChart/PieArcLabelPlot.d.ts +7 -4
- package/PieChart/PieArcLabelPlot.js +88 -1
- package/PieChart/PieArcPlot.d.ts +7 -4
- package/PieChart/PieArcPlot.js +87 -1
- package/PieChart/PieChart.js +4 -4
- package/PieChart/PiePlot.js +20 -15
- package/PieChart/dataTransform/useTransformData.d.ts +2 -3
- package/PieChart/index.d.ts +6 -6
- package/PieChart/index.js +60 -46
- package/ResponsiveChartContainer/index.js +2 -2
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/index.d.ts +3 -3
- package/ScatterChart/index.js +31 -19
- package/context/CartesianContextProvider.js +2 -2
- package/context/SeriesContextProvider.js +1 -1
- package/esm/BarChart/BarElement.js +26 -2
- package/esm/BarChart/BarPlot.js +7 -5
- package/esm/BarChart/formatter.js +20 -4
- package/esm/BarChart/index.js +3 -2
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsLegend/ChartsLegend.js +2 -1
- package/esm/ChartsLegend/index.js +2 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/esm/{internals/components → ChartsText}/ChartsText.js +33 -16
- package/esm/ChartsText/index.js +1 -0
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +95 -75
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +168 -0
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/esm/ChartsTooltip/index.js +5 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +2 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +7 -5
- package/esm/LineChart/AreaPlot.js +3 -2
- package/esm/LineChart/LineHighlightPlot.js +2 -1
- package/esm/LineChart/LinePlot.js +3 -2
- package/esm/LineChart/MarkPlot.js +2 -1
- package/esm/LineChart/extremums.js +25 -8
- package/esm/LineChart/formatter.js +16 -3
- package/esm/LineChart/index.js +5 -5
- package/esm/PieChart/PieArcLabelPlot.js +90 -2
- package/esm/PieChart/PieArcPlot.js +89 -2
- package/esm/PieChart/PieChart.js +4 -4
- package/esm/PieChart/PiePlot.js +20 -15
- package/esm/PieChart/index.js +6 -4
- package/esm/ResponsiveChartContainer/index.js +2 -2
- package/esm/ScatterChart/Scatter.js +1 -1
- package/esm/ScatterChart/index.js +3 -3
- package/esm/context/CartesianContextProvider.js +2 -2
- package/esm/context/SeriesContextProvider.js +1 -1
- package/esm/index.js +1 -0
- package/esm/internals/defaultizeValueFormatter.js +4 -3
- package/esm/internals/getWordsByLines.js +14 -0
- package/esm/internals/utils.js +40 -0
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/defaultizeColor.d.ts +4 -4
- package/internals/defaultizeValueFormatter.d.ts +3 -1
- package/internals/defaultizeValueFormatter.js +3 -3
- package/internals/{components/ChartsText.d.ts → getWordsByLines.d.ts} +2 -11
- package/internals/getWordsByLines.js +21 -0
- package/internals/utils.d.ts +13 -0
- package/internals/utils.js +42 -0
- package/legacy/BarChart/BarElement.js +26 -2
- package/legacy/BarChart/BarPlot.js +7 -5
- package/legacy/BarChart/formatter.js +23 -9
- package/legacy/BarChart/index.js +3 -2
- package/legacy/ChartsAxis/ChartsAxis.js +4 -4
- package/legacy/ChartsLegend/ChartsLegend.js +2 -1
- package/legacy/ChartsLegend/index.js +2 -1
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/legacy/{internals/components → ChartsText}/ChartsText.js +38 -22
- package/legacy/ChartsText/index.js +1 -0
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +40 -55
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +89 -0
- package/legacy/ChartsTooltip/index.js +5 -1
- package/legacy/ChartsXAxis/ChartsXAxis.js +2 -1
- package/legacy/ChartsYAxis/ChartsYAxis.js +7 -5
- package/legacy/LineChart/AreaPlot.js +3 -2
- package/legacy/LineChart/LineHighlightPlot.js +2 -1
- package/legacy/LineChart/LinePlot.js +3 -2
- package/legacy/LineChart/MarkPlot.js +2 -1
- package/legacy/LineChart/extremums.js +29 -14
- package/legacy/LineChart/formatter.js +19 -8
- package/legacy/LineChart/index.js +5 -5
- package/legacy/PieChart/PieArcLabelPlot.js +90 -2
- package/legacy/PieChart/PieArcPlot.js +89 -2
- package/legacy/PieChart/PieChart.js +4 -4
- package/legacy/PieChart/PiePlot.js +20 -15
- package/legacy/PieChart/index.js +6 -4
- package/legacy/ResponsiveChartContainer/index.js +2 -2
- package/legacy/ScatterChart/Scatter.js +1 -1
- package/legacy/ScatterChart/index.js +3 -3
- package/legacy/context/CartesianContextProvider.js +2 -2
- package/legacy/context/SeriesContextProvider.js +1 -1
- package/legacy/index.js +2 -1
- package/legacy/internals/defaultizeValueFormatter.js +4 -3
- package/legacy/internals/getWordsByLines.js +15 -0
- package/legacy/internals/utils.js +40 -0
- package/models/axis.d.ts +1 -1
- package/models/seriesType/config.d.ts +9 -4
- package/models/seriesType/pie.d.ts +29 -7
- package/models/seriesType/scatter.d.ts +1 -1
- package/modern/BarChart/BarElement.js +26 -2
- package/modern/BarChart/BarPlot.js +7 -5
- package/modern/BarChart/formatter.js +15 -3
- package/modern/BarChart/index.js +3 -2
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsLegend/ChartsLegend.js +2 -1
- package/modern/ChartsLegend/index.js +2 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
- package/modern/{internals/components → ChartsText}/ChartsText.js +33 -16
- package/modern/ChartsText/index.js +1 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/modern/ChartsTooltip/index.js +5 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +2 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +7 -5
- package/modern/LineChart/AreaPlot.js +3 -2
- package/modern/LineChart/LineHighlightPlot.js +2 -1
- package/modern/LineChart/LinePlot.js +3 -2
- package/modern/LineChart/MarkPlot.js +2 -1
- package/modern/LineChart/extremums.js +25 -8
- package/modern/LineChart/formatter.js +14 -2
- package/modern/LineChart/index.js +5 -5
- package/modern/PieChart/PieArcLabelPlot.js +90 -2
- package/modern/PieChart/PieArcPlot.js +89 -2
- package/modern/PieChart/PieChart.js +4 -4
- package/modern/PieChart/PiePlot.js +20 -15
- package/modern/PieChart/index.js +6 -4
- package/modern/ResponsiveChartContainer/index.js +2 -2
- package/modern/ScatterChart/Scatter.js +1 -1
- package/modern/ScatterChart/index.js +3 -3
- package/modern/context/CartesianContextProvider.js +2 -2
- package/modern/context/SeriesContextProvider.js +1 -1
- package/modern/index.js +2 -1
- package/modern/internals/defaultizeValueFormatter.js +3 -3
- package/modern/internals/getWordsByLines.js +14 -0
- package/modern/internals/utils.js +40 -0
- package/package.json +1 -1
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.PieArcPlot = PieArcPlot;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _web = require("@react-spring/web");
|
|
12
13
|
var _PieArc = require("./PieArc");
|
|
13
14
|
var _transition = require("./dataTransform/transition");
|
|
@@ -89,4 +90,89 @@ function PieArcPlot(props) {
|
|
|
89
90
|
}, slotProps?.pieArc));
|
|
90
91
|
})
|
|
91
92
|
}));
|
|
92
|
-
}
|
|
93
|
+
}
|
|
94
|
+
process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
95
|
+
// ----------------------------- Warning --------------------------------
|
|
96
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
97
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
98
|
+
// ----------------------------------------------------------------------
|
|
99
|
+
/**
|
|
100
|
+
* The radius applied to arc corners (similar to border radius).
|
|
101
|
+
* @default 0
|
|
102
|
+
*/
|
|
103
|
+
cornerRadius: _propTypes.default.number,
|
|
104
|
+
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
105
|
+
color: _propTypes.default.string.isRequired,
|
|
106
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
107
|
+
formattedValue: _propTypes.default.string.isRequired,
|
|
108
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
109
|
+
index: _propTypes.default.number.isRequired,
|
|
110
|
+
label: _propTypes.default.string,
|
|
111
|
+
padAngle: _propTypes.default.number.isRequired,
|
|
112
|
+
startAngle: _propTypes.default.number.isRequired,
|
|
113
|
+
value: _propTypes.default.number.isRequired
|
|
114
|
+
})).isRequired,
|
|
115
|
+
/**
|
|
116
|
+
* Override the arc attibutes when it is faded.
|
|
117
|
+
*/
|
|
118
|
+
faded: _propTypes.default.shape({
|
|
119
|
+
additionalRadius: _propTypes.default.number,
|
|
120
|
+
color: _propTypes.default.string,
|
|
121
|
+
cornerRadius: _propTypes.default.number,
|
|
122
|
+
innerRadius: _propTypes.default.number,
|
|
123
|
+
outerRadius: _propTypes.default.number,
|
|
124
|
+
paddingAngle: _propTypes.default.number
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* Override the arc attibutes when it is highlighted.
|
|
128
|
+
*/
|
|
129
|
+
highlighted: _propTypes.default.shape({
|
|
130
|
+
additionalRadius: _propTypes.default.number,
|
|
131
|
+
color: _propTypes.default.string,
|
|
132
|
+
cornerRadius: _propTypes.default.number,
|
|
133
|
+
innerRadius: _propTypes.default.number,
|
|
134
|
+
outerRadius: _propTypes.default.number,
|
|
135
|
+
paddingAngle: _propTypes.default.number
|
|
136
|
+
}),
|
|
137
|
+
highlightScope: _propTypes.default.shape({
|
|
138
|
+
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
139
|
+
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
140
|
+
}),
|
|
141
|
+
id: _propTypes.default.string.isRequired,
|
|
142
|
+
/**
|
|
143
|
+
* The radius between circle center and the begining of the arc.
|
|
144
|
+
* @default 0
|
|
145
|
+
*/
|
|
146
|
+
innerRadius: _propTypes.default.number,
|
|
147
|
+
/**
|
|
148
|
+
* Callback fired when a pie item is clicked.
|
|
149
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
150
|
+
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
151
|
+
* @param {DefaultizedPieValueType} item The pie item.
|
|
152
|
+
*/
|
|
153
|
+
onClick: _propTypes.default.func,
|
|
154
|
+
/**
|
|
155
|
+
* The radius between circle center and the end of the arc.
|
|
156
|
+
*/
|
|
157
|
+
outerRadius: _propTypes.default.number.isRequired,
|
|
158
|
+
/**
|
|
159
|
+
* The padding angle (deg) between two arcs.
|
|
160
|
+
* @default 0
|
|
161
|
+
*/
|
|
162
|
+
paddingAngle: _propTypes.default.number,
|
|
163
|
+
/**
|
|
164
|
+
* If `true`, animations are skiped.
|
|
165
|
+
* @default false
|
|
166
|
+
*/
|
|
167
|
+
skipAnimation: _propTypes.default.bool,
|
|
168
|
+
/**
|
|
169
|
+
* The props used for each component slot.
|
|
170
|
+
* @default {}
|
|
171
|
+
*/
|
|
172
|
+
slotProps: _propTypes.default.object,
|
|
173
|
+
/**
|
|
174
|
+
* Overridable component slots.
|
|
175
|
+
* @default {}
|
|
176
|
+
*/
|
|
177
|
+
slots: _propTypes.default.object
|
|
178
|
+
} : void 0;
|
package/PieChart/PieChart.js
CHANGED
|
@@ -248,8 +248,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
248
248
|
arcLabelMinAngle: _propTypes.default.number,
|
|
249
249
|
color: _propTypes.default.string,
|
|
250
250
|
cornerRadius: _propTypes.default.number,
|
|
251
|
-
cx: _propTypes.default.number,
|
|
252
|
-
cy: _propTypes.default.number,
|
|
251
|
+
cx: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
252
|
+
cy: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
253
253
|
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
254
254
|
color: _propTypes.default.string,
|
|
255
255
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
@@ -278,8 +278,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
278
278
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
279
279
|
}),
|
|
280
280
|
id: _propTypes.default.string,
|
|
281
|
-
innerRadius: _propTypes.default.number,
|
|
282
|
-
outerRadius: _propTypes.default.number,
|
|
281
|
+
innerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
282
|
+
outerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
283
283
|
paddingAngle: _propTypes.default.number,
|
|
284
284
|
sortingValues: _propTypes.default.oneOfType([_propTypes.default.oneOf(['asc', 'desc', 'none']), _propTypes.default.func]),
|
|
285
285
|
startAngle: _propTypes.default.number,
|
package/PieChart/PiePlot.js
CHANGED
|
@@ -11,6 +11,7 @@ var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
|
11
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
12
12
|
var _PieArcPlot = require("./PieArcPlot");
|
|
13
13
|
var _PieArcLabelPlot = require("./PieArcLabelPlot");
|
|
14
|
+
var _utils = require("../internals/utils");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
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
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 && Object.prototype.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; }
|
|
@@ -42,10 +43,6 @@ function PiePlot(props) {
|
|
|
42
43
|
return null;
|
|
43
44
|
}
|
|
44
45
|
const availableRadius = Math.min(width, height) / 2;
|
|
45
|
-
const center = {
|
|
46
|
-
x: left + width / 2,
|
|
47
|
-
y: top + height / 2
|
|
48
|
-
};
|
|
49
46
|
const {
|
|
50
47
|
series,
|
|
51
48
|
seriesOrder
|
|
@@ -53,22 +50,26 @@ function PiePlot(props) {
|
|
|
53
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
54
51
|
children: [seriesOrder.map(seriesId => {
|
|
55
52
|
const {
|
|
56
|
-
innerRadius,
|
|
57
|
-
outerRadius,
|
|
53
|
+
innerRadius: innerRadiusParam,
|
|
54
|
+
outerRadius: outerRadiusParam,
|
|
58
55
|
cornerRadius,
|
|
59
56
|
paddingAngle,
|
|
60
57
|
data,
|
|
61
|
-
cx,
|
|
62
|
-
cy,
|
|
58
|
+
cx: cxParam,
|
|
59
|
+
cy: cyParam,
|
|
63
60
|
highlighted,
|
|
64
61
|
faded,
|
|
65
62
|
highlightScope
|
|
66
63
|
} = series[seriesId];
|
|
64
|
+
const outerRadius = (0, _utils.getPercentageValue)(outerRadiusParam ?? availableRadius, availableRadius);
|
|
65
|
+
const innerRadius = (0, _utils.getPercentageValue)(innerRadiusParam ?? 0, availableRadius);
|
|
66
|
+
const cx = (0, _utils.getPercentageValue)(cxParam ?? '50%', width);
|
|
67
|
+
const cy = (0, _utils.getPercentageValue)(cyParam ?? '50%', height);
|
|
67
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
68
|
-
transform: `translate(${
|
|
69
|
+
transform: `translate(${left + cx}, ${top + cy})`,
|
|
69
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArcPlot.PieArcPlot, {
|
|
70
71
|
innerRadius: innerRadius,
|
|
71
|
-
outerRadius: outerRadius
|
|
72
|
+
outerRadius: outerRadius,
|
|
72
73
|
cornerRadius: cornerRadius,
|
|
73
74
|
paddingAngle: paddingAngle,
|
|
74
75
|
id: seriesId,
|
|
@@ -84,19 +85,23 @@ function PiePlot(props) {
|
|
|
84
85
|
}, seriesId);
|
|
85
86
|
}), seriesOrder.map(seriesId => {
|
|
86
87
|
const {
|
|
87
|
-
innerRadius,
|
|
88
|
-
outerRadius,
|
|
88
|
+
innerRadius: innerRadiusParam,
|
|
89
|
+
outerRadius: outerRadiusParam,
|
|
89
90
|
cornerRadius,
|
|
90
91
|
paddingAngle,
|
|
91
92
|
arcLabel,
|
|
92
93
|
arcLabelMinAngle,
|
|
93
94
|
data,
|
|
94
|
-
cx,
|
|
95
|
-
cy,
|
|
95
|
+
cx: cxParam,
|
|
96
|
+
cy: cyParam,
|
|
96
97
|
highlightScope
|
|
97
98
|
} = series[seriesId];
|
|
99
|
+
const outerRadius = (0, _utils.getPercentageValue)(outerRadiusParam ?? availableRadius, availableRadius);
|
|
100
|
+
const innerRadius = (0, _utils.getPercentageValue)(innerRadiusParam ?? 0, availableRadius);
|
|
101
|
+
const cx = (0, _utils.getPercentageValue)(cxParam ?? '50%', width);
|
|
102
|
+
const cy = (0, _utils.getPercentageValue)(cyParam ?? '50%', height);
|
|
98
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
99
|
-
transform: `translate(${
|
|
104
|
+
transform: `translate(${left + cx}, ${top + cy})`,
|
|
100
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArcLabelPlot.PieArcLabelPlot, {
|
|
101
106
|
innerRadius: innerRadius,
|
|
102
107
|
outerRadius: outerRadius ?? availableRadius,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DefaultizedPieSeriesType, DefaultizedPieValueType } from '../../models/seriesType/pie';
|
|
2
|
-
import { DefaultizedProps } from '../../models/helpers';
|
|
1
|
+
import { ComputedPieRadius, DefaultizedPieSeriesType, DefaultizedPieValueType } from '../../models/seriesType/pie';
|
|
3
2
|
export interface AnimatedObject {
|
|
4
3
|
innerRadius: number;
|
|
5
4
|
outerRadius: number;
|
|
@@ -12,4 +11,4 @@ export interface ValueWithHighlight extends DefaultizedPieValueType, AnimatedObj
|
|
|
12
11
|
isFaded: boolean;
|
|
13
12
|
isHighlighted: boolean;
|
|
14
13
|
}
|
|
15
|
-
export declare function useTransformData(series:
|
|
14
|
+
export declare function useTransformData(series: Pick<DefaultizedPieSeriesType, 'cornerRadius' | 'paddingAngle' | 'id' | 'highlightScope' | 'highlighted' | 'faded' | 'data'> & ComputedPieRadius): ValueWithHighlight[];
|
package/PieChart/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export * from './PieChart';
|
|
2
|
+
export * from './PiePlot';
|
|
3
|
+
export * from './PieArcPlot';
|
|
4
|
+
export * from './PieArcLabelPlot';
|
|
5
|
+
export * from './PieArc';
|
|
6
|
+
export * from './PieArcLabel';
|
package/PieChart/index.js
CHANGED
|
@@ -3,55 +3,69 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PieChart", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _PieChart.PieChart;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PiePlot", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _PiePlot.PiePlot;
|
|
28
|
-
}
|
|
6
|
+
var _PieChart = require("./PieChart");
|
|
7
|
+
Object.keys(_PieChart).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _PieChart[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _PieChart[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
29
16
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
var _PiePlot = require("./PiePlot");
|
|
18
|
+
Object.keys(_PiePlot).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _PiePlot[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _PiePlot[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
35
27
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
var _PieArcPlot = require("./PieArcPlot");
|
|
29
|
+
Object.keys(_PieArcPlot).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _PieArcPlot[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _PieArcPlot[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
41
38
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
var _PieArcLabelPlot = require("./PieArcLabelPlot");
|
|
40
|
+
Object.keys(_PieArcLabelPlot).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _PieArcLabelPlot[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _PieArcLabelPlot[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
47
49
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
var _PieArc = require("./PieArc");
|
|
51
|
+
Object.keys(_PieArc).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _PieArc[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _PieArc[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
53
60
|
});
|
|
54
|
-
var _PiePlot = require("./PiePlot");
|
|
55
|
-
var _PieChart = require("./PieChart");
|
|
56
61
|
var _PieArcLabel = require("./PieArcLabel");
|
|
57
|
-
|
|
62
|
+
Object.keys(_PieArcLabel).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _PieArcLabel[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _PieArcLabel[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -69,11 +69,11 @@ const useChartDimensions = (inWidth, inHeight) => {
|
|
|
69
69
|
}, [computeSize, inHeight, inWidth]);
|
|
70
70
|
if (process.env.NODE_ENV !== 'production') {
|
|
71
71
|
if (displayError.current && inWidth === undefined && width === 0) {
|
|
72
|
-
console.error(`MUI:
|
|
72
|
+
console.error(`MUI-X-Charts: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`);
|
|
73
73
|
displayError.current = false;
|
|
74
74
|
}
|
|
75
75
|
if (displayError.current && inHeight === undefined && height === 0) {
|
|
76
|
-
console.error(`MUI:
|
|
76
|
+
console.error(`MUI-X-Charts: ChartContainer does not have \`height\` prop, and its container has no \`height\` defined.`);
|
|
77
77
|
displayError.current = false;
|
|
78
78
|
}
|
|
79
79
|
}
|
package/ScatterChart/Scatter.js
CHANGED
|
@@ -87,7 +87,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
|
|
|
87
87
|
color: _propTypes.default.string.isRequired,
|
|
88
88
|
markerSize: _propTypes.default.number.isRequired,
|
|
89
89
|
series: _propTypes.default.shape({
|
|
90
|
-
color: _propTypes.default.string,
|
|
90
|
+
color: _propTypes.default.string.isRequired,
|
|
91
91
|
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
92
92
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
93
93
|
x: _propTypes.default.number.isRequired,
|
package/ScatterChart/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './ScatterChart';
|
|
2
|
+
export * from './ScatterPlot';
|
|
3
|
+
export * from './Scatter';
|
package/ScatterChart/index.js
CHANGED
|
@@ -3,24 +3,36 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "ScatterPlot", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ScatterPlot.ScatterPlot;
|
|
22
|
-
}
|
|
6
|
+
var _ScatterChart = require("./ScatterChart");
|
|
7
|
+
Object.keys(_ScatterChart).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ScatterChart[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ScatterChart[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
23
16
|
});
|
|
24
17
|
var _ScatterPlot = require("./ScatterPlot");
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
Object.keys(_ScatterPlot).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ScatterPlot[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _ScatterPlot[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _Scatter = require("./Scatter");
|
|
29
|
+
Object.keys(_Scatter).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Scatter[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Scatter[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -62,7 +62,7 @@ function CartesianContextProvider({
|
|
|
62
62
|
return axisConfig;
|
|
63
63
|
}
|
|
64
64
|
if (dataset === undefined) {
|
|
65
|
-
throw Error('MUI: x-axis uses `dataKey` but no `dataset` is provided.');
|
|
65
|
+
throw Error('MUI-X-Charts: x-axis uses `dataKey` but no `dataset` is provided.');
|
|
66
66
|
}
|
|
67
67
|
return (0, _extends2.default)({}, axisConfig, {
|
|
68
68
|
data: dataset.map(d => d[dataKey])
|
|
@@ -74,7 +74,7 @@ function CartesianContextProvider({
|
|
|
74
74
|
return axisConfig;
|
|
75
75
|
}
|
|
76
76
|
if (dataset === undefined) {
|
|
77
|
-
throw Error('MUI: y-axis uses `dataKey` but no `dataset` is provided.');
|
|
77
|
+
throw Error('MUI-X-Charts: y-axis uses `dataKey` but no `dataset` is provided.');
|
|
78
78
|
}
|
|
79
79
|
return (0, _extends2.default)({}, axisConfig, {
|
|
80
80
|
data: dataset.map(d => d[dataKey])
|
|
@@ -49,7 +49,7 @@ const formatSeries = (series, colors, dataset) => {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
if (seriesGroups[type]?.series[id] !== undefined) {
|
|
52
|
-
throw new Error(`MUI: series' id "${id}" is not unique`);
|
|
52
|
+
throw new Error(`MUI-X-Charts: series' id "${id}" is not unique`);
|
|
53
53
|
}
|
|
54
54
|
seriesGroups[type].series[id] = (0, _extends2.default)({
|
|
55
55
|
id
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
7
|
import { useSlotProps } from '@mui/base/utils';
|
|
7
8
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
@@ -39,7 +40,7 @@ export const BarElementPath = styled(animated.rect, {
|
|
|
39
40
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
40
41
|
opacity: ownerState.isFaded && 0.3 || 1
|
|
41
42
|
}));
|
|
42
|
-
|
|
43
|
+
function BarElement(props) {
|
|
43
44
|
var _slots$bar;
|
|
44
45
|
const {
|
|
45
46
|
id,
|
|
@@ -90,4 +91,27 @@ export function BarElement(props) {
|
|
|
90
91
|
ownerState
|
|
91
92
|
});
|
|
92
93
|
return /*#__PURE__*/_jsx(Bar, _extends({}, barProps));
|
|
93
|
-
}
|
|
94
|
+
}
|
|
95
|
+
process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
|
|
96
|
+
// ----------------------------- Warning --------------------------------
|
|
97
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
98
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
99
|
+
// ----------------------------------------------------------------------
|
|
100
|
+
classes: PropTypes.object,
|
|
101
|
+
dataIndex: PropTypes.number.isRequired,
|
|
102
|
+
highlightScope: PropTypes.shape({
|
|
103
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
104
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
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 { BarElement };
|
package/esm/BarChart/BarPlot.js
CHANGED
|
@@ -8,7 +8,8 @@ import { SeriesContext } from '../context/SeriesContextProvider';
|
|
|
8
8
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
9
9
|
import { BarElement } from './BarElement';
|
|
10
10
|
import { isBandScaleConfig } from '../models/axis';
|
|
11
|
-
import {
|
|
11
|
+
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* Solution of the equations
|
|
14
15
|
* W = barWidth * N + offset * (N-1)
|
|
@@ -18,6 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
19
|
* @param gapRatio The ratio of the gap between bars over the bar width.
|
|
19
20
|
* @returns The bar width and the offset between bars.
|
|
20
21
|
*/
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
function getBandSize({
|
|
22
24
|
bandWidth: W,
|
|
23
25
|
numberOfGroups: N,
|
|
@@ -69,18 +71,18 @@ const useCompletedData = () => {
|
|
|
69
71
|
let baseScaleConfig;
|
|
70
72
|
if (verticalLayout) {
|
|
71
73
|
if (!isBandScaleConfig(xAxisConfig)) {
|
|
72
|
-
throw new Error(`
|
|
74
|
+
throw new Error(`MUI-X-Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud be of type "band" to display the bar series of id "${seriesId}"`);
|
|
73
75
|
}
|
|
74
76
|
if (xAxis[xAxisKey].data === undefined) {
|
|
75
|
-
throw new Error(`
|
|
77
|
+
throw new Error(`MUI-X-Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud have data property`);
|
|
76
78
|
}
|
|
77
79
|
baseScaleConfig = xAxisConfig;
|
|
78
80
|
} else {
|
|
79
81
|
if (!isBandScaleConfig(yAxisConfig)) {
|
|
80
|
-
throw new Error(`
|
|
82
|
+
throw new Error(`MUI-X-Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud be of type "band" to display the bar series of id "${seriesId}"`);
|
|
81
83
|
}
|
|
82
84
|
if (yAxis[yAxisKey].data === undefined) {
|
|
83
|
-
throw new Error(`
|
|
85
|
+
throw new Error(`MUI-X-Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud have data property`);
|
|
84
86
|
}
|
|
85
87
|
baseScaleConfig = yAxisConfig;
|
|
86
88
|
}
|
|
@@ -2,7 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import { stack as d3Stack } from 'd3-shape';
|
|
3
3
|
import { getStackingGroups } from '../internals/stackSeries';
|
|
4
4
|
import defaultizeValueFormatter from '../internals/defaultizeValueFormatter';
|
|
5
|
+
let warnOnce = false;
|
|
5
6
|
const formatter = (params, dataset) => {
|
|
7
|
+
var _ref;
|
|
6
8
|
const {
|
|
7
9
|
seriesOrder,
|
|
8
10
|
series
|
|
@@ -10,7 +12,7 @@ const formatter = (params, dataset) => {
|
|
|
10
12
|
const stackingGroups = getStackingGroups(params);
|
|
11
13
|
|
|
12
14
|
// Create a data set with format adapted to d3
|
|
13
|
-
const d3Dataset = dataset != null ?
|
|
15
|
+
const d3Dataset = (_ref = dataset) != null ? _ref : [];
|
|
14
16
|
seriesOrder.forEach(id => {
|
|
15
17
|
const data = series[id].data;
|
|
16
18
|
if (data !== undefined) {
|
|
@@ -24,7 +26,7 @@ const formatter = (params, dataset) => {
|
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
28
|
} else if (dataset === undefined) {
|
|
27
|
-
throw new Error([`MUI: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
29
|
+
throw new Error([`MUI-X-Charts: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
const completedSeries = {};
|
|
@@ -39,13 +41,27 @@ const formatter = (params, dataset) => {
|
|
|
39
41
|
// Use dataKey if needed and available
|
|
40
42
|
const dataKey = series[id].dataKey;
|
|
41
43
|
return series[id].data === undefined && dataKey !== undefined ? dataKey : id;
|
|
42
|
-
})).
|
|
44
|
+
})).value((d, key) => {
|
|
45
|
+
var _d$key;
|
|
46
|
+
return (_d$key = d[key]) != null ? _d$key : 0;
|
|
47
|
+
}) // defaultize null value to 0
|
|
48
|
+
.order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
43
49
|
ids.forEach((id, index) => {
|
|
44
50
|
const dataKey = series[id].dataKey;
|
|
45
51
|
completedSeries[id] = _extends({
|
|
46
52
|
layout: 'vertical'
|
|
47
53
|
}, series[id], {
|
|
48
|
-
data: dataKey ? dataset.map(
|
|
54
|
+
data: dataKey ? dataset.map(data => {
|
|
55
|
+
const value = data[dataKey];
|
|
56
|
+
if (typeof value !== 'number') {
|
|
57
|
+
if (process.env.NODE_ENV !== 'production' && !warnOnce && value !== null) {
|
|
58
|
+
warnOnce = true;
|
|
59
|
+
console.error([`MUI-X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
60
|
+
}
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}) : series[id].data,
|
|
49
65
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
50
66
|
});
|
|
51
67
|
});
|
package/esm/BarChart/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './BarChart';
|
|
2
|
+
export * from './BarPlot';
|
|
3
|
+
export * from './BarElement';
|
|
@@ -59,16 +59,16 @@ function ChartsAxis(props) {
|
|
|
59
59
|
const topId = getAxisId(topAxis);
|
|
60
60
|
const rightId = getAxisId(rightAxis);
|
|
61
61
|
if (topId !== null && !xAxis[topId]) {
|
|
62
|
-
throw Error(`MUI: id used for top axis "${topId}" is not defined`);
|
|
62
|
+
throw Error([`MUI-X-Charts: id used for top axis "${topId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
63
63
|
}
|
|
64
64
|
if (leftId !== null && !yAxis[leftId]) {
|
|
65
|
-
throw Error(`MUI: id used for left axis "${leftId}" is not defined`);
|
|
65
|
+
throw Error([`MUI-X-Charts: id used for left axis "${leftId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
66
66
|
}
|
|
67
67
|
if (rightId !== null && !yAxis[rightId]) {
|
|
68
|
-
throw Error(`MUI: id used for right axis "${rightId}" is not defined`);
|
|
68
|
+
throw Error([`MUI-X-Charts: id used for right axis "${rightId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
|
|
69
69
|
}
|
|
70
70
|
if (bottomId !== null && !xAxis[bottomId]) {
|
|
71
|
-
throw Error(`MUI: id used for bottom axis "${bottomId}" is not defined`);
|
|
71
|
+
throw Error([`MUI-X-Charts: id used for bottom axis "${bottomId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
|
|
72
72
|
}
|
|
73
73
|
const topAxisProps = mergeProps(topAxis, slots, slotProps);
|
|
74
74
|
const bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
|
|
@@ -11,7 +11,8 @@ import { DrawingContext } from '../context/DrawingProvider';
|
|
|
11
11
|
import { getSeriesToDisplay } from './utils';
|
|
12
12
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
13
13
|
import { getLegendUtilityClass } from './chartsLegendClasses';
|
|
14
|
-
import { ChartsText
|
|
14
|
+
import { ChartsText } from '../ChartsText';
|
|
15
|
+
import { getWordsByLines } from '../internals/getWordsByLines';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const useUtilityClasses = ownerState => {
|