@mui/x-charts 7.11.1 → 7.12.1
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.js +0 -2
- package/BarChart/BarElement.d.ts +20 -20
- package/BarChart/BarElement.js +3 -3
- package/BarChart/BarLabel/BarLabel.d.ts +20 -20
- package/BarChart/BarLabel/BarLabelItem.js +2 -2
- package/BarChart/BarPlot.js +2 -2
- package/BarChart/extremums.d.ts +1 -1
- package/BarChart/formatter.d.ts +2 -2
- package/BarChart/formatter.js +1 -1
- package/BarChart/getColor.d.ts +3 -3
- package/BarChart/getColor.js +4 -3
- package/BarChart/legend.d.ts +1 -1
- package/BarChart/plugin.d.ts +2 -2
- package/CHANGELOG.md +178 -4
- package/ChartContainer/ChartContainer.d.ts +4 -15
- package/ChartContainer/ChartContainer.js +7 -9
- package/ChartContainer/useChartContainerProps.d.ts +56 -57
- package/ChartContainer/useChartContainerProps.js +16 -19
- package/ChartContainer/useDefaultizeAxis.d.ts +25 -26
- package/ChartsLegend/ChartsLegend.js +6 -6
- package/ChartsLegend/DefaultChartsLegend.d.ts +1 -1
- package/ChartsLegend/LegendPerItem.js +2 -2
- package/ChartsLegend/utils.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +4 -4
- package/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltip.js +10 -10
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/ChartsXAxis/ChartsXAxis.js +5 -5
- package/ChartsYAxis/ChartsYAxis.js +6 -6
- package/Gauge/GaugeReferenceArc.js +1 -1
- package/Gauge/GaugeValueArc.js +1 -1
- package/LineChart/AnimatedArea.d.ts +20 -20
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.d.ts +20 -20
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.js +2 -2
- package/LineChart/AreaPlot.js +1 -1
- package/LineChart/LineChart.js +0 -2
- package/LineChart/LineElement.js +2 -2
- package/LineChart/LinePlot.js +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/extremums.d.ts +1 -1
- package/LineChart/formatter.d.ts +2 -2
- package/LineChart/formatter.js +1 -1
- package/LineChart/getColor.d.ts +3 -3
- package/LineChart/getColor.js +4 -3
- package/LineChart/legend.d.ts +1 -1
- package/LineChart/plugin.d.ts +2 -2
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArcLabel.js +1 -1
- package/PieChart/PieChart.js +0 -2
- package/PieChart/formatter.d.ts +2 -2
- package/PieChart/formatter.js +1 -1
- package/PieChart/getColor.d.ts +3 -2
- package/PieChart/getColor.js +4 -3
- package/PieChart/legend.d.ts +1 -1
- package/PieChart/plugin.d.ts +2 -2
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +2 -3
- package/ScatterChart/ScatterChart.js +0 -2
- package/ScatterChart/extremums.d.ts +1 -1
- package/ScatterChart/formatter.d.ts +2 -2
- package/ScatterChart/getColor.d.ts +3 -4
- package/ScatterChart/getColor.js +4 -3
- package/ScatterChart/legend.d.ts +1 -1
- package/ScatterChart/plugin.d.ts +2 -2
- package/SparkLineChart/SparkLineChart.js +0 -2
- package/context/CartesianProvider/CartesianProvider.d.ts +0 -9
- package/context/CartesianProvider/CartesianProvider.js +4 -2
- package/context/CartesianProvider/computeValue.d.ts +3 -2
- package/context/CartesianProvider/computeValue.js +1 -1
- package/context/CartesianProvider/defaultizeAxis.d.ts +25 -26
- package/context/CartesianProvider/getAxisExtremum.d.ts +3 -3
- package/context/PluginProvider/ColorProcessor.types.d.ts +8 -0
- package/context/PluginProvider/ExtremumGetter.types.d.ts +14 -0
- package/context/PluginProvider/ExtremumGetter.types.js +5 -0
- package/context/PluginProvider/Plugin.types.d.ts +25 -0
- package/context/PluginProvider/Plugin.types.js +5 -0
- package/context/PluginProvider/PluginContext.d.ts +4 -0
- package/context/PluginProvider/PluginContext.js +21 -0
- package/context/PluginProvider/PluginProvider.d.ts +4 -0
- package/context/{ColorProvider.js → PluginProvider/PluginProvider.js} +12 -11
- package/context/PluginProvider/SeriesFormatter.types.d.ts +21 -0
- package/context/PluginProvider/SeriesFormatter.types.js +5 -0
- package/context/PluginProvider/index.d.ts +10 -0
- package/context/PluginProvider/index.js +115 -0
- package/context/PluginProvider/mergePlugins.d.ts +36 -0
- package/context/PluginProvider/mergePlugins.js +37 -0
- package/context/PluginProvider/useColorProcessor.d.ts +4 -0
- package/context/PluginProvider/useColorProcessor.js +23 -0
- package/context/PluginProvider/useSeriesFormatter.d.ts +4 -0
- package/context/PluginProvider/useSeriesFormatter.js +23 -0
- package/context/PluginProvider/useXExtremumGetter.d.ts +4 -0
- package/context/PluginProvider/useXExtremumGetter.js +23 -0
- package/context/PluginProvider/useYExtremumGetter.d.ts +4 -0
- package/context/PluginProvider/useYExtremumGetter.js +23 -0
- package/context/SeriesProvider/Series.types.d.ts +26 -0
- package/context/SeriesProvider/Series.types.js +5 -0
- package/context/SeriesProvider/SeriesContext.d.ts +4 -0
- package/{hooks/useColor.js → context/SeriesProvider/SeriesContext.js} +7 -8
- package/context/SeriesProvider/SeriesProvider.d.ts +5 -0
- package/context/SeriesProvider/SeriesProvider.js +38 -0
- package/context/SeriesProvider/index.d.ts +12 -0
- package/context/SeriesProvider/index.js +49 -0
- package/context/SeriesProvider/processSeries.d.ts +18 -0
- package/context/SeriesProvider/processSeries.js +55 -0
- package/esm/BarChart/BarChart.js +0 -2
- package/esm/BarChart/BarElement.js +2 -2
- package/esm/BarChart/BarLabel/BarLabelItem.js +1 -1
- package/esm/BarChart/BarPlot.js +1 -2
- package/esm/BarChart/formatter.js +1 -1
- package/esm/BarChart/getColor.js +3 -2
- package/esm/ChartContainer/ChartContainer.js +7 -9
- package/esm/ChartContainer/useChartContainerProps.js +14 -19
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/LegendPerItem.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +2 -2
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltip.js +3 -3
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +2 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
- package/esm/Gauge/GaugeReferenceArc.js +1 -1
- package/esm/Gauge/GaugeValueArc.js +1 -1
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaElement.js +1 -1
- package/esm/LineChart/AreaPlot.js +1 -1
- package/esm/LineChart/LineChart.js +0 -2
- package/esm/LineChart/LineElement.js +1 -1
- package/esm/LineChart/LinePlot.js +1 -1
- package/esm/LineChart/MarkElement.js +1 -1
- package/esm/LineChart/formatter.js +1 -1
- package/esm/LineChart/getColor.js +3 -2
- package/esm/PieChart/PieArc.js +1 -1
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/PieChart/PieChart.js +0 -2
- package/esm/PieChart/formatter.js +1 -1
- package/esm/PieChart/getColor.js +3 -2
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
- package/esm/ScatterChart/ScatterChart.js +0 -2
- package/esm/ScatterChart/getColor.js +3 -2
- package/esm/SparkLineChart/SparkLineChart.js +0 -2
- package/esm/context/CartesianProvider/CartesianProvider.js +4 -2
- package/esm/context/CartesianProvider/computeValue.js +1 -1
- package/esm/context/PluginProvider/Plugin.types.js +1 -0
- package/esm/context/PluginProvider/PluginContext.js +13 -0
- package/esm/context/PluginProvider/PluginProvider.js +19 -0
- package/esm/context/PluginProvider/SeriesFormatter.types.js +1 -0
- package/esm/context/PluginProvider/index.js +10 -0
- package/esm/context/PluginProvider/mergePlugins.js +30 -0
- package/esm/context/PluginProvider/useColorProcessor.js +15 -0
- package/esm/context/PluginProvider/useSeriesFormatter.js +15 -0
- package/esm/context/PluginProvider/useXExtremumGetter.js +15 -0
- package/esm/context/PluginProvider/useYExtremumGetter.js +15 -0
- package/esm/context/SeriesProvider/Series.types.js +1 -0
- package/esm/context/SeriesProvider/SeriesContext.js +8 -0
- package/esm/context/SeriesProvider/SeriesProvider.js +31 -0
- package/esm/context/SeriesProvider/index.js +8 -0
- package/{modern/context/SeriesContextProvider.js → esm/context/SeriesProvider/processSeries.js} +9 -34
- package/esm/hooks/useReducedMotion.js +2 -2
- package/esm/hooks/useSeries.js +1 -1
- package/esm/internals/colorScale.js +1 -1
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
- package/esm/internals/getCurve.js +1 -1
- package/esm/internals/getScale.js +1 -1
- package/esm/internals/index.js +2 -2
- package/esm/internals/stackSeries.js +1 -1
- package/esm/internals/useAnimatedPath.js +1 -1
- package/esm/models/index.js +0 -1
- package/hooks/useReducedMotion.js +2 -2
- package/hooks/useSeries.d.ts +1 -1
- package/hooks/useSeries.js +2 -2
- package/hooks/useTicks.d.ts +1 -1
- package/index.js +1 -1
- package/internals/colorScale.d.ts +3 -3
- package/internals/colorScale.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/getCurve.d.ts +1 -1
- package/internals/getCurve.js +1 -1
- package/internals/getScale.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +16 -16
- package/internals/isBandScale.d.ts +1 -1
- package/internals/stackSeries.d.ts +1 -1
- package/internals/stackSeries.js +1 -1
- package/internals/useAnimatedPath.js +1 -1
- package/models/axis.d.ts +2 -2
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -11
- package/models/seriesType/config.d.ts +0 -26
- package/models/seriesType/pie.d.ts +1 -1
- package/models/z-axis.d.ts +1 -1
- package/modern/BarChart/BarChart.js +0 -2
- package/modern/BarChart/BarElement.js +2 -2
- package/modern/BarChart/BarLabel/BarLabelItem.js +1 -1
- package/modern/BarChart/BarPlot.js +1 -2
- package/modern/BarChart/formatter.js +1 -1
- package/modern/BarChart/getColor.js +3 -2
- package/modern/ChartContainer/ChartContainer.js +7 -9
- package/modern/ChartContainer/useChartContainerProps.js +14 -19
- package/modern/ChartsLegend/ChartsLegend.js +2 -2
- package/modern/ChartsLegend/LegendPerItem.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +2 -2
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltip.js +3 -3
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +2 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
- package/modern/Gauge/GaugeReferenceArc.js +1 -1
- package/modern/Gauge/GaugeValueArc.js +1 -1
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaElement.js +1 -1
- package/modern/LineChart/AreaPlot.js +1 -1
- package/modern/LineChart/LineChart.js +0 -2
- package/modern/LineChart/LineElement.js +1 -1
- package/modern/LineChart/LinePlot.js +1 -1
- package/modern/LineChart/MarkElement.js +1 -1
- package/modern/LineChart/formatter.js +1 -1
- package/modern/LineChart/getColor.js +3 -2
- package/modern/PieChart/PieArc.js +1 -1
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/PieChart/PieChart.js +0 -2
- package/modern/PieChart/formatter.js +1 -1
- package/modern/PieChart/getColor.js +3 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
- package/modern/ScatterChart/ScatterChart.js +0 -2
- package/modern/ScatterChart/getColor.js +3 -2
- package/modern/SparkLineChart/SparkLineChart.js +0 -2
- package/modern/context/CartesianProvider/CartesianProvider.js +4 -2
- package/modern/context/CartesianProvider/computeValue.js +1 -1
- package/modern/context/PluginProvider/ColorProcessor.types.js +1 -0
- package/modern/context/PluginProvider/ExtremumGetter.types.js +1 -0
- package/modern/context/PluginProvider/Plugin.types.js +1 -0
- package/modern/context/PluginProvider/PluginContext.js +13 -0
- package/modern/context/PluginProvider/PluginProvider.js +19 -0
- package/modern/context/PluginProvider/SeriesFormatter.types.js +1 -0
- package/modern/context/PluginProvider/index.js +10 -0
- package/modern/context/PluginProvider/mergePlugins.js +30 -0
- package/modern/context/PluginProvider/useColorProcessor.js +15 -0
- package/modern/context/PluginProvider/useSeriesFormatter.js +15 -0
- package/modern/context/PluginProvider/useXExtremumGetter.js +15 -0
- package/modern/context/PluginProvider/useYExtremumGetter.js +15 -0
- package/modern/context/SeriesProvider/Series.types.js +1 -0
- package/modern/context/SeriesProvider/SeriesContext.js +8 -0
- package/modern/context/SeriesProvider/SeriesProvider.js +31 -0
- package/modern/context/SeriesProvider/index.js +8 -0
- package/{esm/context/SeriesContextProvider.js → modern/context/SeriesProvider/processSeries.js} +9 -34
- package/modern/hooks/useReducedMotion.js +2 -2
- package/modern/hooks/useSeries.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/colorScale.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
- package/modern/internals/getCurve.js +1 -1
- package/modern/internals/getScale.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/internals/stackSeries.js +1 -1
- package/modern/internals/useAnimatedPath.js +1 -1
- package/modern/models/index.js +0 -1
- package/package.json +6 -23
- package/ChartContainer/defaultPlugins.d.ts +0 -2
- package/ChartContainer/defaultPlugins.js +0 -11
- package/ChartContainer/useChartContainerHooks.d.ts +0 -11
- package/ChartContainer/useChartContainerHooks.js +0 -34
- package/ChartContainer/usePluginsMerge.d.ts +0 -9
- package/ChartContainer/usePluginsMerge.js +0 -39
- package/context/ColorProvider.d.ts +0 -12
- package/context/SeriesContextProvider.d.ts +0 -36
- package/context/SeriesContextProvider.js +0 -81
- package/esm/ChartContainer/defaultPlugins.js +0 -5
- package/esm/ChartContainer/useChartContainerHooks.js +0 -24
- package/esm/ChartContainer/usePluginsMerge.js +0 -31
- package/esm/context/ColorProvider.js +0 -16
- package/esm/hooks/useColor.js +0 -9
- package/hooks/useColor.d.ts +0 -4
- package/models/plugin.d.ts +0 -19
- package/modern/ChartContainer/defaultPlugins.js +0 -5
- package/modern/ChartContainer/useChartContainerHooks.js +0 -24
- package/modern/ChartContainer/usePluginsMerge.js +0 -31
- package/modern/context/ColorProvider.js +0 -16
- package/modern/hooks/useColor.js +0 -9
- /package/{models/plugin.js → context/PluginProvider/ColorProcessor.types.js} +0 -0
- /package/esm/{models/plugin.js → context/PluginProvider/ColorProcessor.types.js} +0 -0
- /package/{modern/models/plugin.js → esm/context/PluginProvider/ExtremumGetter.types.js} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SeriesProvider = SeriesProvider;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _styles = require("@mui/material/styles");
|
|
9
|
+
var _colorPalettes = require("../../colorPalettes");
|
|
10
|
+
var _SeriesContext = require("./SeriesContext");
|
|
11
|
+
var _processSeries = require("./processSeries");
|
|
12
|
+
var _PluginProvider = require("../PluginProvider");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
function SeriesProvider(props) {
|
|
17
|
+
const {
|
|
18
|
+
series,
|
|
19
|
+
dataset,
|
|
20
|
+
colors = _colorPalettes.blueberryTwilightPalette,
|
|
21
|
+
children
|
|
22
|
+
} = props;
|
|
23
|
+
const seriesFormatters = (0, _PluginProvider.useSeriesFormatter)();
|
|
24
|
+
const theme = (0, _styles.useTheme)();
|
|
25
|
+
const formattedSeries = React.useMemo(() => ({
|
|
26
|
+
isInitialized: true,
|
|
27
|
+
data: (0, _processSeries.preprocessSeries)({
|
|
28
|
+
series,
|
|
29
|
+
colors: typeof colors === 'function' ? colors(theme.palette.mode) : colors,
|
|
30
|
+
seriesFormatters,
|
|
31
|
+
dataset: dataset
|
|
32
|
+
})
|
|
33
|
+
}), [series, colors, theme.palette.mode, seriesFormatters, dataset]);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContext.SeriesContext.Provider, {
|
|
35
|
+
value: formattedSeries,
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './SeriesProvider';
|
|
2
|
+
export * from './SeriesContext';
|
|
3
|
+
export * from './Series.types';
|
|
4
|
+
declare const seriesProviderUtils: {
|
|
5
|
+
preprocessSeries: <T extends import("../../internals").ChartSeriesType>({ series, colors, seriesFormatters, dataset, }: {
|
|
6
|
+
series: import("../..").AllSeriesType<T>[];
|
|
7
|
+
colors: string[];
|
|
8
|
+
seriesFormatters: import("../PluginProvider").SeriesFormatterConfig<T>;
|
|
9
|
+
dataset?: import("../../internals").DatasetType;
|
|
10
|
+
}) => import("./Series.types").FormattedSeries;
|
|
11
|
+
};
|
|
12
|
+
export { seriesProviderUtils };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
seriesProviderUtils: true
|
|
8
|
+
};
|
|
9
|
+
exports.seriesProviderUtils = void 0;
|
|
10
|
+
var _processSeries = require("./processSeries");
|
|
11
|
+
var _SeriesProvider = require("./SeriesProvider");
|
|
12
|
+
Object.keys(_SeriesProvider).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _SeriesProvider[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _SeriesProvider[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
var _SeriesContext = require("./SeriesContext");
|
|
24
|
+
Object.keys(_SeriesContext).forEach(function (key) {
|
|
25
|
+
if (key === "default" || key === "__esModule") return;
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
+
if (key in exports && exports[key] === _SeriesContext[key]) return;
|
|
28
|
+
Object.defineProperty(exports, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _SeriesContext[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
var _Series = require("./Series.types");
|
|
36
|
+
Object.keys(_Series).forEach(function (key) {
|
|
37
|
+
if (key === "default" || key === "__esModule") return;
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
+
if (key in exports && exports[key] === _Series[key]) return;
|
|
40
|
+
Object.defineProperty(exports, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _Series[key];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
const seriesProviderUtils = exports.seriesProviderUtils = {
|
|
48
|
+
preprocessSeries: _processSeries.preprocessSeries
|
|
49
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AllSeriesType } from '../../models/seriesType';
|
|
2
|
+
import { ChartSeriesType, DatasetType } from '../../models/seriesType/config';
|
|
3
|
+
import { FormattedSeries } from './Series.types';
|
|
4
|
+
import { SeriesFormatterConfig } from '../PluginProvider';
|
|
5
|
+
/**
|
|
6
|
+
* This methods is the interface between what the developer is providing and what components receives
|
|
7
|
+
* To simplify the components behaviors, it groups series by type, such that LinePlots props are not updated if some line data are modified
|
|
8
|
+
* It also add defaultized values such as the ids, colors
|
|
9
|
+
* @param series The array of series provided by the developer
|
|
10
|
+
* @param colors The color palette used to defaultize series colors
|
|
11
|
+
* @returns An object structuring all the series by type.
|
|
12
|
+
*/
|
|
13
|
+
export declare const preprocessSeries: <T extends ChartSeriesType>({ series, colors, seriesFormatters, dataset, }: {
|
|
14
|
+
series: AllSeriesType<T>[];
|
|
15
|
+
colors: string[];
|
|
16
|
+
seriesFormatters: SeriesFormatterConfig<T>;
|
|
17
|
+
dataset?: DatasetType;
|
|
18
|
+
}) => FormattedSeries;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.preprocessSeries = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _defaultizeColor = require("../../internals/defaultizeColor");
|
|
10
|
+
/**
|
|
11
|
+
* This methods is the interface between what the developer is providing and what components receives
|
|
12
|
+
* To simplify the components behaviors, it groups series by type, such that LinePlots props are not updated if some line data are modified
|
|
13
|
+
* It also add defaultized values such as the ids, colors
|
|
14
|
+
* @param series The array of series provided by the developer
|
|
15
|
+
* @param colors The color palette used to defaultize series colors
|
|
16
|
+
* @returns An object structuring all the series by type.
|
|
17
|
+
*/
|
|
18
|
+
const preprocessSeries = ({
|
|
19
|
+
series,
|
|
20
|
+
colors,
|
|
21
|
+
seriesFormatters,
|
|
22
|
+
dataset
|
|
23
|
+
}) => {
|
|
24
|
+
// Group series by type
|
|
25
|
+
const seriesGroups = {};
|
|
26
|
+
series.forEach((seriesData, seriesIndex) => {
|
|
27
|
+
const {
|
|
28
|
+
id = `auto-generated-id-${seriesIndex}`,
|
|
29
|
+
type
|
|
30
|
+
} = seriesData;
|
|
31
|
+
if (seriesGroups[type] === undefined) {
|
|
32
|
+
seriesGroups[type] = {
|
|
33
|
+
series: {},
|
|
34
|
+
seriesOrder: []
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (seriesGroups[type]?.series[id] !== undefined) {
|
|
38
|
+
throw new Error(`MUI X: series' id "${id}" is not unique.`);
|
|
39
|
+
}
|
|
40
|
+
seriesGroups[type].series[id] = (0, _extends2.default)({
|
|
41
|
+
id
|
|
42
|
+
}, (0, _defaultizeColor.defaultizeColor)(seriesData, seriesIndex, colors));
|
|
43
|
+
seriesGroups[type].seriesOrder.push(id);
|
|
44
|
+
});
|
|
45
|
+
const formattedSeries = {};
|
|
46
|
+
// Apply formatter on a type group
|
|
47
|
+
Object.keys(seriesFormatters).forEach(type => {
|
|
48
|
+
const group = seriesGroups[type];
|
|
49
|
+
if (group !== undefined) {
|
|
50
|
+
formattedSeries[type] = seriesFormatters[type]?.(group, dataset) ?? seriesGroups[type];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return formattedSeries;
|
|
54
|
+
};
|
|
55
|
+
exports.preprocessSeries = preprocessSeries;
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -239,7 +239,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
239
239
|
* An array of [[AxisConfig]] objects.
|
|
240
240
|
*/
|
|
241
241
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
242
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
243
242
|
classes: PropTypes.object,
|
|
244
243
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
245
244
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -292,7 +291,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
292
291
|
* An array of [[AxisConfig]] objects.
|
|
293
292
|
*/
|
|
294
293
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
295
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
296
294
|
classes: PropTypes.object,
|
|
297
295
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
298
296
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -4,11 +4,11 @@ const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps",
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import
|
|
7
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
9
9
|
import { styled } from '@mui/material/styles';
|
|
10
|
-
import { color as d3Color } from 'd3-color';
|
|
11
10
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
11
|
+
import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
|
|
12
12
|
import { animated } from '@react-spring/web';
|
|
13
13
|
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
14
14
|
import { useItemHighlighted } from '../context';
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["seriesId", "classes", "color", "style", "dataIndex", "barLabel", "slots", "slotProps", "height", "width", "value"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useUtilityClasses } from './barLabelClasses';
|
|
9
9
|
import { getBarLabel } from './getBarLabel';
|
package/esm/BarChart/BarPlot.js
CHANGED
|
@@ -12,7 +12,7 @@ import { BarClipPath } from './BarClipPath';
|
|
|
12
12
|
import { BarLabelPlot } from './BarLabel/BarLabelPlot';
|
|
13
13
|
import { checkScaleErrors } from './checkScaleErrors';
|
|
14
14
|
import { useBarSeries } from '../hooks/useSeries';
|
|
15
|
-
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
/**
|
|
17
17
|
* Solution of the equations
|
|
18
18
|
* W = barWidth * N + offset * (N-1)
|
|
@@ -22,7 +22,6 @@ import { useBarSeries } from '../hooks/useSeries';
|
|
|
22
22
|
* @param gapRatio The ratio of the gap between bars over the bar width.
|
|
23
23
|
* @returns The bar width and the offset between bars.
|
|
24
24
|
*/
|
|
25
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
25
|
function getBandSize({
|
|
27
26
|
bandWidth: W,
|
|
28
27
|
numberOfGroups: N,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { stack as d3Stack } from 'd3-shape';
|
|
2
|
+
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
3
|
import { getStackingGroups } from '../internals/stackSeries';
|
|
4
4
|
import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
|
|
5
5
|
let warnOnce = false;
|
package/esm/BarChart/getColor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const getColor = (series, xAxis, yAxis) => {
|
|
2
2
|
const verticalLayout = series.layout === 'vertical';
|
|
3
3
|
const bandColorScale = verticalLayout ? xAxis?.colorScale : yAxis?.colorScale;
|
|
4
4
|
const valueColorScale = verticalLayout ? yAxis?.colorScale : xAxis?.colorScale;
|
|
@@ -24,4 +24,5 @@ export default function getColor(series, xAxis, yAxis) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
return () => series.color;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
export default getColor;
|
|
@@ -2,29 +2,29 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { DrawingProvider } from '../context/DrawingProvider';
|
|
5
|
-
import {
|
|
5
|
+
import { SeriesProvider } from '../context/SeriesProvider';
|
|
6
6
|
import { InteractionProvider } from '../context/InteractionProvider';
|
|
7
|
-
import { ColorProvider } from '../context/ColorProvider';
|
|
8
7
|
import { ChartsSurface } from '../ChartsSurface';
|
|
9
8
|
import { CartesianContextProvider } from '../context/CartesianProvider';
|
|
10
9
|
import { ChartsAxesGradients } from '../internals/components/ChartsAxesGradients';
|
|
11
10
|
import { HighlightedProvider, ZAxisContextProvider } from '../context';
|
|
11
|
+
import { PluginProvider } from '../context/PluginProvider';
|
|
12
12
|
import { useChartContainerProps } from './useChartContainerProps';
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
15
15
|
const {
|
|
16
16
|
children,
|
|
17
17
|
drawingProviderProps,
|
|
18
|
-
|
|
19
|
-
seriesContextProps,
|
|
18
|
+
seriesProviderProps,
|
|
20
19
|
cartesianContextProps,
|
|
21
20
|
zAxisContextProps,
|
|
22
21
|
highlightedProviderProps,
|
|
23
|
-
chartsSurfaceProps
|
|
22
|
+
chartsSurfaceProps,
|
|
23
|
+
pluginProviderProps
|
|
24
24
|
} = useChartContainerProps(props, ref);
|
|
25
25
|
return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
|
|
26
|
-
children: /*#__PURE__*/_jsx(
|
|
27
|
-
children: /*#__PURE__*/_jsx(
|
|
26
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
27
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
28
28
|
children: /*#__PURE__*/_jsx(CartesianContextProvider, _extends({}, cartesianContextProps, {
|
|
29
29
|
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
30
30
|
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
@@ -121,7 +121,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
121
121
|
* An array of [[AxisConfig]] objects.
|
|
122
122
|
*/
|
|
123
123
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
124
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
125
124
|
classes: PropTypes.object,
|
|
126
125
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
127
126
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -174,7 +173,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
174
173
|
* An array of [[AxisConfig]] objects.
|
|
175
174
|
*/
|
|
176
175
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
177
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
178
176
|
classes: PropTypes.object,
|
|
179
177
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
180
178
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["width", "height", "series", "margin", "xAxis", "yAxis", "zAxis", "colors", "dataset", "sx", "title", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "children"];
|
|
4
|
-
import
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
5
6
|
import { useDefaultizeAxis } from './useDefaultizeAxis';
|
|
7
|
+
import { useReducedMotion } from '../hooks/useReducedMotion';
|
|
6
8
|
export const useChartContainerProps = (props, ref) => {
|
|
7
9
|
const {
|
|
8
10
|
width,
|
|
@@ -24,14 +26,10 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
24
26
|
children
|
|
25
27
|
} = props,
|
|
26
28
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
yExtremumGetters,
|
|
32
|
-
seriesFormatters,
|
|
33
|
-
colorProcessors
|
|
34
|
-
} = useChartContainerHooks(ref, plugins);
|
|
29
|
+
const svgRef = React.useRef(null);
|
|
30
|
+
const chartSurfaceRef = useForkRef(ref, svgRef);
|
|
31
|
+
useReducedMotion(); // a11y reduce motion (see: https://react-spring.dev/docs/utilities/use-reduced-motion)
|
|
32
|
+
|
|
35
33
|
const [defaultizedXAxis, defaultizedYAxis] = useDefaultizeAxis(xAxis, yAxis);
|
|
36
34
|
const drawingProviderProps = {
|
|
37
35
|
width,
|
|
@@ -39,21 +37,18 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
39
37
|
margin,
|
|
40
38
|
svgRef
|
|
41
39
|
};
|
|
42
|
-
const
|
|
43
|
-
|
|
40
|
+
const pluginProviderProps = {
|
|
41
|
+
plugins
|
|
44
42
|
};
|
|
45
|
-
const
|
|
43
|
+
const seriesProviderProps = {
|
|
46
44
|
series,
|
|
47
45
|
colors,
|
|
48
|
-
dataset
|
|
49
|
-
seriesFormatters
|
|
46
|
+
dataset
|
|
50
47
|
};
|
|
51
48
|
const cartesianContextProps = {
|
|
52
49
|
xAxis: defaultizedXAxis,
|
|
53
50
|
yAxis: defaultizedYAxis,
|
|
54
|
-
dataset
|
|
55
|
-
xExtremumGetters,
|
|
56
|
-
yExtremumGetters
|
|
51
|
+
dataset
|
|
57
52
|
};
|
|
58
53
|
const zAxisContextProps = {
|
|
59
54
|
zAxis,
|
|
@@ -75,12 +70,12 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
75
70
|
return {
|
|
76
71
|
children,
|
|
77
72
|
drawingProviderProps,
|
|
78
|
-
|
|
79
|
-
seriesContextProps,
|
|
73
|
+
seriesProviderProps,
|
|
80
74
|
cartesianContextProps,
|
|
81
75
|
zAxisContextProps,
|
|
82
76
|
highlightedProviderProps,
|
|
83
77
|
chartsSurfaceProps,
|
|
78
|
+
pluginProviderProps,
|
|
84
79
|
xAxis: defaultizedXAxis,
|
|
85
80
|
yAxis: defaultizedYAxis
|
|
86
81
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
5
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import { useThemeProps, useTheme } from '@mui/material/styles';
|
|
7
7
|
import { getSeriesToDisplay } from './utils';
|
|
8
8
|
import { getLegendUtilityClass } from './chartsLegendClasses';
|
|
@@ -2,7 +2,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["rotate", "dominantBaseline"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import NoSsr from '@mui/material/NoSsr';
|
|
6
6
|
import { useTheme, styled } from '@mui/material/styles';
|
|
7
7
|
import { ChartsText } from '../ChartsText';
|
|
8
8
|
import { getWordsByLines } from '../internals/getWordsByLines';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
4
4
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
5
5
|
import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
|
|
6
6
|
import { ZAxisContext } from '../context/ZAxisContextProvider';
|
|
7
|
-
import { useColorProcessor } from '../
|
|
7
|
+
import { useColorProcessor } from '../context/PluginProvider/useColorProcessor';
|
|
8
8
|
import { isCartesianSeriesType } from '../internals/isCartesian';
|
|
9
9
|
import { useSeries } from '../hooks/useSeries';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
4
4
|
import { DefaultChartsItemTooltipContent } from './DefaultChartsItemTooltipContent';
|
|
5
5
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
6
6
|
import { ZAxisContext } from '../context/ZAxisContextProvider';
|
|
7
|
-
import { useColorProcessor } from '../
|
|
7
|
+
import { useColorProcessor } from '../context/PluginProvider/useColorProcessor';
|
|
8
8
|
import { useSeries } from '../hooks/useSeries';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
/**
|
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
5
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import Popper from '@mui/material/Popper';
|
|
7
|
+
import NoSsr from '@mui/material/NoSsr';
|
|
8
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
9
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
10
10
|
import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
|
|
11
11
|
import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Delaunay } from 'd3-delaunay';
|
|
3
|
+
import { Delaunay } from '@mui/x-charts-vendor/d3-delaunay';
|
|
4
4
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
5
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
6
6
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["scale", "tickNumber", "reverse"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { useThemeProps, useTheme } from '@mui/material/styles';
|
|
9
9
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
10
10
|
import { useTicks } from '../hooks/useTicks';
|
|
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["scale", "tickNumber"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { useThemeProps, useTheme } from '@mui/material/styles';
|
|
9
9
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
10
10
|
import { useTicks } from '../hooks/useTicks';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { arc as d3Arc } from 'd3-shape';
|
|
3
|
+
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { useGaugeState } from './GaugeProvider';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { arc as d3Arc } from 'd3-shape';
|
|
3
|
+
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { useGaugeState } from './GaugeProvider';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -4,8 +4,8 @@ const _excluded = ["d", "skipAnimation", "ownerState"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
-
import { color as d3Color } from 'd3-color';
|
|
8
7
|
import { animated, useSpring } from '@react-spring/web';
|
|
8
|
+
import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
|
|
9
9
|
import { useAnimatedPath } from '../internals/useAnimatedPath';
|
|
10
10
|
import { cleanId } from '../internals/cleanId';
|
|
11
11
|
import { useChartId, useDrawingArea } from '../hooks';
|
|
@@ -4,7 +4,7 @@ const _excluded = ["d", "skipAnimation", "ownerState"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { animated, useSpring } from '@react-spring/web';
|
|
7
|
-
import { color as d3Color } from 'd3-color';
|
|
7
|
+
import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import { useAnimatedPath } from '../internals/useAnimatedPath';
|
|
10
10
|
import { cleanId } from '../internals/cleanId';
|
|
@@ -4,7 +4,7 @@ const _excluded = ["id", "classes", "color", "gradientId", "slots", "slotProps",
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import
|
|
7
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
10
|
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { area as d3Area } from 'd3-shape';
|
|
6
|
+
import { area as d3Area } from '@mui/x-charts-vendor/d3-shape';
|
|
7
7
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
8
8
|
import { AreaElement } from './AreaElement';
|
|
9
9
|
import { getValueToPositionMapper } from '../hooks/useScale';
|
|
@@ -240,7 +240,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
240
240
|
* An array of [[AxisConfig]] objects.
|
|
241
241
|
*/
|
|
242
242
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
243
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
244
243
|
classes: PropTypes.object,
|
|
245
244
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
246
245
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -293,7 +292,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
293
292
|
* An array of [[AxisConfig]] objects.
|
|
294
293
|
*/
|
|
295
294
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
296
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
297
295
|
classes: PropTypes.object,
|
|
298
296
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
299
297
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -4,7 +4,7 @@ const _excluded = ["id", "classes", "color", "gradientId", "slots", "slotProps",
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import
|
|
7
|
+
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
10
|
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { line as d3Line } from 'd3-shape';
|
|
6
|
+
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
7
7
|
import { useCartesianContext } from '../context/CartesianProvider';
|
|
8
8
|
import { LineElement } from './LineElement';
|
|
9
9
|
import { getValueToPositionMapper } from '../hooks/useScale';
|
|
@@ -7,7 +7,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
7
7
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
|
-
import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from 'd3-shape';
|
|
10
|
+
import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
|
|
11
11
|
import { animated, to, useSpring } from '@react-spring/web';
|
|
12
12
|
import { getSymbol } from '../internals/getSymbol';
|
|
13
13
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { stack as d3Stack } from 'd3-shape';
|
|
2
|
+
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
3
|
import { getStackingGroups } from '../internals/stackSeries';
|
|
4
4
|
import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
|
|
5
5
|
let warnedOnce = false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const getColor = (series, xAxis, yAxis) => {
|
|
2
2
|
const yColorScale = yAxis?.colorScale;
|
|
3
3
|
const xColorScale = xAxis?.colorScale;
|
|
4
4
|
if (yColorScale) {
|
|
@@ -22,4 +22,5 @@ export default function getColor(series, xAxis, yAxis) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
return () => series.color;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
|
+
export default getColor;
|
package/esm/PieChart/PieArc.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle", "highlightScope"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { arc as d3Arc } from 'd3-shape';
|
|
6
|
+
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
7
7
|
import { animated, to } from '@react-spring/web';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|