@mui/x-charts 7.6.1 → 7.7.0
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 +1 -1
- package/BarChart/BarChart.js +2 -2
- package/BarChart/BarPlot.js +2 -2
- package/BarChart/formatter.js +2 -2
- package/BarChart/getColor.d.ts +1 -1
- package/BarChart/getColor.js +4 -4
- package/BarChart/plugin.d.ts +2 -0
- package/BarChart/plugin.js +17 -0
- package/CHANGELOG.md +147 -0
- package/ChartContainer/ChartContainer.d.ts +15 -3
- package/ChartContainer/ChartContainer.js +70 -22
- package/ChartContainer/defaultPlugins.d.ts +2 -0
- package/ChartContainer/defaultPlugins.js +11 -0
- package/ChartContainer/usePluginsMerge.d.ts +10 -0
- package/ChartContainer/usePluginsMerge.js +39 -0
- package/ChartsLegend/ChartsLegend.js +2 -2
- package/ChartsLegend/utils.js +4 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/ChartsOverlay/index.d.ts +1 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/ChartsText/ChartsText.js +1 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.js +9 -15
- package/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +5 -4
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsTooltip/utils.d.ts +1 -7
- package/ChartsTooltip/utils.js +2 -10
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +17 -19
- package/ChartsYAxis/ChartsYAxis.js +17 -19
- package/LineChart/AreaPlot.js +2 -2
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +3 -3
- package/LineChart/LineHighlightPlot.js +2 -2
- package/LineChart/LinePlot.js +2 -2
- package/LineChart/MarkPlot.js +2 -2
- package/LineChart/formatter.js +2 -2
- package/LineChart/getColor.d.ts +1 -1
- package/LineChart/getColor.js +2 -2
- package/LineChart/plugin.d.ts +2 -0
- package/LineChart/plugin.js +17 -0
- package/PieChart/PieChart.d.ts +2 -2
- package/PieChart/PieChart.js +3 -3
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/plugin.d.ts +2 -0
- package/PieChart/plugin.js +14 -0
- package/ResponsiveChartContainer/ResizableContainer.d.ts +10 -0
- package/ResponsiveChartContainer/ResizableContainer.js +32 -0
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +32 -24
- package/ScatterChart/ScatterChart.d.ts +2 -2
- package/ScatterChart/ScatterChart.js +3 -3
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/formatter.js +2 -3
- package/ScatterChart/getColor.d.ts +1 -1
- package/ScatterChart/getColor.js +2 -2
- package/ScatterChart/plugin.d.ts +2 -0
- package/ScatterChart/plugin.js +17 -0
- package/SparkLineChart/SparkLineChart.d.ts +9 -4
- package/SparkLineChart/SparkLineChart.js +58 -2
- package/context/CartesianContextProvider.d.ts +21 -10
- package/context/CartesianContextProvider.js +7 -20
- package/context/ColorProvider.d.ts +12 -0
- package/context/ColorProvider.js +25 -0
- package/context/DrawingProvider.d.ts +3 -1
- package/context/DrawingProvider.js +9 -2
- package/context/HighlightedProvider/HighlightedContext.d.ts +2 -1
- package/context/HighlightedProvider/HighlightedContext.js +8 -5
- package/context/HighlightedProvider/HighlightedProvider.js +15 -12
- package/context/HighlightedProvider/useHighlighted.js +6 -3
- package/context/HighlightedProvider/useItemHighlighted.js +2 -8
- package/context/SeriesContextProvider.d.ts +16 -5
- package/context/SeriesContextProvider.js +14 -17
- package/context/context.types.d.ts +4 -0
- package/context/context.types.js +5 -0
- package/esm/BarChart/BarChart.js +2 -2
- package/esm/BarChart/BarPlot.js +2 -2
- package/esm/BarChart/formatter.js +1 -1
- package/esm/BarChart/getColor.js +4 -4
- package/esm/BarChart/plugin.js +10 -0
- package/esm/ChartContainer/ChartContainer.js +71 -23
- package/esm/ChartContainer/defaultPlugins.js +5 -0
- package/esm/ChartContainer/usePluginsMerge.js +31 -0
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/utils.js +4 -1
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/esm/ChartsText/ChartsText.js +1 -3
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -14
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +5 -4
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsTooltip/utils.js +2 -8
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +17 -19
- package/esm/ChartsYAxis/ChartsYAxis.js +17 -19
- package/esm/LineChart/AreaPlot.js +2 -2
- package/esm/LineChart/LineChart.js +3 -3
- package/esm/LineChart/LineHighlightPlot.js +2 -2
- package/esm/LineChart/LinePlot.js +2 -2
- package/esm/LineChart/MarkPlot.js +2 -2
- package/esm/LineChart/formatter.js +1 -1
- package/esm/LineChart/getColor.js +2 -2
- package/esm/LineChart/plugin.js +10 -0
- package/esm/PieChart/PieChart.js +3 -3
- package/esm/PieChart/PiePlot.js +2 -2
- package/esm/PieChart/plugin.js +7 -0
- package/esm/ResponsiveChartContainer/ResizableContainer.js +26 -0
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +31 -23
- package/esm/ScatterChart/ScatterChart.js +3 -3
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/formatter.js +1 -1
- package/esm/ScatterChart/getColor.js +2 -2
- package/esm/ScatterChart/plugin.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +58 -2
- package/esm/context/CartesianContextProvider.js +7 -20
- package/esm/context/ColorProvider.js +16 -0
- package/esm/context/DrawingProvider.js +9 -2
- package/esm/context/HighlightedProvider/HighlightedContext.js +8 -5
- package/esm/context/HighlightedProvider/HighlightedProvider.js +15 -12
- package/esm/context/HighlightedProvider/useHighlighted.js +6 -3
- package/esm/context/HighlightedProvider/useItemHighlighted.js +2 -6
- package/esm/context/SeriesContextProvider.js +14 -17
- package/esm/context/context.types.js +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useColor.js +9 -0
- package/esm/hooks/useColorScale.js +27 -0
- package/esm/hooks/useInteractionItemProps.js +2 -2
- package/esm/hooks/useReducedMotion.js +7 -0
- package/esm/hooks/useSeries.js +6 -3
- package/esm/hooks/useSvgRef.js +6 -3
- package/esm/internals/configInit.js +20 -0
- package/esm/internals/defaultizeValueFormatter.js +2 -3
- package/esm/internals/index.js +27 -0
- package/esm/internals/isCartesian.js +7 -0
- package/esm/internals/warning.js +13 -0
- package/esm/models/index.js +1 -0
- package/esm/models/plugin.js +1 -0
- package/esm/models/seriesType/index.js +6 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useColor.d.ts +4 -0
- package/hooks/useColor.js +17 -0
- package/hooks/useColorScale.d.ts +4 -0
- package/hooks/useColorScale.js +37 -0
- package/hooks/useInteractionItemProps.js +1 -1
- package/hooks/useReducedMotion.js +7 -0
- package/hooks/useSeries.d.ts +6 -11
- package/hooks/useSeries.js +6 -3
- package/hooks/useSvgRef.js +6 -3
- package/hooks/useTicks.d.ts +4 -2
- package/index.js +1 -1
- package/internals/configInit.d.ts +9 -0
- package/internals/configInit.js +26 -0
- package/internals/defaultizeColor.d.ts +8 -8
- package/internals/defaultizeValueFormatter.d.ts +1 -2
- package/internals/defaultizeValueFormatter.js +2 -3
- package/internals/index.d.ts +17 -0
- package/internals/index.js +203 -0
- package/internals/isCartesian.d.ts +7 -0
- package/internals/isCartesian.js +14 -0
- package/internals/package.json +6 -0
- package/internals/warning.d.ts +1 -0
- package/internals/warning.js +19 -0
- package/models/axis.d.ts +4 -5
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/models/plugin.d.ts +16 -0
- package/models/plugin.js +5 -0
- package/models/seriesType/config.d.ts +30 -5
- package/models/seriesType/index.d.ts +8 -11
- package/models/seriesType/index.js +6 -0
- package/modern/BarChart/BarChart.js +2 -2
- package/modern/BarChart/BarPlot.js +2 -2
- package/modern/BarChart/formatter.js +1 -1
- package/modern/BarChart/getColor.js +4 -4
- package/modern/BarChart/plugin.js +10 -0
- package/modern/ChartContainer/ChartContainer.js +71 -23
- package/modern/ChartContainer/defaultPlugins.js +5 -0
- package/modern/ChartContainer/usePluginsMerge.js +31 -0
- package/modern/ChartsLegend/ChartsLegend.js +2 -2
- package/modern/ChartsLegend/utils.js +4 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/modern/ChartsText/ChartsText.js +1 -3
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -14
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +5 -4
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsTooltip/utils.js +2 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/modern/ChartsXAxis/ChartsXAxis.js +17 -19
- package/modern/ChartsYAxis/ChartsYAxis.js +17 -19
- package/modern/LineChart/AreaPlot.js +2 -2
- package/modern/LineChart/LineChart.js +3 -3
- package/modern/LineChart/LineHighlightPlot.js +2 -2
- package/modern/LineChart/LinePlot.js +2 -2
- package/modern/LineChart/MarkPlot.js +2 -2
- package/modern/LineChart/formatter.js +1 -1
- package/modern/LineChart/getColor.js +2 -2
- package/modern/LineChart/plugin.js +10 -0
- package/modern/PieChart/PieChart.js +3 -3
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/PieChart/plugin.js +7 -0
- package/modern/ResponsiveChartContainer/ResizableContainer.js +26 -0
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +31 -23
- package/modern/ScatterChart/ScatterChart.js +3 -3
- package/modern/ScatterChart/ScatterPlot.js +2 -2
- package/modern/ScatterChart/formatter.js +1 -1
- package/modern/ScatterChart/getColor.js +2 -2
- package/modern/ScatterChart/plugin.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +58 -2
- package/modern/context/CartesianContextProvider.js +7 -20
- package/modern/context/ColorProvider.js +16 -0
- package/modern/context/DrawingProvider.js +9 -2
- package/modern/context/HighlightedProvider/HighlightedContext.js +8 -5
- package/modern/context/HighlightedProvider/HighlightedProvider.js +15 -12
- package/modern/context/HighlightedProvider/useHighlighted.js +6 -3
- package/modern/context/HighlightedProvider/useItemHighlighted.js +2 -6
- package/modern/context/SeriesContextProvider.js +14 -17
- package/modern/context/context.types.js +1 -0
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useColor.js +9 -0
- package/modern/hooks/useColorScale.js +27 -0
- package/modern/hooks/useInteractionItemProps.js +2 -2
- package/modern/hooks/useReducedMotion.js +7 -0
- package/modern/hooks/useSeries.js +6 -3
- package/modern/hooks/useSvgRef.js +6 -3
- package/modern/index.js +1 -1
- package/modern/internals/configInit.js +20 -0
- package/modern/internals/defaultizeValueFormatter.js +2 -3
- package/modern/internals/index.js +27 -0
- package/modern/internals/isCartesian.js +7 -0
- package/modern/internals/warning.js +13 -0
- package/modern/models/index.js +1 -0
- package/modern/models/plugin.js +1 -0
- package/modern/models/seriesType/index.js +6 -0
- package/package.json +2 -2
- package/themeAugmentation/components.d.ts +12 -12
- package/esm/internals/colorGetter.js +0 -22
- package/internals/colorGetter.d.ts +0 -7
- package/internals/colorGetter.js +0 -29
- package/modern/internals/colorGetter.js +0 -22
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLege
|
|
|
15
15
|
}
|
|
16
16
|
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps {
|
|
17
17
|
}
|
|
18
|
-
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
18
|
+
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
19
19
|
/**
|
|
20
20
|
* The series to display in the bar chart.
|
|
21
21
|
* An array of [[BarSeriesType]] objects.
|
package/BarChart/BarChart.js
CHANGED
|
@@ -360,7 +360,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
360
360
|
labelStyle: _propTypes.default.object,
|
|
361
361
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
362
362
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
363
|
-
position: _propTypes.default.oneOf(['bottom', '
|
|
363
|
+
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
364
364
|
reverse: _propTypes.default.bool,
|
|
365
365
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
366
366
|
slotProps: _propTypes.default.object,
|
|
@@ -413,7 +413,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
413
413
|
labelStyle: _propTypes.default.object,
|
|
414
414
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
415
415
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
416
|
-
position: _propTypes.default.oneOf(['
|
|
416
|
+
position: _propTypes.default.oneOf(['left', 'right']),
|
|
417
417
|
reverse: _propTypes.default.bool,
|
|
418
418
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
419
419
|
slotProps: _propTypes.default.object,
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _web = require("@react-spring/web");
|
|
13
|
-
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
14
13
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
15
14
|
var _BarElement = require("./BarElement");
|
|
16
15
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
@@ -18,6 +17,7 @@ var _hooks = require("../hooks");
|
|
|
18
17
|
var _BarClipPath = require("./BarClipPath");
|
|
19
18
|
var _BarLabelPlot = require("./BarLabel/BarLabelPlot");
|
|
20
19
|
var _checkScaleErrors = require("./checkScaleErrors");
|
|
20
|
+
var _useSeries = require("../hooks/useSeries");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
|
|
23
23
|
/**
|
|
@@ -50,7 +50,7 @@ function getBandSize({
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const useAggregatedData = () => {
|
|
53
|
-
const seriesData =
|
|
53
|
+
const seriesData = (0, _useSeries.useBarSeries)() ?? {
|
|
54
54
|
series: {},
|
|
55
55
|
stackingGroups: [],
|
|
56
56
|
seriesOrder: []
|
package/BarChart/formatter.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _d3Shape = require("d3-shape");
|
|
10
10
|
var _stackSeries = require("../internals/stackSeries");
|
|
11
|
-
var _defaultizeValueFormatter =
|
|
11
|
+
var _defaultizeValueFormatter = require("../internals/defaultizeValueFormatter");
|
|
12
12
|
let warnOnce = false;
|
|
13
13
|
const formatter = (params, dataset) => {
|
|
14
14
|
const {
|
|
@@ -72,7 +72,7 @@ const formatter = (params, dataset) => {
|
|
|
72
72
|
return {
|
|
73
73
|
seriesOrder,
|
|
74
74
|
stackingGroups,
|
|
75
|
-
series: (0, _defaultizeValueFormatter.
|
|
75
|
+
series: (0, _defaultizeValueFormatter.defaultizeValueFormatter)(completedSeries, v => v == null ? '' : v.toLocaleString())
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
var _default = exports.default = formatter;
|
package/BarChart/getColor.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AxisDefaultized } from '../models/axis';
|
|
2
2
|
import { DefaultizedBarSeriesType } from '../models/seriesType/bar';
|
|
3
|
-
export default function getColor(series: DefaultizedBarSeriesType, xAxis
|
|
3
|
+
export default function getColor(series: DefaultizedBarSeriesType, xAxis?: AxisDefaultized, yAxis?: AxisDefaultized): (dataIndex: number) => string;
|
package/BarChart/getColor.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = getColor;
|
|
7
7
|
function getColor(series, xAxis, yAxis) {
|
|
8
8
|
const verticalLayout = series.layout === 'vertical';
|
|
9
|
-
const bandColorScale = verticalLayout ? xAxis
|
|
10
|
-
const valueColorScale = verticalLayout ? yAxis
|
|
11
|
-
const bandValues = verticalLayout ? xAxis
|
|
9
|
+
const bandColorScale = verticalLayout ? xAxis?.colorScale : yAxis?.colorScale;
|
|
10
|
+
const valueColorScale = verticalLayout ? yAxis?.colorScale : xAxis?.colorScale;
|
|
11
|
+
const bandValues = verticalLayout ? xAxis?.data : yAxis?.data;
|
|
12
12
|
if (valueColorScale) {
|
|
13
13
|
return dataIndex => {
|
|
14
14
|
const value = series.data[dataIndex];
|
|
@@ -19,7 +19,7 @@ function getColor(series, xAxis, yAxis) {
|
|
|
19
19
|
return color;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
if (bandColorScale) {
|
|
22
|
+
if (bandColorScale && bandValues) {
|
|
23
23
|
return dataIndex => {
|
|
24
24
|
const value = bandValues[dataIndex];
|
|
25
25
|
const color = value === null ? series.color : bandColorScale(value);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.plugin = void 0;
|
|
8
|
+
var _extremums = require("./extremums");
|
|
9
|
+
var _formatter = _interopRequireDefault(require("./formatter"));
|
|
10
|
+
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
11
|
+
const plugin = exports.plugin = {
|
|
12
|
+
seriesType: 'bar',
|
|
13
|
+
seriesFormatter: _formatter.default,
|
|
14
|
+
colorProcessor: _getColor.default,
|
|
15
|
+
xExtremumGetter: _extremums.getExtremumX,
|
|
16
|
+
yExtremumGetter: _extremums.getExtremumY
|
|
17
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,153 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.7.0
|
|
7
|
+
|
|
8
|
+
_Jun 13, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Allow customization of the Pickers month and the year buttons
|
|
13
|
+
- 🌍 Improve Persian (fa-IR), Portuguese (pt-PT), and Russian (ru-RU) locales on the Data Grid
|
|
14
|
+
- 🌍 Improve Korean (ko-KR) and Persian (fa-IR) locales on the Date and Time Pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@7.7.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Add `getFilterState` method (#13418) @cherniavskii
|
|
25
|
+
- [DataGrid] Do not show resize separators for column groups (#13455) @cherniavskii
|
|
26
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
27
|
+
- [l10n] Improve Portuguese (pt-PT) locale (#13384) @olavocarvalho
|
|
28
|
+
- [l10n] Improve Russian (ru-RU) locale (#11210) @dastan-akhmetov-scity
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@7.7.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Do not render detail panel if the focused cell is not visible (#13456) @cherniavskii
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-premium@7.7.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid-pro@7.7.0`.
|
|
39
|
+
|
|
40
|
+
### Date and Time Pickers
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers@7.7.0`
|
|
43
|
+
|
|
44
|
+
- [l10n] Improve Korean (ko-KR) locale (#13452) @ryxxn
|
|
45
|
+
- [l10n] Improve Persian (fa-IR) locale (#13402) @fakhamatia
|
|
46
|
+
- [pickers] Allow to customize the month and the year buttons (#13321) @flaviendelangle
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@7.7.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@7.7.0`.
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@7.7.0`
|
|
55
|
+
|
|
56
|
+
- [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
|
|
57
|
+
- [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
|
|
58
|
+
- [charts] Fix eslint for react compiler (#13444) @alexfauquette
|
|
59
|
+
- [charts] Improve themeAugmentation typing (#13433) @noraleonte
|
|
60
|
+
- [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
|
|
61
|
+
- [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@7.7.0`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Improve TypeScript for plugins (#13380) @flaviendelangle
|
|
68
|
+
- [TreeView] Improve the typing of the cancelable events (#13152) @flaviendelangle
|
|
69
|
+
- [TreeView] Prepare support for PigmentCSS (#13412) @flaviendelangle
|
|
70
|
+
- [TreeView] Refactor the tree view internals to prepare for headless API (#13311) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Add `renderHeader` recipe to the Master Details docs (#13370) @michelengelen
|
|
75
|
+
- [docs] Add lazy loading detail panel demo (#13453) @cherniavskii
|
|
76
|
+
- [docs] Add small edits to the Data Grid overview page (#13060) @danilo-leal
|
|
77
|
+
- [docs] Update a11y pages description (#13417) @danilo-leal
|
|
78
|
+
- [docs] improve the writing on the "Quick filter outside of the grid" example (#13155) @michelengelen
|
|
79
|
+
|
|
80
|
+
### Core
|
|
81
|
+
|
|
82
|
+
- [core] Add `eslint-plugin-react-compiler` experimental version and rules (#13415) @JCQuintas
|
|
83
|
+
- [core] Minor setup cleanup (#13467) @LukasTy
|
|
84
|
+
- [infra] Adjust CI setup (#13448) @LukasTy
|
|
85
|
+
- [test] Add tests for the custom slots of `TreeItem2` (#13314) @flaviendelangle
|
|
86
|
+
|
|
87
|
+
## 7.6.2
|
|
88
|
+
|
|
89
|
+
_Jun 6, 2024_
|
|
90
|
+
|
|
91
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
92
|
+
|
|
93
|
+
- 📚 Adds Date and Time Pickers accessibility page
|
|
94
|
+
- 🐞 Bugfixes
|
|
95
|
+
- 📚 Documentation improvements
|
|
96
|
+
|
|
97
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
98
|
+
|
|
99
|
+
### Data Grid
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-data-grid@7.6.2`
|
|
102
|
+
|
|
103
|
+
- [DataGrid] Add the `areElementSizesEqual` utility to improve code readability (#13254) @layerok
|
|
104
|
+
- [DataGrid] Clean up IE remnants from the codebase (#13390) @MBilalShafi
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
107
|
+
|
|
108
|
+
Same changes as in `@mui/x-data-grid@7.6.2`.
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid-premium@7.6.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-data-grid-pro@7.6.2`.
|
|
113
|
+
|
|
114
|
+
### Date and Time Pickers
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers@7.6.2`
|
|
117
|
+
|
|
118
|
+
- [fields] Fix `PageUp` and `PageDown` editing on letter sections (#13310) @arthurbalduini
|
|
119
|
+
- [pickers] Fix `AdapterDayjs` timezone behavior (#13362) @LukasTy
|
|
120
|
+
- [pickers] Use `useRtl` instead of `useTheme` to access direction (#13363) @flaviendelangle
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-date-pickers-pro@7.6.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
123
|
+
|
|
124
|
+
Same changes as in `@mui/x-date-pickers@7.6.2`.
|
|
125
|
+
|
|
126
|
+
### Charts
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-charts@7.6.2`
|
|
129
|
+
|
|
130
|
+
- [charts] Add `Initializable` type and behaviour to allow checking if a complex context has been initialized. (#13365) @JCQuintas
|
|
131
|
+
- [charts] Fix some props not working in `xAxis` and `yAxis` (#13372) @Valyok26
|
|
132
|
+
- [charts] Harmonize charts types (#13366) @alexfauquette
|
|
133
|
+
- [charts] Introduce plugins system (#13367) @alexfauquette
|
|
134
|
+
- [charts] Simplify plugin types (#13396) @JCQuintas
|
|
135
|
+
|
|
136
|
+
### Docs
|
|
137
|
+
|
|
138
|
+
- [docs] Add badges like in Material UI @oliviertassinari
|
|
139
|
+
- [docs] Update twitter.com to x.com @oliviertassinari
|
|
140
|
+
- [docs] Fix the description of `tickInterval` (#13355) @alexfauquette
|
|
141
|
+
- [docs] Adjust the code example for `quickFilterValues` (#12919) @michelengelen
|
|
142
|
+
- [docs] Create Pickers accessibility page (#13274) @arthurbalduini
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Comment on `CSS.escape` for the future @oliviertassinari
|
|
147
|
+
- [core] Fix `l10n` action setup (#13382) @LukasTy
|
|
148
|
+
- [core] Fixes in preparation for React 18.3 (#13378) @LukasTy
|
|
149
|
+
- [core] Remove explicit `marked` dependency (#13383) @LukasTy
|
|
150
|
+
- [core] Remove unused `@types/prettier` dependency (#13389) @LukasTy
|
|
151
|
+
- [core] Add `docs/.env.local` to `.gitignore` (#13377) @KenanYusuf
|
|
152
|
+
|
|
6
153
|
## 7.6.1
|
|
7
154
|
|
|
8
155
|
_May 31, 2024_
|
|
@@ -3,11 +3,23 @@ import { DrawingProviderProps } from '../context/DrawingProvider';
|
|
|
3
3
|
import { SeriesContextProviderProps } from '../context/SeriesContextProvider';
|
|
4
4
|
import { ChartsSurfaceProps } from '../ChartsSurface';
|
|
5
5
|
import { CartesianContextProviderProps } from '../context/CartesianContextProvider';
|
|
6
|
-
import { HighlightedProviderProps } from '../context';
|
|
7
|
-
|
|
6
|
+
import { HighlightedProviderProps, ZAxisContextProviderProps } from '../context';
|
|
7
|
+
import { ChartsPluginType } from '../models/plugin';
|
|
8
|
+
import { ChartSeriesType } from '../models/seriesType/config';
|
|
9
|
+
export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, 'seriesFormatters'> & Omit<DrawingProviderProps, 'svgRef'> & Omit<CartesianContextProviderProps, 'xExtremumGetters' | 'yExtremumGetters'> & ZAxisContextProviderProps & HighlightedProviderProps, 'children'> & {
|
|
8
10
|
children?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* An array of plugins defining how to preprocess data.
|
|
13
|
+
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
14
|
+
*/
|
|
15
|
+
plugins?: ChartsPluginType<ChartSeriesType>[];
|
|
9
16
|
};
|
|
10
|
-
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & SeriesContextProviderProps & Omit<DrawingProviderProps, "svgRef"> & CartesianContextProviderProps & HighlightedProviderProps, "children"> & {
|
|
17
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> & Omit<CartesianContextProviderProps, "xExtremumGetters" | "yExtremumGetters"> & ZAxisContextProviderProps & HighlightedProviderProps, "children"> & {
|
|
11
18
|
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* An array of plugins defining how to preprocess data.
|
|
21
|
+
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
22
|
+
*/
|
|
23
|
+
plugins?: ChartsPluginType<keyof import("../models/seriesType/config").ChartsSeriesConfig>[] | undefined;
|
|
12
24
|
} & React.RefAttributes<unknown>>;
|
|
13
25
|
export { ChartContainer };
|
|
@@ -11,11 +11,13 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
|
11
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
12
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
13
13
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
14
|
+
var _ColorProvider = require("../context/ColorProvider");
|
|
14
15
|
var _useReducedMotion = require("../hooks/useReducedMotion");
|
|
15
16
|
var _ChartsSurface = require("../ChartsSurface");
|
|
16
17
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
17
18
|
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
18
19
|
var _context = require("../context");
|
|
20
|
+
var _usePluginsMerge = require("./usePluginsMerge");
|
|
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
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; }
|
|
@@ -27,6 +29,7 @@ const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(fu
|
|
|
27
29
|
margin,
|
|
28
30
|
xAxis,
|
|
29
31
|
yAxis,
|
|
32
|
+
zAxis,
|
|
30
33
|
colors,
|
|
31
34
|
dataset,
|
|
32
35
|
sx,
|
|
@@ -35,10 +38,17 @@ const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(fu
|
|
|
35
38
|
disableAxisListener,
|
|
36
39
|
highlightedItem,
|
|
37
40
|
onHighlightChange,
|
|
41
|
+
plugins,
|
|
38
42
|
children
|
|
39
43
|
} = props;
|
|
40
44
|
const svgRef = React.useRef(null);
|
|
41
45
|
const handleRef = (0, _useForkRef.default)(ref, svgRef);
|
|
46
|
+
const {
|
|
47
|
+
xExtremumGetters,
|
|
48
|
+
yExtremumGetters,
|
|
49
|
+
seriesFormatters,
|
|
50
|
+
colorProcessors
|
|
51
|
+
} = (0, _usePluginsMerge.usePluginsMerge)(plugins);
|
|
42
52
|
(0, _useReducedMotion.useReducedMotion)(); // a11y reduce motion (see: https://react-spring.dev/docs/utilities/use-reduced-motion)
|
|
43
53
|
|
|
44
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, {
|
|
@@ -46,27 +56,37 @@ const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(fu
|
|
|
46
56
|
height: height,
|
|
47
57
|
margin: margin,
|
|
48
58
|
svgRef: svgRef,
|
|
49
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
xAxis: xAxis,
|
|
55
|
-
yAxis: yAxis,
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorProvider.ColorProvider, {
|
|
60
|
+
colorProcessors: colorProcessors,
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, {
|
|
62
|
+
series: series,
|
|
63
|
+
colors: colors,
|
|
56
64
|
dataset: dataset,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
seriesFormatters: seriesFormatters,
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianContextProvider.CartesianContextProvider, {
|
|
67
|
+
xAxis: xAxis,
|
|
68
|
+
yAxis: yAxis,
|
|
69
|
+
dataset: dataset,
|
|
70
|
+
xExtremumGetters: xExtremumGetters,
|
|
71
|
+
yExtremumGetters: yExtremumGetters,
|
|
72
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, {
|
|
73
|
+
zAxis: zAxis,
|
|
74
|
+
dataset: dataset,
|
|
75
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InteractionProvider.InteractionProvider, {
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, {
|
|
77
|
+
highlightedItem: highlightedItem,
|
|
78
|
+
onHighlightChange: onHighlightChange,
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, {
|
|
80
|
+
width: width,
|
|
81
|
+
height: height,
|
|
82
|
+
ref: handleRef,
|
|
83
|
+
sx: sx,
|
|
84
|
+
title: title,
|
|
85
|
+
desc: desc,
|
|
86
|
+
disableAxisListener: disableAxisListener,
|
|
87
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxesGradients.ChartsAxesGradients, {}), children]
|
|
88
|
+
})
|
|
89
|
+
})
|
|
70
90
|
})
|
|
71
91
|
})
|
|
72
92
|
})
|
|
@@ -126,6 +146,11 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
126
146
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
127
147
|
*/
|
|
128
148
|
onHighlightChange: _propTypes.default.func,
|
|
149
|
+
/**
|
|
150
|
+
* An array of plugins defining how to preprocess data.
|
|
151
|
+
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
152
|
+
*/
|
|
153
|
+
plugins: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
129
154
|
/**
|
|
130
155
|
* The array of series to display.
|
|
131
156
|
* Each type of series has its own specificity.
|
|
@@ -179,7 +204,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
179
204
|
labelStyle: _propTypes.default.object,
|
|
180
205
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
181
206
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
182
|
-
position: _propTypes.default.oneOf(['bottom', '
|
|
207
|
+
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
183
208
|
reverse: _propTypes.default.bool,
|
|
184
209
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
185
210
|
slotProps: _propTypes.default.object,
|
|
@@ -232,7 +257,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
232
257
|
labelStyle: _propTypes.default.object,
|
|
233
258
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
234
259
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
235
|
-
position: _propTypes.default.oneOf(['
|
|
260
|
+
position: _propTypes.default.oneOf(['left', 'right']),
|
|
236
261
|
reverse: _propTypes.default.bool,
|
|
237
262
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
238
263
|
slotProps: _propTypes.default.object,
|
|
@@ -249,5 +274,28 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
249
274
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
250
275
|
tickSize: _propTypes.default.number,
|
|
251
276
|
valueFormatter: _propTypes.default.func
|
|
277
|
+
})),
|
|
278
|
+
/**
|
|
279
|
+
* The configuration of the z-axes.
|
|
280
|
+
*/
|
|
281
|
+
zAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
282
|
+
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
283
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
284
|
+
type: _propTypes.default.oneOf(['ordinal']).isRequired,
|
|
285
|
+
unknownColor: _propTypes.default.string,
|
|
286
|
+
values: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired)
|
|
287
|
+
}), _propTypes.default.shape({
|
|
288
|
+
color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
|
|
289
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
290
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
291
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
292
|
+
}), _propTypes.default.shape({
|
|
293
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
294
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
295
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
296
|
+
})]),
|
|
297
|
+
data: _propTypes.default.array,
|
|
298
|
+
dataKey: _propTypes.default.string,
|
|
299
|
+
id: _propTypes.default.string
|
|
252
300
|
}))
|
|
253
301
|
} : void 0;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultPlugins = void 0;
|
|
7
|
+
var _plugin = require("../BarChart/plugin");
|
|
8
|
+
var _plugin2 = require("../ScatterChart/plugin");
|
|
9
|
+
var _plugin3 = require("../LineChart/plugin");
|
|
10
|
+
var _plugin4 = require("../PieChart/plugin");
|
|
11
|
+
const defaultPlugins = exports.defaultPlugins = [_plugin.plugin, _plugin2.plugin, _plugin3.plugin, _plugin4.plugin];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChartsPluginType, ColorProcessorsConfig } from '../models';
|
|
2
|
+
import { ChartSeriesType } from '../models/seriesType/config';
|
|
3
|
+
import { ExtremumGettersConfig } from '../context/CartesianContextProvider';
|
|
4
|
+
import { SeriesFormatterConfig } from '../context/SeriesContextProvider';
|
|
5
|
+
export declare function usePluginsMerge<T extends ChartSeriesType>(plugins?: ChartsPluginType<T>[]): {
|
|
6
|
+
seriesFormatters: SeriesFormatterConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
7
|
+
colorProcessors: ColorProcessorsConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
8
|
+
xExtremumGetters: ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
9
|
+
yExtremumGetters: ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePluginsMerge = usePluginsMerge;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _defaultPlugins = require("./defaultPlugins");
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function usePluginsMerge(plugins) {
|
|
12
|
+
const defaultizedPlugins = plugins ?? _defaultPlugins.defaultPlugins;
|
|
13
|
+
return React.useMemo(() => {
|
|
14
|
+
const seriesFormatters = {};
|
|
15
|
+
const colorProcessors = {};
|
|
16
|
+
const xExtremumGetters = {};
|
|
17
|
+
const yExtremumGetters = {};
|
|
18
|
+
for (let i = 0; i < defaultizedPlugins.length; i += 1) {
|
|
19
|
+
const plugin = defaultizedPlugins[i];
|
|
20
|
+
|
|
21
|
+
// To remove those any we will need to solve this union discrimination issue:
|
|
22
|
+
// https://www.typescriptlang.org/play/?#code/FDAuE8AcFMAIDkCuBbARtATgYQPYDsAzASwHNYBeWAb2FlgGsi8ATALlgHI8V0MOBuWrBwwMAQ1A4M7ABQAPdtzSYAlBQB8sJb0EBfEBBiwAyqAxMSuQqQrUhjFuw4BnMxYFCRmCVNkLYruZ4JGrkmoEWeiAAxviuWqhWxCTsSMrY+Mm2VAxMbLAARNqYBQA0wqI+0rByGrAATLAAVDWw+rF48YFJpOymQZaZNpQ5DvkFEcFlFd6S1bVhsAAG9S0AJFRyukttMXGgsB3JzrYA2niJQyTl3VcAugZQcADylXPOALJikJAW2ULFDAAflSPEwPRIpw4XnEcw4d1KQkmJBBJjcwQhUJhVXhiN0gmAHXi2LmXx+FnYr1mUk+31+wWy+JABCksBkABtoAcjjYcARDldnGoaCA6AB6MWwADqUnoJxw9FgRH5AHc4L9ooroGJogALQ5iZxwPJEABuRGYiDE7PASJVRFAerZPJIADoxsKhHRooa4FwwXxWF66DNYVIyfTIS73Xk7rZoySpIIQyHUBhtfRkyGfUbOMiOEGU3RExgIxZTtGxnHKAm3kng8xoAQxIh2aBC0W0xms-pvftqLkWOUS2141chBLYABJDimuB4HBKxtiWBiVA4RAHXU4FWwSSwTkHAAqxlgiBYmFcYhYAusbrGq5vtepGFX6YPTHo0GYnjrpbp5ZVrYJZ6EAA
|
|
23
|
+
seriesFormatters[plugin.seriesType] = plugin.seriesFormatter;
|
|
24
|
+
colorProcessors[plugin.seriesType] = plugin.colorProcessor;
|
|
25
|
+
if (plugin.xExtremumGetter) {
|
|
26
|
+
xExtremumGetters[plugin.seriesType] = plugin.xExtremumGetter;
|
|
27
|
+
}
|
|
28
|
+
if (plugin.yExtremumGetter) {
|
|
29
|
+
yExtremumGetters[plugin.seriesType] = plugin.yExtremumGetter;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
seriesFormatters,
|
|
34
|
+
colorProcessors,
|
|
35
|
+
xExtremumGetters,
|
|
36
|
+
yExtremumGetters
|
|
37
|
+
};
|
|
38
|
+
}, [defaultizedPlugins]);
|
|
39
|
+
}
|
|
@@ -12,10 +12,10 @@ var _utils = require("@mui/base/utils");
|
|
|
12
12
|
var _utils2 = require("@mui/utils");
|
|
13
13
|
var _styles = require("@mui/material/styles");
|
|
14
14
|
var _utils3 = require("./utils");
|
|
15
|
-
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
16
15
|
var _chartsLegendClasses = require("./chartsLegendClasses");
|
|
17
16
|
var _DefaultChartsLegend = require("./DefaultChartsLegend");
|
|
18
17
|
var _hooks = require("../hooks");
|
|
18
|
+
var _useSeries = require("../hooks/useSeries");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
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
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 && {}.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; }
|
|
@@ -56,7 +56,7 @@ function ChartsLegend(inProps) {
|
|
|
56
56
|
theme
|
|
57
57
|
}));
|
|
58
58
|
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
59
|
-
const series =
|
|
59
|
+
const series = (0, _useSeries.useSeries)();
|
|
60
60
|
const seriesToDisplay = (0, _utils3.getSeriesToDisplay)(series);
|
|
61
61
|
const ChartLegendRender = slots?.legend ?? _DefaultChartsLegend.DefaultChartsLegend;
|
|
62
62
|
const chartLegendRenderProps = (0, _utils.useSlotProps)({
|
package/ChartsLegend/utils.js
CHANGED
|
@@ -16,5 +16,8 @@ const legendGetter = {
|
|
|
16
16
|
pie: _legend4.default
|
|
17
17
|
};
|
|
18
18
|
function getSeriesToDisplay(series) {
|
|
19
|
-
return Object.keys(series).flatMap(seriesType =>
|
|
19
|
+
return Object.keys(series).flatMap(seriesType => {
|
|
20
|
+
const getter = legendGetter[seriesType];
|
|
21
|
+
return getter === undefined ? [] : getter(series[seriesType]);
|
|
22
|
+
});
|
|
20
23
|
}
|
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ChartsOnAxisClickHandler = ChartsOnAxisClickHandler;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _DrawingProvider = require("../context/DrawingProvider");
|
|
11
10
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
12
11
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
13
|
-
var
|
|
12
|
+
var _useSeries = require("../hooks/useSeries");
|
|
13
|
+
var _hooks = require("../hooks");
|
|
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
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; }
|
|
@@ -18,8 +18,8 @@ function ChartsOnAxisClickHandler(props) {
|
|
|
18
18
|
const {
|
|
19
19
|
onAxisClick
|
|
20
20
|
} = props;
|
|
21
|
-
const svgRef =
|
|
22
|
-
const series =
|
|
21
|
+
const svgRef = (0, _hooks.useSvgRef)();
|
|
22
|
+
const series = (0, _useSeries.useSeries)();
|
|
23
23
|
const {
|
|
24
24
|
axis
|
|
25
25
|
} = React.useContext(_InteractionProvider.InteractionContext);
|
package/ChartsOverlay/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ChartsOverlay } from './ChartsOverlay';
|
|
2
|
+
export type { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots, } from './ChartsOverlay';
|
|
2
3
|
export { ChartsLoadingOverlay } from './ChartsLoadingOverlay';
|
|
3
4
|
export { ChartsNoDataOverlay } from './ChartsNoDataOverlay';
|
|
@@ -13,6 +13,7 @@ var _hooks = require("../hooks");
|
|
|
13
13
|
var _common = require("./common");
|
|
14
14
|
var _ChartsText = require("../ChartsText");
|
|
15
15
|
var _chartsReferenceLineClasses = require("./chartsReferenceLineClasses");
|
|
16
|
+
var _warning = require("../internals/warning");
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
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
19
|
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; }
|
|
@@ -56,7 +57,7 @@ function getXReferenceLineClasses(classes) {
|
|
|
56
57
|
label: ['label']
|
|
57
58
|
}, _chartsReferenceLineClasses.getReferenceLineUtilityClass, classes);
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
const valueError = (0, _warning.buildWarning)((value, id) => `MUI X Charts: the value ${value} does not exist in the data of x axis with id ${id}.`, 'error');
|
|
60
61
|
function ChartsXReferenceLine(props) {
|
|
61
62
|
const {
|
|
62
63
|
x,
|
|
@@ -76,10 +77,7 @@ function ChartsXReferenceLine(props) {
|
|
|
76
77
|
const xPosition = xAxisScale(x);
|
|
77
78
|
if (xPosition === undefined) {
|
|
78
79
|
if (process.env.NODE_ENV !== 'production') {
|
|
79
|
-
|
|
80
|
-
warnedOnce = true;
|
|
81
|
-
console.error(`MUI X Charts: the value ${x} does not exist in the data of x axis with id ${axisId}.`);
|
|
82
|
-
}
|
|
80
|
+
valueError(x, axisId);
|
|
83
81
|
}
|
|
84
82
|
return null;
|
|
85
83
|
}
|