@mui/x-charts 7.10.0 → 7.11.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 +2 -2
- package/BarChart/BarElement.d.ts +2 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +2 -1
- package/BarChart/BarPlot.js +8 -8
- package/BarChart/checkScaleErrors.d.ts +4 -4
- package/BarChart/checkScaleErrors.js +11 -11
- package/BarChart/extremums.js +4 -1
- package/BarChart/formatter.js +2 -2
- package/BarChart/useBarChartProps.js +38 -33
- package/CHANGELOG.md +169 -0
- package/ChartContainer/ChartContainer.d.ts +28 -2
- package/ChartContainer/ChartContainer.js +25 -66
- package/ChartContainer/useChartContainerHooks.d.ts +1 -1
- package/ChartContainer/useChartContainerHooks.js +2 -2
- package/ChartContainer/useChartContainerProps.d.ts +86 -0
- package/ChartContainer/useChartContainerProps.js +95 -0
- package/ChartContainer/useDefaultizeAxis.d.ts +36 -0
- package/ChartContainer/useDefaultizeAxis.js +29 -0
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsLegend/ChartsLegend.d.ts +3 -12
- package/ChartsLegend/ContinuousColorLegend.d.ts +65 -0
- package/ChartsLegend/ContinuousColorLegend.js +398 -0
- package/ChartsLegend/DefaultChartsLegend.d.ts +7 -50
- package/ChartsLegend/DefaultChartsLegend.js +13 -198
- package/ChartsLegend/LegendPerItem.d.ts +61 -0
- package/ChartsLegend/LegendPerItem.js +151 -0
- package/ChartsLegend/PiecewiseColorLegend.d.ts +26 -0
- package/ChartsLegend/PiecewiseColorLegend.js +169 -0
- package/ChartsLegend/chartsLegend.types.d.ts +31 -0
- package/ChartsLegend/chartsLegend.types.js +5 -0
- package/ChartsLegend/index.d.ts +2 -0
- package/ChartsLegend/index.js +22 -0
- package/ChartsLegend/legend.types.d.ts +62 -0
- package/ChartsLegend/legend.types.js +5 -0
- package/ChartsLegend/legendItemsPlacement.d.ts +3 -0
- package/ChartsLegend/legendItemsPlacement.js +79 -0
- package/ChartsLegend/useAxis.d.ts +7 -0
- package/ChartsLegend/useAxis.js +47 -0
- package/ChartsLegend/utils.d.ts +1 -8
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
- package/ChartsOverlay/ChartsOverlay.d.ts +3 -2
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
- package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
- package/ChartsSurface.js +3 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
- package/ChartsXAxis/ChartsXAxis.js +1 -1
- package/ChartsYAxis/ChartsYAxis.js +15 -3
- package/Gauge/Gauge.d.ts +1 -4
- package/Gauge/Gauge.js +9 -6
- package/Gauge/GaugeContainer.js +8 -4
- package/Gauge/GaugeProvider.js +9 -9
- package/LineChart/AnimatedArea.js +2 -2
- package/LineChart/AnimatedLine.js +2 -2
- package/LineChart/AreaElement.d.ts +2 -1
- package/LineChart/AreaPlot.js +10 -6
- package/LineChart/LineChart.js +5 -2
- package/LineChart/LineElement.d.ts +2 -1
- package/LineChart/LineHighlightPlot.d.ts +2 -1
- package/LineChart/LineHighlightPlot.js +17 -5
- package/LineChart/LinePlot.js +10 -6
- package/LineChart/MarkElement.js +2 -2
- package/LineChart/MarkPlot.js +13 -25
- package/LineChart/extremums.js +4 -1
- package/LineChart/formatter.js +2 -2
- package/LineChart/useLineChartProps.js +38 -33
- package/PieChart/PieArc.js +1 -0
- package/PieChart/PieChart.d.ts +1 -4
- package/PieChart/PieChart.js +40 -34
- package/PieChart/PiePlot.js +6 -6
- package/PieChart/getPieCoordinates.js +3 -3
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +5 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +20 -0
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +73 -0
- package/ScatterChart/Scatter.js +6 -9
- package/ScatterChart/ScatterChart.js +4 -1
- package/ScatterChart/ScatterPlot.js +6 -3
- package/ScatterChart/extremums.js +8 -2
- package/ScatterChart/useScatterChartProps.js +35 -30
- package/SparkLineChart/SparkLineChart.js +27 -22
- package/context/CartesianProvider/CartesianContext.d.ts +1 -1
- package/context/CartesianProvider/CartesianProvider.d.ts +2 -3
- package/context/CartesianProvider/CartesianProvider.js +18 -7
- package/context/CartesianProvider/computeValue.d.ts +32 -9
- package/context/CartesianProvider/computeValue.js +20 -16
- package/context/CartesianProvider/defaultizeAxis.d.ts +36 -0
- package/context/CartesianProvider/defaultizeAxis.js +21 -0
- package/context/CartesianProvider/index.d.ts +0 -1
- package/context/CartesianProvider/index.js +1 -3
- package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
- package/context/CartesianProvider/normalizeAxis.js +2 -2
- package/context/DrawingProvider.d.ts +12 -0
- package/context/DrawingProvider.js +15 -2
- package/context/HighlightedProvider/HighlightedProvider.js +2 -2
- package/context/SeriesContextProvider.js +1 -1
- package/context/ZAxisContextProvider.d.ts +1 -1
- package/context/ZAxisContextProvider.js +1 -1
- package/esm/BarChart/BarChart.js +2 -2
- package/esm/BarChart/BarPlot.js +8 -8
- package/esm/BarChart/checkScaleErrors.js +11 -11
- package/esm/BarChart/extremums.js +4 -1
- package/esm/BarChart/formatter.js +2 -2
- package/esm/BarChart/useBarChartProps.js +38 -33
- package/esm/ChartContainer/ChartContainer.js +25 -66
- package/esm/ChartContainer/useChartContainerHooks.js +2 -2
- package/esm/ChartContainer/useChartContainerProps.js +87 -0
- package/esm/ChartContainer/useDefaultizeAxis.js +19 -0
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/esm/ChartsLegend/ContinuousColorLegend.js +390 -0
- package/esm/ChartsLegend/DefaultChartsLegend.js +14 -198
- package/esm/ChartsLegend/LegendPerItem.js +141 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.js +161 -0
- package/esm/ChartsLegend/chartsLegend.types.js +1 -0
- package/esm/ChartsLegend/index.js +2 -0
- package/esm/ChartsLegend/legend.types.js +1 -0
- package/esm/ChartsLegend/legendItemsPlacement.js +72 -0
- package/esm/ChartsLegend/useAxis.js +39 -0
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
- package/esm/ChartsSurface.js +3 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
- package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +15 -3
- package/esm/Gauge/Gauge.js +8 -5
- package/esm/Gauge/GaugeContainer.js +8 -4
- package/esm/Gauge/GaugeProvider.js +1 -1
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaPlot.js +10 -6
- package/esm/LineChart/LineChart.js +5 -2
- package/esm/LineChart/LineHighlightPlot.js +17 -5
- package/esm/LineChart/LinePlot.js +10 -6
- package/esm/LineChart/MarkElement.js +1 -1
- package/esm/LineChart/MarkPlot.js +12 -24
- package/esm/LineChart/extremums.js +4 -1
- package/esm/LineChart/formatter.js +2 -2
- package/esm/LineChart/useLineChartProps.js +38 -33
- package/esm/PieChart/PieArc.js +1 -0
- package/esm/PieChart/PieChart.js +39 -33
- package/esm/PieChart/PiePlot.js +1 -1
- package/esm/PieChart/getPieCoordinates.js +1 -1
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
- package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
- package/esm/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
- package/esm/ScatterChart/Scatter.js +6 -9
- package/esm/ScatterChart/ScatterChart.js +4 -1
- package/esm/ScatterChart/ScatterPlot.js +6 -3
- package/esm/ScatterChart/extremums.js +8 -2
- package/esm/ScatterChart/useScatterChartProps.js +35 -30
- package/esm/SparkLineChart/SparkLineChart.js +27 -22
- package/esm/context/CartesianProvider/CartesianProvider.js +18 -7
- package/esm/context/CartesianProvider/computeValue.js +20 -16
- package/esm/context/CartesianProvider/defaultizeAxis.js +13 -0
- package/esm/context/CartesianProvider/index.js +1 -3
- package/esm/context/CartesianProvider/normalizeAxis.js +2 -2
- package/esm/context/DrawingProvider.js +15 -2
- package/esm/context/HighlightedProvider/HighlightedProvider.js +2 -2
- package/esm/context/SeriesContextProvider.js +1 -1
- package/esm/context/ZAxisContextProvider.js +1 -1
- package/esm/hooks/useAxisEvents.js +14 -17
- package/esm/hooks/useDrawingArea.js +5 -3
- package/esm/hooks/useReducedMotion.js +4 -2
- package/esm/internals/SlotComponentPropsFromProps.js +1 -0
- package/esm/internals/cleanId.js +6 -0
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
- package/esm/internals/geometry.js +1 -1
- package/esm/internals/{utils.js → getPercentageValue.js} +1 -13
- package/esm/internals/getSymbol.js +5 -0
- package/esm/internals/index.js +3 -1
- package/esm/internals/isDefined.js +3 -0
- package/esm/internals/notNull.js +3 -0
- package/esm/internals/ts-generic.js +1 -0
- package/esm/internals/warning.js +19 -11
- package/hooks/useAxisEvents.js +14 -17
- package/hooks/useDrawingArea.js +5 -3
- package/hooks/useReducedMotion.js +4 -2
- package/index.js +1 -1
- package/internals/SlotComponentPropsFromProps.d.ts +1 -0
- package/internals/SlotComponentPropsFromProps.js +5 -0
- package/internals/cleanId.d.ts +4 -0
- package/internals/cleanId.js +12 -0
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +6 -0
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
- package/internals/defaultizeColor.d.ts +7 -0
- package/internals/geometry.js +1 -1
- package/internals/getPercentageValue.d.ts +7 -0
- package/internals/{utils.js → getPercentageValue.js} +1 -15
- package/internals/getSymbol.d.ts +2 -0
- package/internals/getSymbol.js +11 -0
- package/internals/index.d.ts +3 -1
- package/internals/index.js +25 -5
- package/internals/isDefined.d.ts +1 -0
- package/internals/isDefined.js +9 -0
- package/internals/notNull.d.ts +1 -0
- package/internals/notNull.js +9 -0
- package/internals/ts-generic.d.ts +5 -0
- package/internals/ts-generic.js +5 -0
- package/internals/warning.d.ts +2 -1
- package/internals/warning.js +21 -12
- package/models/axis.d.ts +5 -2
- package/models/helpers.d.ts +1 -0
- package/models/seriesType/common.d.ts +10 -0
- package/models/seriesType/config.d.ts +2 -16
- package/models/seriesType/scatter.d.ts +5 -0
- package/modern/BarChart/BarChart.js +2 -2
- package/modern/BarChart/BarPlot.js +8 -8
- package/modern/BarChart/checkScaleErrors.js +11 -11
- package/modern/BarChart/extremums.js +4 -1
- package/modern/BarChart/formatter.js +2 -2
- package/modern/BarChart/useBarChartProps.js +38 -33
- package/modern/ChartContainer/ChartContainer.js +25 -66
- package/modern/ChartContainer/useChartContainerHooks.js +2 -2
- package/modern/ChartContainer/useChartContainerProps.js +87 -0
- package/modern/ChartContainer/useDefaultizeAxis.js +19 -0
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/modern/ChartsLegend/ContinuousColorLegend.js +390 -0
- package/modern/ChartsLegend/DefaultChartsLegend.js +14 -198
- package/modern/ChartsLegend/LegendPerItem.js +141 -0
- package/modern/ChartsLegend/PiecewiseColorLegend.js +161 -0
- package/modern/ChartsLegend/chartsLegend.types.js +1 -0
- package/modern/ChartsLegend/index.js +2 -0
- package/modern/ChartsLegend/legend.types.js +1 -0
- package/modern/ChartsLegend/legendItemsPlacement.js +72 -0
- package/modern/ChartsLegend/useAxis.js +39 -0
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
- package/modern/ChartsSurface.js +3 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +7 -3
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +4 -4
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +30 -20
- package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +15 -3
- package/modern/Gauge/Gauge.js +8 -5
- package/modern/Gauge/GaugeContainer.js +8 -4
- package/modern/Gauge/GaugeProvider.js +1 -1
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaPlot.js +10 -6
- package/modern/LineChart/LineChart.js +5 -2
- package/modern/LineChart/LineHighlightPlot.js +17 -5
- package/modern/LineChart/LinePlot.js +10 -6
- package/modern/LineChart/MarkElement.js +1 -1
- package/modern/LineChart/MarkPlot.js +12 -24
- package/modern/LineChart/extremums.js +4 -1
- package/modern/LineChart/formatter.js +2 -2
- package/modern/LineChart/useLineChartProps.js +38 -33
- package/modern/PieChart/PieArc.js +1 -0
- package/modern/PieChart/PieChart.js +39 -33
- package/modern/PieChart/PiePlot.js +1 -1
- package/modern/PieChart/getPieCoordinates.js +1 -1
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -20
- package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +8 -4
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +65 -0
- package/modern/ScatterChart/Scatter.js +6 -9
- package/modern/ScatterChart/ScatterChart.js +4 -1
- package/modern/ScatterChart/ScatterPlot.js +6 -3
- package/modern/ScatterChart/extremums.js +8 -2
- package/modern/ScatterChart/useScatterChartProps.js +35 -30
- package/modern/SparkLineChart/SparkLineChart.js +27 -22
- package/modern/context/CartesianProvider/CartesianProvider.js +18 -7
- package/modern/context/CartesianProvider/computeValue.js +20 -16
- package/modern/context/CartesianProvider/defaultizeAxis.js +13 -0
- package/modern/context/CartesianProvider/index.js +1 -3
- package/modern/context/CartesianProvider/normalizeAxis.js +2 -2
- package/modern/context/DrawingProvider.js +15 -2
- package/modern/context/HighlightedProvider/HighlightedProvider.js +2 -2
- package/modern/context/SeriesContextProvider.js +1 -1
- package/modern/context/ZAxisContextProvider.js +1 -1
- package/modern/hooks/useAxisEvents.js +14 -17
- package/modern/hooks/useDrawingArea.js +5 -3
- package/modern/hooks/useReducedMotion.js +4 -2
- package/modern/index.js +1 -1
- package/modern/internals/SlotComponentPropsFromProps.js +1 -0
- package/modern/internals/cleanId.js +6 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -2
- package/modern/internals/geometry.js +1 -1
- package/modern/internals/{utils.js → getPercentageValue.js} +1 -13
- package/modern/internals/getSymbol.js +5 -0
- package/modern/internals/index.js +3 -1
- package/modern/internals/isDefined.js +3 -0
- package/modern/internals/notNull.js +3 -0
- package/modern/internals/ts-generic.js +1 -0
- package/modern/internals/warning.js +19 -11
- package/package.json +4 -4
- package/internals/utils.d.ts +0 -18
package/BarChart/BarChart.js
CHANGED
|
@@ -52,8 +52,8 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
|
|
|
52
52
|
ref: ref
|
|
53
53
|
}, chartContainerProps, {
|
|
54
54
|
children: [props.onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, (0, _extends2.default)({}, axisClickHandlerProps)), props.grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
55
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps))]
|
|
56
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)),
|
|
55
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
|
|
56
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltipProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
59
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
package/BarChart/BarElement.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AnimatedProps } from '@react-spring/web';
|
|
3
|
+
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
|
|
3
4
|
import { SeriesId } from '../models/seriesType/common';
|
|
4
5
|
export interface BarElementClasses {
|
|
5
6
|
/** Styles applied to the root element. */
|
|
@@ -1365,7 +1366,7 @@ export interface BarElementSlots {
|
|
|
1365
1366
|
bar?: React.ElementType<BarProps>;
|
|
1366
1367
|
}
|
|
1367
1368
|
export interface BarElementSlotProps {
|
|
1368
|
-
bar?:
|
|
1369
|
+
bar?: SlotComponentPropsFromProps<BarProps, {}, BarElementOwnerState>;
|
|
1369
1370
|
}
|
|
1370
1371
|
export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.SVGProps<SVGRectElement>, 'ref' | 'id'> & {
|
|
1371
1372
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SlotComponentPropsFromProps } from '../../internals/SlotComponentPropsFromProps';
|
|
2
3
|
import { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
|
|
3
4
|
import { BarLabelProps } from './BarLabel';
|
|
4
5
|
export interface BarLabelSlots {
|
|
@@ -9,7 +10,7 @@ export interface BarLabelSlots {
|
|
|
9
10
|
barLabel?: React.JSXElementConstructor<BarLabelProps>;
|
|
10
11
|
}
|
|
11
12
|
export interface BarLabelSlotProps {
|
|
12
|
-
barLabel?:
|
|
13
|
+
barLabel?: SlotComponentPropsFromProps<BarLabelProps, {}, BarLabelOwnerState>;
|
|
13
14
|
}
|
|
14
15
|
export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighlighted'> & Pick<BarLabelProps, 'style'> & {
|
|
15
16
|
/**
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -74,16 +74,16 @@ const useAggregatedData = () => {
|
|
|
74
74
|
ids: groupIds
|
|
75
75
|
}, groupIndex) => {
|
|
76
76
|
return groupIds.flatMap(seriesId => {
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const xAxisConfig = xAxis[
|
|
80
|
-
const yAxisConfig = yAxis[
|
|
77
|
+
const xAxisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey ?? defaultXAxisId;
|
|
78
|
+
const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey ?? defaultYAxisId;
|
|
79
|
+
const xAxisConfig = xAxis[xAxisId];
|
|
80
|
+
const yAxisConfig = yAxis[yAxisId];
|
|
81
81
|
const verticalLayout = series[seriesId].layout === 'vertical';
|
|
82
|
-
(0, _checkScaleErrors.checkScaleErrors)(verticalLayout, seriesId,
|
|
82
|
+
(0, _checkScaleErrors.checkScaleErrors)(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis);
|
|
83
83
|
const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
84
84
|
const xScale = xAxisConfig.scale;
|
|
85
85
|
const yScale = yAxisConfig.scale;
|
|
86
|
-
const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[
|
|
86
|
+
const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
|
|
87
87
|
const bandWidth = baseScaleConfig.scale.bandwidth();
|
|
88
88
|
const {
|
|
89
89
|
barWidth,
|
|
@@ -106,8 +106,8 @@ const useAggregatedData = () => {
|
|
|
106
106
|
seriesId,
|
|
107
107
|
dataIndex,
|
|
108
108
|
layout: series[seriesId].layout,
|
|
109
|
-
x: verticalLayout ? xScale(xAxis[
|
|
110
|
-
y: verticalLayout ? minValueCoord : yScale(yAxis[
|
|
109
|
+
x: verticalLayout ? xScale(xAxis[xAxisId].data?.[dataIndex]) + barOffset : minValueCoord,
|
|
110
|
+
y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisId].data?.[dataIndex]) + barOffset,
|
|
111
111
|
xOrigin: xScale(0),
|
|
112
112
|
yOrigin: yScale(0),
|
|
113
113
|
height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxisDefaultized, AxisId } from '../models/axis';
|
|
2
2
|
import { SeriesId } from '../models/seriesType/common';
|
|
3
|
-
export declare function checkScaleErrors(verticalLayout: boolean, seriesId: SeriesId,
|
|
4
|
-
[
|
|
5
|
-
},
|
|
6
|
-
[
|
|
3
|
+
export declare function checkScaleErrors(verticalLayout: boolean, seriesId: SeriesId, xAxisId: AxisId, xAxis: {
|
|
4
|
+
[axisId: AxisId]: AxisDefaultized;
|
|
5
|
+
}, yAxisId: AxisId, yAxis: {
|
|
6
|
+
[axisId: AxisId]: AxisDefaultized;
|
|
7
7
|
}): void;
|
|
@@ -6,28 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkScaleErrors = checkScaleErrors;
|
|
7
7
|
var _constants = require("../constants");
|
|
8
8
|
var _axis = require("../models/axis");
|
|
9
|
-
const getAxisMessage = (axisDirection,
|
|
9
|
+
const getAxisMessage = (axisDirection, axisId) => {
|
|
10
10
|
const axisName = `${axisDirection}-axis`;
|
|
11
|
-
const
|
|
11
|
+
const axisIdName = `${axisDirection}Axis`;
|
|
12
12
|
const axisDefaultKey = axisDirection === 'x' ? _constants.DEFAULT_X_AXIS_KEY : _constants.DEFAULT_Y_AXIS_KEY;
|
|
13
|
-
return
|
|
13
|
+
return axisId === axisDefaultKey ? `The first \`${axisIdName}\`` : `The ${axisName} with id "${axisId}"`;
|
|
14
14
|
};
|
|
15
|
-
function checkScaleErrors(verticalLayout, seriesId,
|
|
16
|
-
const xAxisConfig = xAxis[
|
|
17
|
-
const yAxisConfig = yAxis[
|
|
15
|
+
function checkScaleErrors(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis) {
|
|
16
|
+
const xAxisConfig = xAxis[xAxisId];
|
|
17
|
+
const yAxisConfig = yAxis[yAxisId];
|
|
18
18
|
const discreteAxisConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
19
19
|
const continuousAxisConfig = verticalLayout ? yAxisConfig : xAxisConfig;
|
|
20
|
-
const
|
|
21
|
-
const
|
|
20
|
+
const discreteAxisId = verticalLayout ? xAxisId : yAxisId;
|
|
21
|
+
const continuousAxisId = verticalLayout ? yAxisId : xAxisId;
|
|
22
22
|
const discreteAxisDirection = verticalLayout ? 'x' : 'y';
|
|
23
23
|
const continuousAxisDirection = verticalLayout ? 'y' : 'x';
|
|
24
24
|
if (!(0, _axis.isBandScaleConfig)(discreteAxisConfig)) {
|
|
25
|
-
throw new Error(`MUI X
|
|
25
|
+
throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should be of type "band" to display the bar series of id "${seriesId}".`);
|
|
26
26
|
}
|
|
27
27
|
if (discreteAxisConfig.data === undefined) {
|
|
28
|
-
throw new Error(`MUI X
|
|
28
|
+
throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should have data property.`);
|
|
29
29
|
}
|
|
30
30
|
if ((0, _axis.isBandScaleConfig)(continuousAxisConfig) || (0, _axis.isPointScaleConfig)(continuousAxisConfig)) {
|
|
31
|
-
throw new Error(`MUI X
|
|
31
|
+
throw new Error(`MUI X: ${getAxisMessage(continuousAxisDirection, continuousAxisId)} should be a continuous type to display the bar series of id "${seriesId}".`);
|
|
32
32
|
}
|
|
33
33
|
}
|
package/BarChart/extremums.js
CHANGED
|
@@ -18,7 +18,10 @@ const getValueExtremum = params => {
|
|
|
18
18
|
axis,
|
|
19
19
|
isDefaultAxis
|
|
20
20
|
} = params;
|
|
21
|
-
return Object.keys(series).filter(seriesId =>
|
|
21
|
+
return Object.keys(series).filter(seriesId => {
|
|
22
|
+
const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
|
|
23
|
+
return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
|
|
24
|
+
}).reduce((acc, seriesId) => {
|
|
22
25
|
const [seriesMin, seriesMax] = series[seriesId].stackedData?.reduce((seriesAcc, values) => [Math.min(...values, ...(seriesAcc[0] === null ? [] : [seriesAcc[0]])), Math.max(...values, ...(seriesAcc[1] === null ? [] : [seriesAcc[1]]))], series[seriesId].stackedData[0]) ?? [null, null];
|
|
23
26
|
return [acc[0] === null ? seriesMin : Math.min(seriesMin, acc[0]), acc[1] === null ? seriesMax : Math.max(seriesMax, acc[1])];
|
|
24
27
|
}, [null, null]);
|
package/BarChart/formatter.js
CHANGED
|
@@ -32,7 +32,7 @@ const formatter = (params, dataset) => {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
} else if (dataset === undefined) {
|
|
35
|
-
throw new Error([`MUI X
|
|
35
|
+
throw new Error([`MUI X: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
const completedSeries = {};
|
|
@@ -59,7 +59,7 @@ const formatter = (params, dataset) => {
|
|
|
59
59
|
if (typeof value !== 'number') {
|
|
60
60
|
if (process.env.NODE_ENV !== 'production' && !warnOnce && value !== null) {
|
|
61
61
|
warnOnce = true;
|
|
62
|
-
console.error([`MUI
|
|
62
|
+
console.error([`MUI X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.'].join('\n'));
|
|
63
63
|
}
|
|
64
64
|
return 0;
|
|
65
65
|
}
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useBarChartProps = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
10
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
10
11
|
var _constants = require("../constants");
|
|
12
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className"];
|
|
11
13
|
/**
|
|
12
14
|
* A helper function that extracts BarChartProps from the input props
|
|
13
15
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -17,36 +19,38 @@ var _constants = require("../constants");
|
|
|
17
19
|
*/
|
|
18
20
|
const useBarChartProps = props => {
|
|
19
21
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
xAxis,
|
|
23
|
+
yAxis,
|
|
24
|
+
series,
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
margin,
|
|
28
|
+
colors,
|
|
29
|
+
dataset,
|
|
30
|
+
sx,
|
|
31
|
+
tooltip,
|
|
32
|
+
onAxisClick,
|
|
33
|
+
axisHighlight,
|
|
34
|
+
legend,
|
|
35
|
+
grid,
|
|
36
|
+
topAxis,
|
|
37
|
+
leftAxis,
|
|
38
|
+
rightAxis,
|
|
39
|
+
bottomAxis,
|
|
40
|
+
children,
|
|
41
|
+
slots,
|
|
42
|
+
slotProps,
|
|
43
|
+
skipAnimation,
|
|
44
|
+
loading,
|
|
45
|
+
layout,
|
|
46
|
+
onItemClick,
|
|
47
|
+
highlightedItem,
|
|
48
|
+
onHighlightChange,
|
|
49
|
+
borderRadius,
|
|
50
|
+
barLabel,
|
|
51
|
+
className
|
|
52
|
+
} = props,
|
|
53
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
50
54
|
const id = (0, _useId.default)();
|
|
51
55
|
const clipPathId = `${id}-clip-path`;
|
|
52
56
|
const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
|
|
@@ -56,7 +60,7 @@ const useBarChartProps = props => {
|
|
|
56
60
|
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
57
61
|
}, (_, index) => index)
|
|
58
62
|
};
|
|
59
|
-
const chartContainerProps = {
|
|
63
|
+
const chartContainerProps = (0, _extends2.default)({}, rest, {
|
|
60
64
|
series: series.map(s => (0, _extends2.default)({
|
|
61
65
|
type: 'bar'
|
|
62
66
|
}, s, {
|
|
@@ -76,8 +80,9 @@ const useBarChartProps = props => {
|
|
|
76
80
|
sx,
|
|
77
81
|
highlightedItem,
|
|
78
82
|
onHighlightChange,
|
|
79
|
-
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick
|
|
80
|
-
|
|
83
|
+
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
84
|
+
className
|
|
85
|
+
});
|
|
81
86
|
const barPlotProps = {
|
|
82
87
|
onItemClick,
|
|
83
88
|
slots,
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,175 @@
|
|
|
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.11.1
|
|
7
|
+
|
|
8
|
+
_Jul 25, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🔎 Allow `Zoom` to be controllable for charts (#13858) @JCQuintas
|
|
13
|
+
- 🌍 Add Icelandic (is-IS) and Norwegian Nynorsk (nn-NO) locales on the Data Grid
|
|
14
|
+
- 🌍 Improve Norwegian Bokmål (nb-NO) and German (de-DE) locales on the Data Grid
|
|
15
|
+
- 🌍 Add Norwegian Nynorsk (nn-NO) locale on the Date and Time Pickers
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
- 📚 Documentation improvements
|
|
18
|
+
|
|
19
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@7.11.1`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Remove dead code in internal `GridPreferencesPanel` (#13934) @k-rajat19
|
|
26
|
+
- [DataGrid] Do not miss to escape formulas in CSV export (#13888) @arminmeh
|
|
27
|
+
- [l10n] Add Icelandic (is-IS) locale (#13283) @magnimarels
|
|
28
|
+
- [l10n] Add Norwegian nynorsk (nn-NO) locale and improve Norwegian bokmål (nb-NO) locale (#13588) @AnderzL7
|
|
29
|
+
- [l10n] Improve German (de-DE) locale (#13910) @lhilgert9
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@7.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@7.11.1`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@7.11.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid-pro@7.11.1`, plus:
|
|
38
|
+
|
|
39
|
+
- [DataGridPremium] Pass the `api` object to events (#13893) @pcorpet
|
|
40
|
+
- [DataGridPremium] Fix paste to selected cells (#13967) @romgrk
|
|
41
|
+
|
|
42
|
+
### Date and Time Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@7.11.1`
|
|
45
|
+
|
|
46
|
+
- [fields] Prevent keyboard editing when disabled (#13900) @arthurbalduini
|
|
47
|
+
- [l10n] Add Norwegian Nynorsk (nn-NO) locale (#13946) @AnderzL7
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers-pro@7.11.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-date-pickers@7.11.1`.
|
|
52
|
+
|
|
53
|
+
### Charts
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-charts@7.11.1`
|
|
56
|
+
|
|
57
|
+
- [charts] Add `ownerState` function to `slotProps` typing when available (#13965) @alexfauquette
|
|
58
|
+
- [charts] Allow `Zoom` to be controllable (#13858) @JCQuintas
|
|
59
|
+
- [charts] Deprecate `xAxisKey` /`zAxisKey` in favor of `xAxisId`/`zAxisId` (#13940) @alexfauquette
|
|
60
|
+
- [charts] Hide empty arcs in the PieChart (#13897) @alexfauquette
|
|
61
|
+
- [charts] Limit the trigger of exit charts (#13682) @alexfauquette
|
|
62
|
+
|
|
63
|
+
### Tree View
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-tree-view@7.11.1`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Allow the plugins to enrich the props passed to the item slots (#13953) @flaviendelangle
|
|
68
|
+
|
|
69
|
+
### Docs
|
|
70
|
+
|
|
71
|
+
- [docs] Bump pnpm priority as a package manager (#13894) @oliviertassinari
|
|
72
|
+
- [docs] Explicitly mark charts pro as not released (#13905) @alexfauquette
|
|
73
|
+
- [docs] Fix dot consistency a11y table @oliviertassinari
|
|
74
|
+
- [docs] Fix some typos in charts docs (#13906) @cratiu222
|
|
75
|
+
- [docs] Fix spelling (#13902) @nnsW3
|
|
76
|
+
- [docs] Improve error message when moving between plans (#13874) @oliviertassinari
|
|
77
|
+
- [docs] Update `SparkLineChart` reference not being correctly capitalised (#13960) @duckboy81
|
|
78
|
+
- [docs] Fix scroll demos disorientation (#13909) @oliviertassinari
|
|
79
|
+
|
|
80
|
+
### Core
|
|
81
|
+
|
|
82
|
+
- [core] Add `@mui/material-nextjs` to `MUI Core` renovate group (#13966) @LukasTy
|
|
83
|
+
- [core] Remove warning message in production (#13911) @oliviertassinari
|
|
84
|
+
- [code-infra] Reuse `useReactVersion` script from the monorepo (#13710) @cherniavskii
|
|
85
|
+
- [infra] Adds order id validation action (#13957) @michelengelen
|
|
86
|
+
- [infra] Fix order id validator action (#13971) @michelengelen
|
|
87
|
+
- [infra] Fix regex in order id validation (#13976) @michelengelen
|
|
88
|
+
- [infra] Issue template improvement (#13954) @michelengelen
|
|
89
|
+
|
|
90
|
+
## 7.11.0
|
|
91
|
+
|
|
92
|
+
_Jul 18, 2024_
|
|
93
|
+
|
|
94
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
95
|
+
|
|
96
|
+
- 🎨 Add [color legend](https://mui.com/x/react-charts/legend/#color-legend) for charts (#13700) @alexfauquette
|
|
97
|
+
- 🌍 Improve Korean (ko-KR) locale on the Date and Time Pickers
|
|
98
|
+
- 🌍 Improve Russian (ru-RU) locale on the Date and Time Pickers and Data Grid
|
|
99
|
+
- 🐞 Bugfixes
|
|
100
|
+
- 📚 Documentation improvements
|
|
101
|
+
|
|
102
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
103
|
+
|
|
104
|
+
### Data Grid
|
|
105
|
+
|
|
106
|
+
#### `@mui/x-data-grid@7.11.0`
|
|
107
|
+
|
|
108
|
+
- [DataGrid] Expose `gridEditRowsStateSelector` (#13877) @romgrk
|
|
109
|
+
- [DataGrid] Fix `columnResizeStop` event not emitted when column is not resized (#13307) @mateuseap
|
|
110
|
+
- [DataGrid] Fix delete filter inconsistent behavior (#13353) @oukunan
|
|
111
|
+
- [DataGrid] Enable flip on preferences panel (#13803) @romgrk
|
|
112
|
+
- [DataGrid] Support `date` and `datetime-local` input types in `GridFilterInputMultipleValue` type (#13411) @karudedios
|
|
113
|
+
- [l10n] Improve Russian (ru-RU) locale (#13735) @diro-atk
|
|
114
|
+
|
|
115
|
+
#### `@mui/x-data-grid-pro@7.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
116
|
+
|
|
117
|
+
Same changes as in `@mui/x-data-grid@7.11.0`.
|
|
118
|
+
|
|
119
|
+
#### `@mui/x-data-grid-premium@7.11.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
120
|
+
|
|
121
|
+
Same changes as in `@mui/x-data-grid-pro@7.11.0`.
|
|
122
|
+
|
|
123
|
+
### Date and Time Pickers
|
|
124
|
+
|
|
125
|
+
#### `@mui/x-date-pickers@7.11.0`
|
|
126
|
+
|
|
127
|
+
- [l10n] Improve Korean (ko-KR) locale (#13651) @100pearlcent
|
|
128
|
+
- [l10n] Improve Russian (ru-RU) locale (#13871) @Inv1x
|
|
129
|
+
- [pickers] Add more conformance tests improving API docs precision (#13800) @LukasTy
|
|
130
|
+
- [TimePicker] Add `Mui-selected` class to `TimeClock` meridiem buttons (#13848) @LukasTy
|
|
131
|
+
|
|
132
|
+
#### `@mui/x-date-pickers-pro@7.11.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
133
|
+
|
|
134
|
+
Same changes as in `@mui/x-date-pickers@7.11.0`, plus:
|
|
135
|
+
|
|
136
|
+
- [DateRangePicker] Fix `name` prop propagation regression (#13821) @LukasTy
|
|
137
|
+
|
|
138
|
+
### Charts
|
|
139
|
+
|
|
140
|
+
#### `@mui/x-charts@7.11.0`
|
|
141
|
+
|
|
142
|
+
- [charts] Create color legend (#13700) @alexfauquette
|
|
143
|
+
- [charts] Defaultize axis on top level `useChartContainerProps` (#13817) @JCQuintas
|
|
144
|
+
- [charts] Fix charts not passing `className` to root element (#13647) @JCQuintas
|
|
145
|
+
- [charts] Generate API documentation for pro components (#13822) @alexfauquette
|
|
146
|
+
- [charts] Improve zoomed highlight behaviour (unreleased) (#13868) @JCQuintas
|
|
147
|
+
- [charts] Allow zoom on Y axis and add zoom options to configure zooming behaviour (unreleased) (#13726) @JCQuintas
|
|
148
|
+
- [charts] Disable animations while zooming (unreleased) (#13807) @JCQuintas
|
|
149
|
+
|
|
150
|
+
### Tree View
|
|
151
|
+
|
|
152
|
+
#### `@mui/x-tree-view@7.11.0`
|
|
153
|
+
|
|
154
|
+
- [TreeView] Extract some logic outside of the `useTreeView` hook (#13845) @flaviendelangle
|
|
155
|
+
|
|
156
|
+
### Docs
|
|
157
|
+
|
|
158
|
+
- [docs] Add warning about `process.env.NODE_ENV` in production (#13869) @cherniavskii
|
|
159
|
+
- [docs] Allow controlling the demo form from the example (#13796) @JCQuintas
|
|
160
|
+
- [docs] Clarify Pickers clearable behavior not working on mobile (#13786) @lnhrdt
|
|
161
|
+
- [docs] Improve the documentation of the picker's `onChange` and `onAccept` props (#13543) @flaviendelangle
|
|
162
|
+
- [docs] Replace company name with project name @oliviertassinari
|
|
163
|
+
- [docs] Sort Pickers & Charts API slots alphabetically (#13843) @LukasTy
|
|
164
|
+
|
|
165
|
+
### Core
|
|
166
|
+
|
|
167
|
+
- [core] Add MUI Internal `renovate` group (#13846) @LukasTy
|
|
168
|
+
- [core] Link GitHub issue for `import/prefer-default-export` rule @oliviertassinari
|
|
169
|
+
- [core] Normalize `...other` and test imports in charts (#13844) @JCQuintas
|
|
170
|
+
- [core] Normalize rest / other to match the most common used @oliviertassinari
|
|
171
|
+
- [code-infra] Follow `next` tag for `@mui/docs` package bumps (#13813) @LukasTy
|
|
172
|
+
- [code-infra] Use specific version for `@mui/docs` dependency (#13760) @LukasTy
|
|
173
|
+
- [internals] Move `EventManager` to `@mui/x-internals` package (#13815) @flaviendelangle
|
|
174
|
+
|
|
6
175
|
## 7.10.0
|
|
7
176
|
|
|
8
177
|
_Jul 11, 2024_
|
|
@@ -6,7 +6,21 @@ import { CartesianContextProviderProps } from '../context/CartesianProvider';
|
|
|
6
6
|
import { HighlightedProviderProps, ZAxisContextProviderProps } from '../context';
|
|
7
7
|
import { ChartsPluginType } from '../models/plugin';
|
|
8
8
|
import { ChartSeriesType } from '../models/seriesType/config';
|
|
9
|
-
|
|
9
|
+
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
|
|
10
|
+
import { MakeOptional } from '../models/helpers';
|
|
11
|
+
export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, 'seriesFormatters'> & Omit<DrawingProviderProps, 'svgRef'> & Pick<CartesianContextProviderProps, 'dataset'> & ZAxisContextProviderProps & HighlightedProviderProps, 'children'> & {
|
|
12
|
+
/**
|
|
13
|
+
* The configuration of the x-axes.
|
|
14
|
+
* If not provided, a default axis config is used.
|
|
15
|
+
* An array of [[AxisConfig]] objects.
|
|
16
|
+
*/
|
|
17
|
+
xAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsXAxisProps>, 'id'>[];
|
|
18
|
+
/**
|
|
19
|
+
* The configuration of the y-axes.
|
|
20
|
+
* If not provided, a default axis config is used.
|
|
21
|
+
* An array of [[AxisConfig]] objects.
|
|
22
|
+
*/
|
|
23
|
+
yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, 'id'>[];
|
|
10
24
|
children?: React.ReactNode;
|
|
11
25
|
/**
|
|
12
26
|
* An array of plugins defining how to preprocess data.
|
|
@@ -14,7 +28,19 @@ export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesContextPr
|
|
|
14
28
|
*/
|
|
15
29
|
plugins?: ChartsPluginType<ChartSeriesType>[];
|
|
16
30
|
};
|
|
17
|
-
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> &
|
|
31
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesContextProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> & Pick<CartesianContextProviderProps, "dataset"> & ZAxisContextProviderProps & HighlightedProviderProps, "children"> & {
|
|
32
|
+
/**
|
|
33
|
+
* The configuration of the x-axes.
|
|
34
|
+
* If not provided, a default axis config is used.
|
|
35
|
+
* An array of [[AxisConfig]] objects.
|
|
36
|
+
*/
|
|
37
|
+
xAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsXAxisProps>, "id">[];
|
|
38
|
+
/**
|
|
39
|
+
* The configuration of the y-axes.
|
|
40
|
+
* If not provided, a default axis config is used.
|
|
41
|
+
* An array of [[AxisConfig]] objects.
|
|
42
|
+
*/
|
|
43
|
+
yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, "id">[];
|
|
18
44
|
children?: React.ReactNode;
|
|
19
45
|
/**
|
|
20
46
|
* An array of plugins defining how to preprocess data.
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ChartContainer = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
@@ -15,80 +16,38 @@ var _ChartsSurface = require("../ChartsSurface");
|
|
|
15
16
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
16
17
|
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
17
18
|
var _context = require("../context");
|
|
18
|
-
var
|
|
19
|
+
var _useChartContainerProps = require("./useChartContainerProps");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
23
|
const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
23
24
|
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onHighlightChange,
|
|
39
|
-
plugins,
|
|
40
|
-
children
|
|
41
|
-
} = props;
|
|
42
|
-
const {
|
|
43
|
-
svgRef,
|
|
44
|
-
handleRef,
|
|
45
|
-
xExtremumGetters,
|
|
46
|
-
yExtremumGetters,
|
|
47
|
-
seriesFormatters,
|
|
48
|
-
colorProcessors
|
|
49
|
-
} = (0, _useChartContainerHooks.useChartContainerHooks)(ref, plugins);
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, {
|
|
51
|
-
width: width,
|
|
52
|
-
height: height,
|
|
53
|
-
margin: margin,
|
|
54
|
-
svgRef: svgRef,
|
|
55
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorProvider.ColorProvider, {
|
|
56
|
-
colorProcessors: colorProcessors,
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, {
|
|
58
|
-
series: series,
|
|
59
|
-
colors: colors,
|
|
60
|
-
dataset: dataset,
|
|
61
|
-
seriesFormatters: seriesFormatters,
|
|
62
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianProvider.CartesianContextProvider, {
|
|
63
|
-
xAxis: xAxis,
|
|
64
|
-
yAxis: yAxis,
|
|
65
|
-
dataset: dataset,
|
|
66
|
-
xExtremumGetters: xExtremumGetters,
|
|
67
|
-
yExtremumGetters: yExtremumGetters,
|
|
68
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, {
|
|
69
|
-
zAxis: zAxis,
|
|
70
|
-
dataset: dataset,
|
|
25
|
+
children,
|
|
26
|
+
drawingProviderProps,
|
|
27
|
+
colorProviderProps,
|
|
28
|
+
seriesContextProps,
|
|
29
|
+
cartesianContextProps,
|
|
30
|
+
zAxisContextProps,
|
|
31
|
+
highlightedProviderProps,
|
|
32
|
+
chartsSurfaceProps
|
|
33
|
+
} = (0, _useChartContainerProps.useChartContainerProps)(props, ref);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, (0, _extends2.default)({}, drawingProviderProps, {
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorProvider.ColorProvider, (0, _extends2.default)({}, colorProviderProps, {
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, (0, _extends2.default)({}, seriesContextProps, {
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianProvider.CartesianContextProvider, (0, _extends2.default)({}, cartesianContextProps, {
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, (0, _extends2.default)({}, zAxisContextProps, {
|
|
71
39
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InteractionProvider.InteractionProvider, {
|
|
72
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, {
|
|
73
|
-
|
|
74
|
-
onHighlightChange: onHighlightChange,
|
|
75
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, {
|
|
76
|
-
width: width,
|
|
77
|
-
height: height,
|
|
78
|
-
ref: handleRef,
|
|
79
|
-
sx: sx,
|
|
80
|
-
title: title,
|
|
81
|
-
desc: desc,
|
|
82
|
-
disableAxisListener: disableAxisListener,
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, (0, _extends2.default)({}, highlightedProviderProps, {
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
83
42
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxesGradients.ChartsAxesGradients, {}), children]
|
|
84
|
-
})
|
|
85
|
-
})
|
|
43
|
+
}))
|
|
44
|
+
}))
|
|
86
45
|
})
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
});
|
|
46
|
+
}))
|
|
47
|
+
}))
|
|
48
|
+
}))
|
|
49
|
+
}))
|
|
50
|
+
}));
|
|
92
51
|
});
|
|
93
52
|
process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
94
53
|
// ----------------------------- Warning --------------------------------
|
|
@@ -3,7 +3,7 @@ import { ChartsPluginType } from '../models';
|
|
|
3
3
|
import { ChartSeriesType } from '../models/seriesType/config';
|
|
4
4
|
export declare const useChartContainerHooks: (ref: React.ForwardedRef<unknown> | null, plugins?: ChartsPluginType<ChartSeriesType>[]) => {
|
|
5
5
|
svgRef: React.RefObject<SVGSVGElement>;
|
|
6
|
-
|
|
6
|
+
chartSurfaceRef: ((instance: unknown) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null;
|
|
7
7
|
xExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
8
8
|
yExtremumGetters: import("../models").ExtremumGettersConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
9
9
|
seriesFormatters: import("../internals").SeriesFormatterConfig<keyof import("../models/seriesType/config").ChartsSeriesConfig>;
|
|
@@ -13,7 +13,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
const useChartContainerHooks = (ref, plugins) => {
|
|
15
15
|
const svgRef = React.useRef(null);
|
|
16
|
-
const
|
|
16
|
+
const chartSurfaceRef = (0, _useForkRef.default)(ref, svgRef);
|
|
17
17
|
const {
|
|
18
18
|
xExtremumGetters,
|
|
19
19
|
yExtremumGetters,
|
|
@@ -24,7 +24,7 @@ const useChartContainerHooks = (ref, plugins) => {
|
|
|
24
24
|
|
|
25
25
|
return {
|
|
26
26
|
svgRef,
|
|
27
|
-
|
|
27
|
+
chartSurfaceRef,
|
|
28
28
|
xExtremumGetters,
|
|
29
29
|
yExtremumGetters,
|
|
30
30
|
seriesFormatters,
|