@mui/x-charts-premium 8.23.0 → 8.24.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/BarChartPremium/BarChartPremium.d.ts +16 -1
- package/BarChartPremium/BarChartPremium.js +44 -1
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
- package/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +28 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
- package/BarChartPremium/RangeBar/RangeBarPlot.js +141 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/extrema.js +85 -0
- package/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/getColor.js +43 -0
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
- package/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +14 -0
- package/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
- package/BarChartPremium/RangeBar/seriesConfig/index.js +29 -0
- package/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/legend.js +29 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +54 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltip.js +44 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
- package/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +59 -0
- package/BarChartPremium/RangeBar/types.d.ts +22 -0
- package/BarChartPremium/RangeBar/types.js +5 -0
- package/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
- package/BarChartPremium/RangeBar/useRangeBarPlotData.js +112 -0
- package/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
- package/BarChartPremium/RangeBar/useUtilityClasses.js +24 -0
- package/BarChartPremium/index.d.ts +3 -1
- package/BarChartPremium/index.js +25 -1
- package/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
- package/BarChartPremium/useBarChartPremiumProps.js +19 -1
- package/CHANGELOG.md +111 -1
- package/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
- package/ChartDataProviderPremium/ChartDataProviderPremium.js +9 -1
- package/ChartDataProviderPremium/index.d.ts +1 -1
- package/ChartDataProviderPremium/index.js +7 -11
- package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
- package/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +59 -0
- package/esm/BarChartPremium/BarChartPremium.d.ts +16 -1
- package/esm/BarChartPremium/BarChartPremium.js +45 -2
- package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/AnimatedRangeBarElement.js +21 -0
- package/esm/BarChartPremium/RangeBar/RangeBarPlot.d.ts +46 -0
- package/esm/BarChartPremium/RangeBar/RangeBarPlot.js +135 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/extrema.js +77 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getColor.js +37 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.d.ts +19 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/getSeriesWithDefaultValues.js +7 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/index.d.ts +2 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/index.js +21 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/legend.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/legend.js +23 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/seriesProcessor.js +47 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.d.ts +4 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltip.js +37 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/BarChartPremium/RangeBar/seriesConfig/tooltipPosition.js +53 -0
- package/esm/BarChartPremium/RangeBar/types.d.ts +22 -0
- package/esm/BarChartPremium/RangeBar/types.js +1 -0
- package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.d.ts +12 -0
- package/esm/BarChartPremium/RangeBar/useRangeBarPlotData.js +105 -0
- package/esm/BarChartPremium/RangeBar/useUtilityClasses.d.ts +12 -0
- package/esm/BarChartPremium/RangeBar/useUtilityClasses.js +15 -0
- package/esm/BarChartPremium/index.d.ts +3 -1
- package/esm/BarChartPremium/index.js +3 -1
- package/esm/BarChartPremium/useBarChartPremiumProps.d.ts +5 -1
- package/esm/BarChartPremium/useBarChartPremiumProps.js +18 -1
- package/esm/ChartDataProviderPremium/ChartDataProviderPremium.d.ts +3 -2
- package/esm/ChartDataProviderPremium/ChartDataProviderPremium.js +8 -1
- package/esm/ChartDataProviderPremium/index.d.ts +1 -1
- package/esm/ChartDataProviderPremium/index.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.d.ts +2 -0
- package/esm/ChartZoomSlider/internals/previews/RangeBarPreviewPlot.js +53 -0
- package/esm/hooks/animation/index.d.ts +1 -0
- package/esm/hooks/animation/index.js +1 -0
- package/esm/hooks/animation/useAnimateRangeBar.d.ts +18 -0
- package/esm/hooks/animation/useAnimateRangeBar.js +51 -0
- package/esm/hooks/index.d.ts +3 -1
- package/esm/hooks/index.js +4 -1
- package/esm/hooks/useRangeBarSeries.d.ts +34 -0
- package/esm/hooks/useRangeBarSeries.js +40 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.js +5 -4
- package/esm/models/index.d.ts +2 -1
- package/esm/models/index.js +3 -1
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/models/seriesType/rangeBar.d.ts +43 -0
- package/esm/models/seriesType/rangeBar.js +1 -0
- package/esm/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
- package/esm/moduleAugmentation/rangeBarOnClick.js +2 -0
- package/esm/typeOverloads/index.d.ts +1 -0
- package/esm/typeOverloads/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +22 -0
- package/esm/typeOverloads/modules.js +1 -0
- package/hooks/animation/index.d.ts +1 -0
- package/hooks/animation/index.js +16 -0
- package/hooks/animation/useAnimateRangeBar.d.ts +18 -0
- package/hooks/animation/useAnimateRangeBar.js +57 -0
- package/hooks/index.d.ts +3 -1
- package/hooks/index.js +22 -0
- package/hooks/useRangeBarSeries.d.ts +34 -0
- package/hooks/useRangeBarSeries.js +45 -0
- package/index.d.ts +4 -1
- package/index.js +26 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +11 -0
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +16 -0
- package/models/seriesType/rangeBar.d.ts +43 -0
- package/models/seriesType/rangeBar.js +5 -0
- package/moduleAugmentation/rangeBarOnClick.d.ts +8 -0
- package/moduleAugmentation/rangeBarOnClick.js +8 -0
- package/package.json +16 -6
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +6 -0
- package/typeOverloads/modules.d.ts +22 -0
- package/typeOverloads/modules.js +5 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.axisTooltipGetter = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const tooltipGetter = params => {
|
|
9
|
+
const {
|
|
10
|
+
series,
|
|
11
|
+
getColor,
|
|
12
|
+
identifier
|
|
13
|
+
} = params;
|
|
14
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const label = (0, _internals.getLabel)(series.label, 'tooltip');
|
|
18
|
+
const value = series.data[identifier.dataIndex];
|
|
19
|
+
if (value == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const formattedValue = series.valueFormatter(value, {
|
|
23
|
+
dataIndex: identifier.dataIndex
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
identifier,
|
|
27
|
+
color: getColor(identifier.dataIndex),
|
|
28
|
+
label,
|
|
29
|
+
value,
|
|
30
|
+
formattedValue,
|
|
31
|
+
markType: series.labelMarkType
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const axisTooltipGetter = series => {
|
|
35
|
+
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
36
|
+
direction: 'y',
|
|
37
|
+
axisId: s.yAxisId
|
|
38
|
+
} : {
|
|
39
|
+
direction: 'x',
|
|
40
|
+
axisId: s.xAxisId
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.axisTooltipGetter = axisTooltipGetter;
|
|
44
|
+
var _default = exports.default = tooltipGetter;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _useRangeBarPlotData = require("../useRangeBarPlotData");
|
|
8
|
+
const tooltipItemPositionGetter = params => {
|
|
9
|
+
const {
|
|
10
|
+
series,
|
|
11
|
+
identifier,
|
|
12
|
+
axesConfig,
|
|
13
|
+
placement
|
|
14
|
+
} = params;
|
|
15
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const itemSeries = series.rangeBar?.series[identifier.seriesId];
|
|
19
|
+
if (series.rangeBar == null || itemSeries == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (axesConfig.x === undefined || axesConfig.y === undefined) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const dimensions = (0, _useRangeBarPlotData.getRangeBarDimensions)(itemSeries.layout, axesConfig.x, axesConfig.y, itemSeries.data, identifier.dataIndex, series.rangeBar.seriesOrder.length, series.rangeBar.seriesOrder.findIndex(id => id === itemSeries.id));
|
|
26
|
+
if (dimensions == null) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const {
|
|
30
|
+
x,
|
|
31
|
+
y,
|
|
32
|
+
width,
|
|
33
|
+
height
|
|
34
|
+
} = dimensions;
|
|
35
|
+
switch (placement) {
|
|
36
|
+
case 'right':
|
|
37
|
+
return {
|
|
38
|
+
x: x + width,
|
|
39
|
+
y: y + height / 2
|
|
40
|
+
};
|
|
41
|
+
case 'bottom':
|
|
42
|
+
return {
|
|
43
|
+
x: x + width / 2,
|
|
44
|
+
y: y + height
|
|
45
|
+
};
|
|
46
|
+
case 'left':
|
|
47
|
+
return {
|
|
48
|
+
x,
|
|
49
|
+
y: y + height / 2
|
|
50
|
+
};
|
|
51
|
+
case 'top':
|
|
52
|
+
default:
|
|
53
|
+
return {
|
|
54
|
+
x: x + width / 2,
|
|
55
|
+
y
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var _default = exports.default = tooltipItemPositionGetter;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SeriesId } from '@mui/x-charts/models';
|
|
2
|
+
import type { BarSeriesType } from '@mui/x-charts-pro/models';
|
|
3
|
+
import type { RangeBarValueType } from "../../models/index.js";
|
|
4
|
+
export interface LayoutData {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ProcessedRangeBarSeriesData {
|
|
11
|
+
seriesId: SeriesId;
|
|
12
|
+
data: ProcessedRangeBarData[];
|
|
13
|
+
layout: BarSeriesType['layout'];
|
|
14
|
+
yOrigin: number;
|
|
15
|
+
xOrigin: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ProcessedRangeBarData extends LayoutData {
|
|
18
|
+
seriesId: SeriesId;
|
|
19
|
+
dataIndex: number;
|
|
20
|
+
color: string;
|
|
21
|
+
value: RangeBarValueType | null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ChartDrawingArea } from '@mui/x-charts/hooks';
|
|
2
|
+
import { type ComputedAxis, type ComputedAxisConfig, type ScaleName } from '@mui/x-charts/internals';
|
|
3
|
+
import { type ChartsXAxisProps, type ChartsYAxisProps } from '@mui/x-charts/models';
|
|
4
|
+
import { type DefaultizedRangeBarSeriesType } from "../../models/seriesType/rangeBar.js";
|
|
5
|
+
import { type ProcessedRangeBarSeriesData } from "./types.js";
|
|
6
|
+
export declare function useRangeBarPlotData(drawingArea: ChartDrawingArea, xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps>): ProcessedRangeBarSeriesData[];
|
|
7
|
+
export declare function getRangeBarDimensions(layout: 'vertical' | 'horizontal', xAxis: ComputedAxis<ScaleName, any, ChartsXAxisProps>, yAxis: ComputedAxis<ScaleName, any, ChartsYAxisProps>, seriesData: DefaultizedRangeBarSeriesType['data'], dataIndex: number, seriesCount: number, seriesIndex: number): {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
} | null;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRangeBarDimensions = getRangeBarDimensions;
|
|
7
|
+
exports.useRangeBarPlotData = useRangeBarPlotData;
|
|
8
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
9
|
+
var _internals = require("@mui/x-charts/internals");
|
|
10
|
+
var _useRangeBarSeries = require("../../hooks/useRangeBarSeries");
|
|
11
|
+
function useRangeBarPlotData(drawingArea, xAxes, yAxes) {
|
|
12
|
+
const store = (0, _internals.useStore)();
|
|
13
|
+
const seriesData = (0, _useRangeBarSeries.useRangeBarSeriesContext)() ?? {
|
|
14
|
+
series: {},
|
|
15
|
+
seriesOrder: []
|
|
16
|
+
};
|
|
17
|
+
const defaultXAxisId = (0, _hooks.useXAxes)().xAxisIds[0];
|
|
18
|
+
const defaultYAxisId = (0, _hooks.useYAxes)().yAxisIds[0];
|
|
19
|
+
const getColor = store.use(_internals.selectorChartSeriesConfig).rangeBar.colorProcessor;
|
|
20
|
+
const {
|
|
21
|
+
series,
|
|
22
|
+
seriesOrder
|
|
23
|
+
} = seriesData;
|
|
24
|
+
const xMin = drawingArea.left;
|
|
25
|
+
const xMax = drawingArea.left + drawingArea.width;
|
|
26
|
+
const yMin = drawingArea.top;
|
|
27
|
+
const yMax = drawingArea.top + drawingArea.height;
|
|
28
|
+
const data = seriesOrder.map((seriesId, seriesIndex) => {
|
|
29
|
+
const xAxisId = series[seriesId].xAxisId ?? defaultXAxisId;
|
|
30
|
+
const yAxisId = series[seriesId].yAxisId ?? defaultYAxisId;
|
|
31
|
+
const xAxisConfig = xAxes[xAxisId];
|
|
32
|
+
const yAxisConfig = yAxes[yAxisId];
|
|
33
|
+
const verticalLayout = series[seriesId].layout === 'vertical';
|
|
34
|
+
(0, _internals.checkBarChartScaleErrors)(verticalLayout, seriesId, series[seriesId].data.length, xAxisId, xAxes, yAxisId, yAxes);
|
|
35
|
+
const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
36
|
+
const xScale = xAxisConfig.scale;
|
|
37
|
+
const yScale = yAxisConfig.scale;
|
|
38
|
+
const xOrigin = Math.round(xScale(0) ?? 0);
|
|
39
|
+
const yOrigin = Math.round(yScale(0) ?? 0);
|
|
40
|
+
const colorGetter = getColor(series[seriesId], xAxes[xAxisId], yAxes[yAxisId]);
|
|
41
|
+
const bandWidth = baseScaleConfig.scale.bandwidth();
|
|
42
|
+
const {
|
|
43
|
+
barWidth,
|
|
44
|
+
offset
|
|
45
|
+
} = (0, _internals.getBandSize)(bandWidth, seriesOrder.length, baseScaleConfig.barGapRatio);
|
|
46
|
+
const barOffset = seriesIndex * (barWidth + offset);
|
|
47
|
+
const {
|
|
48
|
+
data: currentSeriesData,
|
|
49
|
+
layout
|
|
50
|
+
} = series[seriesId];
|
|
51
|
+
const seriesDataPoints = [];
|
|
52
|
+
for (let dataIndex = 0; dataIndex < baseScaleConfig.data.length; dataIndex += 1) {
|
|
53
|
+
const baseValue = baseScaleConfig.data[dataIndex];
|
|
54
|
+
const seriesValue = currentSeriesData[dataIndex];
|
|
55
|
+
if (seriesValue == null) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const valueCoordinates = seriesValue.map(v => verticalLayout ? yScale(v) : xScale(v));
|
|
59
|
+
const minValueCoord = Math.round(Math.min(...valueCoordinates));
|
|
60
|
+
const maxValueCoord = Math.round(Math.max(...valueCoordinates));
|
|
61
|
+
const barSize = maxValueCoord - minValueCoord;
|
|
62
|
+
const result = {
|
|
63
|
+
seriesId,
|
|
64
|
+
dataIndex,
|
|
65
|
+
x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
|
|
66
|
+
y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
|
|
67
|
+
height: verticalLayout ? barSize : barWidth,
|
|
68
|
+
width: verticalLayout ? barWidth : barSize,
|
|
69
|
+
color: colorGetter(dataIndex),
|
|
70
|
+
value: currentSeriesData[dataIndex]
|
|
71
|
+
};
|
|
72
|
+
if (result.x > xMax || result.x + result.width < xMin || result.y > yMax || result.y + result.height < yMin) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
seriesDataPoints.push(result);
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
seriesId,
|
|
79
|
+
data: seriesDataPoints,
|
|
80
|
+
layout,
|
|
81
|
+
xOrigin,
|
|
82
|
+
yOrigin
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
function getRangeBarDimensions(layout, xAxis, yAxis, seriesData, dataIndex, seriesCount, seriesIndex) {
|
|
88
|
+
const xScale = xAxis.scale;
|
|
89
|
+
const yScale = yAxis.scale;
|
|
90
|
+
const verticalLayout = layout === 'vertical';
|
|
91
|
+
const baseScaleConfig = verticalLayout ? xAxis : yAxis;
|
|
92
|
+
const baseValue = baseScaleConfig.data[dataIndex];
|
|
93
|
+
const seriesValue = seriesData[dataIndex];
|
|
94
|
+
const {
|
|
95
|
+
barWidth,
|
|
96
|
+
offset
|
|
97
|
+
} = (0, _internals.getBandSize)(baseScaleConfig.scale.bandwidth(), seriesCount, baseScaleConfig.barGapRatio);
|
|
98
|
+
const barOffset = seriesIndex * (barWidth + offset);
|
|
99
|
+
if (seriesValue == null) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const valueCoordinates = seriesValue.map(v => verticalLayout ? yScale(v) : xScale(v));
|
|
103
|
+
const minValueCoord = Math.round(Math.min(...valueCoordinates));
|
|
104
|
+
const maxValueCoord = Math.round(Math.max(...valueCoordinates));
|
|
105
|
+
const barSize = maxValueCoord - minValueCoord;
|
|
106
|
+
return {
|
|
107
|
+
x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
|
|
108
|
+
y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
|
|
109
|
+
height: verticalLayout ? barSize : barWidth,
|
|
110
|
+
width: verticalLayout ? barWidth : barSize
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RangeBarClasses {
|
|
2
|
+
/** Styles applied to the range bar plot element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the group surrounding a series' bar elements. */
|
|
5
|
+
series: string;
|
|
6
|
+
/** Styles applied to the group surrounding a series' labels. */
|
|
7
|
+
seriesLabels: string;
|
|
8
|
+
}
|
|
9
|
+
export type RangeBarClassKey = keyof RangeBarClasses;
|
|
10
|
+
export declare function getRangeBarUtilityClass(slot: string): string;
|
|
11
|
+
export declare const rangeBarClasses: RangeBarClasses;
|
|
12
|
+
export declare const useUtilityClasses: (classes?: Partial<RangeBarClasses>) => Record<"series" | "root" | "seriesLabels", string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getRangeBarUtilityClass = getRangeBarUtilityClass;
|
|
8
|
+
exports.useUtilityClasses = exports.rangeBarClasses = void 0;
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
11
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
12
|
+
function getRangeBarUtilityClass(slot) {
|
|
13
|
+
return (0, _generateUtilityClass.default)('MuiRangeBar', slot);
|
|
14
|
+
}
|
|
15
|
+
const rangeBarClasses = exports.rangeBarClasses = (0, _generateUtilityClasses.default)('MuiRangeBar', ['root', 'series', 'seriesLabels']);
|
|
16
|
+
const useUtilityClasses = classes => {
|
|
17
|
+
const slots = {
|
|
18
|
+
root: ['root'],
|
|
19
|
+
series: ['series'],
|
|
20
|
+
seriesLabels: ['seriesLabels']
|
|
21
|
+
};
|
|
22
|
+
return (0, _composeClasses.default)(slots, getRangeBarUtilityClass, classes);
|
|
23
|
+
};
|
|
24
|
+
exports.useUtilityClasses = useUtilityClasses;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export * from "./BarChartPremium.js";
|
|
2
|
-
export * from "./BarChartPremium.plugins.js";
|
|
2
|
+
export * from "./BarChartPremium.plugins.js";
|
|
3
|
+
export * from "./RangeBar/RangeBarPlot.js";
|
|
4
|
+
export { rangeBarClasses, type RangeBarClasses, type RangeBarClassKey } from "./RangeBar/useUtilityClasses.js";
|
package/BarChartPremium/index.js
CHANGED
|
@@ -3,9 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
rangeBarClasses: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "rangeBarClasses", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _useUtilityClasses.rangeBarClasses;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
6
15
|
var _BarChartPremium = require("./BarChartPremium");
|
|
7
16
|
Object.keys(_BarChartPremium).forEach(function (key) {
|
|
8
17
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
9
19
|
if (key in exports && exports[key] === _BarChartPremium[key]) return;
|
|
10
20
|
Object.defineProperty(exports, key, {
|
|
11
21
|
enumerable: true,
|
|
@@ -17,6 +27,7 @@ Object.keys(_BarChartPremium).forEach(function (key) {
|
|
|
17
27
|
var _BarChartPremium2 = require("./BarChartPremium.plugins");
|
|
18
28
|
Object.keys(_BarChartPremium2).forEach(function (key) {
|
|
19
29
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
31
|
if (key in exports && exports[key] === _BarChartPremium2[key]) return;
|
|
21
32
|
Object.defineProperty(exports, key, {
|
|
22
33
|
enumerable: true,
|
|
@@ -24,4 +35,17 @@ Object.keys(_BarChartPremium2).forEach(function (key) {
|
|
|
24
35
|
return _BarChartPremium2[key];
|
|
25
36
|
}
|
|
26
37
|
});
|
|
27
|
-
});
|
|
38
|
+
});
|
|
39
|
+
var _RangeBarPlot = require("./RangeBar/RangeBarPlot");
|
|
40
|
+
Object.keys(_RangeBarPlot).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
+
if (key in exports && exports[key] === _RangeBarPlot[key]) return;
|
|
44
|
+
Object.defineProperty(exports, key, {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _RangeBarPlot[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var _useUtilityClasses = require("./RangeBar/useUtilityClasses");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { type BarChartPluginSignatures } from '@mui/x-charts/BarChart';
|
|
2
|
+
import { type ChartContainerProps } from '@mui/x-charts/ChartContainer';
|
|
1
3
|
import { type BarChartPremiumProps } from "./BarChartPremium.js";
|
|
4
|
+
import { type RangeBarPlotProps } from "./RangeBar/RangeBarPlot.js";
|
|
2
5
|
/**
|
|
3
6
|
* A helper function that extracts BarChartPremiumProps from the input props
|
|
4
7
|
* and returns an object with props for the children components of BarChartPremium.
|
|
@@ -7,8 +10,9 @@ import { type BarChartPremiumProps } from "./BarChartPremium.js";
|
|
|
7
10
|
* @returns An object with props for the children components of BarChartPremium
|
|
8
11
|
*/
|
|
9
12
|
export declare function useBarChartPremiumProps(props: BarChartPremiumProps): {
|
|
13
|
+
chartContainerProps: ChartContainerProps<"bar" | "rangeBar", BarChartPluginSignatures>;
|
|
14
|
+
rangeBarPlotProps: RangeBarPlotProps;
|
|
10
15
|
chartsWrapperProps: Omit<import("@mui/x-charts").ChartsWrapperProps, "children">;
|
|
11
|
-
chartContainerProps: import("@mui/x-charts").ChartContainerProps<"bar", import("@mui/x-charts").BarChartPluginSignatures>;
|
|
12
16
|
barPlotProps: import("@mui/x-charts").BarPlotProps;
|
|
13
17
|
gridProps: import("@mui/x-charts").ChartsGridProps;
|
|
14
18
|
clipPathProps: import("@mui/x-charts").ChartsClipPathProps;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.useBarChartPremiumProps = useBarChartPremiumProps;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
7
10
|
var _internals = require("@mui/x-charts/internals");
|
|
11
|
+
const _excluded = ["chartContainerProps"];
|
|
8
12
|
/**
|
|
9
13
|
* A helper function that extracts BarChartPremiumProps from the input props
|
|
10
14
|
* and returns an object with props for the children components of BarChartPremium.
|
|
@@ -13,5 +17,19 @@ var _internals = require("@mui/x-charts/internals");
|
|
|
13
17
|
* @returns An object with props for the children components of BarChartPremium
|
|
14
18
|
*/
|
|
15
19
|
function useBarChartPremiumProps(props) {
|
|
16
|
-
|
|
20
|
+
const _useBarChartProps = (0, _internals.useBarChartProps)(props),
|
|
21
|
+
{
|
|
22
|
+
chartContainerProps
|
|
23
|
+
} = _useBarChartProps,
|
|
24
|
+
barChartProps = (0, _objectWithoutPropertiesLoose2.default)(_useBarChartProps, _excluded);
|
|
25
|
+
const rangeBarPlotProps = {
|
|
26
|
+
onItemClick: props.onItemClick,
|
|
27
|
+
slots: props.slots,
|
|
28
|
+
slotProps: props.slotProps,
|
|
29
|
+
borderRadius: props.borderRadius
|
|
30
|
+
};
|
|
31
|
+
return (0, _extends2.default)({}, barChartProps, {
|
|
32
|
+
chartContainerProps: chartContainerProps,
|
|
33
|
+
rangeBarPlotProps
|
|
34
|
+
});
|
|
17
35
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,119 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.24.0
|
|
9
|
+
|
|
10
|
+
_Jan 8, 2026_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- ⚡️Add bar [batch renderer](https://mui.com/x/react-charts/bars/#performance), result in a significant performance improvement when rendering thousands of bars
|
|
15
|
+
- 📊 Add [range bar chart](https://mui.com/x/react-charts/range-bar/) to render
|
|
16
|
+

|
|
17
|
+
- 🌎 Improved Danish (da-DK) and Japanese (ja-JP) locales on the Data Grid
|
|
18
|
+
|
|
19
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
20
|
+
@anders-noerrelykke, @auloin, @sai6855, @yuito-it
|
|
21
|
+
|
|
22
|
+
The following team members contributed to this release:
|
|
23
|
+
@alelthomas, @alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @JCQuintas, @mapache-salvaje, @siriwatknp
|
|
24
|
+
|
|
25
|
+
### Data Grid
|
|
26
|
+
|
|
27
|
+
#### `@mui/x-data-grid@8.24.0`
|
|
28
|
+
|
|
29
|
+
- [l10n] Improve Danish (da-DK) locale (#20828) @anders-noerrelykke
|
|
30
|
+
- [l10n] Improve Japanese (ja-JP) locale (#20251) @yuito-it
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@8.24.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@8.24.0`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Fix header filter height for `density="compact"` (#20834) @arminmeh
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@8.24.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@8.24.0`.
|
|
41
|
+
|
|
42
|
+
### Date and Time Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@8.24.0`
|
|
45
|
+
|
|
46
|
+
- [pickers] Fix Styles applied to PickersDay when MuiPickersDay-dayOutsideMonth is used (#20719) @sai6855
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@8.24.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@8.24.0`.
|
|
51
|
+
|
|
52
|
+
### Charts
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-charts@8.24.0`
|
|
55
|
+
|
|
56
|
+
- [charts] Add `VisibilityManager` logic to allow managing series/items (#20571) @JCQuintas
|
|
57
|
+
- [charts] Add `identifierSerializer` configuration (#20775) @JCQuintas
|
|
58
|
+
- [charts] Add `serializeIdentifier` instance function (#20791) @JCQuintas
|
|
59
|
+
- [charts] Add bar batch renderer (#20457) @bernardobelchior
|
|
60
|
+
- [charts] Allow animating bar, line, and pie elements to hidden state (#20798) @JCQuintas
|
|
61
|
+
- [charts] Fix failing lint step (#20813) @bernardobelchior
|
|
62
|
+
- [charts] Fix tooltip anchored to item (#20783) @alexfauquette
|
|
63
|
+
- [charts] Fix type casting in getCategoryAxisConfig and applySeriesLayout functions (#20797) @sai6855
|
|
64
|
+
- [charts] Let keyboard navigation avoid overflow and handle nullish values (#20757) @alexfauquette
|
|
65
|
+
- [charts] Refactor `PieChart` and `PieChartPro` to use `slots` and `slotProps` directly (#20795) @sai6855
|
|
66
|
+
- [charts] Refactor `useRegisterPointerEventHandlers` (#20824) @bernardobelchior
|
|
67
|
+
- [charts] Update legend types to allow hiding/showing items (#20784) @JCQuintas
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-charts-pro@8.24.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
70
|
+
|
|
71
|
+
Same changes as in `@mui/x-charts@8.24.0`, plus:
|
|
72
|
+
|
|
73
|
+
- [charts-pro] Pass `slotProps.toolbar` to `Toolbar` in `PieChartPro` (#20796) @sai6855
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-charts-premium@8.24.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
76
|
+
|
|
77
|
+
Same changes as in `@mui/x-charts-pro@8.24.0`, plus:
|
|
78
|
+
|
|
79
|
+
- [charts-premium] Add range bar chart (#20275) @bernardobelchior
|
|
80
|
+
|
|
81
|
+
### Tree View
|
|
82
|
+
|
|
83
|
+
#### `@mui/x-tree-view@8.24.0`
|
|
84
|
+
|
|
85
|
+
- [tree view] Introduce a Tree View Store to clean the internals (#20051) @flaviendelangle
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-tree-view-pro@8.24.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-tree-view@8.24.0`.
|
|
90
|
+
|
|
91
|
+
### Codemod
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-codemod@8.24.0`
|
|
94
|
+
|
|
95
|
+
Internal changes.
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Fix axis size default values (#20799) @bernardobelchior
|
|
100
|
+
- [docs] Update What's New in MUI X page with post v8 features (DX-118) (#20787) @alelthomas
|
|
101
|
+
- [docs] Fix `onAccept`'s `context.source` documentation to use 'view' instead of 'picker' (#20465) @auloin
|
|
102
|
+
- [docs] Revise the Charts Brush doc (#20792) @mapache-salvaje
|
|
103
|
+
- [docs] Revise the Charts Highlighting doc (#20788) @mapache-salvaje
|
|
104
|
+
- [docs] Revise the Charts Label doc (#20794) @mapache-salvaje
|
|
105
|
+
- [docs] Revise the Charts Export doc (#20779) @mapache-salvaje
|
|
106
|
+
|
|
107
|
+
### Core
|
|
108
|
+
|
|
109
|
+
- [code-infra] Fix v8.23.0 release date (#20767) @bernardobelchior
|
|
110
|
+
- [code-infra] Remove `glob-gitignore` (#20801) @bernardobelchior
|
|
111
|
+
- [code-infra] Remove `nyc` (#20804) @bernardobelchior
|
|
112
|
+
- [code-infra] Remove `stream-browserify` and `null-loader` (#20805) @bernardobelchior
|
|
113
|
+
- [code-infra] Remove `stylelint-config-tailwindcss` (#20807) @bernardobelchior
|
|
114
|
+
- [code-infra] Remove unused `path` package (#20802) @bernardobelchior
|
|
115
|
+
- [code-infra] Retry flaky e2e test on webkit (#20806) @JCQuintas
|
|
116
|
+
- [internal] Add `internal` slot to properly generate components CSS layer (#20763) @siriwatknp
|
|
117
|
+
|
|
8
118
|
## 8.23.0
|
|
9
119
|
|
|
10
|
-
_Dec
|
|
120
|
+
_Dec 24, 2025_
|
|
11
121
|
|
|
12
122
|
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
13
123
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ChartSeriesType, type ChartAnyPluginSignature, type ChartProviderProps } from '@mui/x-charts/internals';
|
|
2
|
-
import { type ChartDataProviderProProps } from '@mui/x-charts-pro/ChartDataProviderPro';
|
|
1
|
+
import { type ChartSeriesType, type ChartAnyPluginSignature, type ChartProviderProps, type ChartSeriesConfig } from '@mui/x-charts/internals';
|
|
3
2
|
import { type ChartsSlotPropsPro, type ChartsSlotsPro } from '@mui/x-charts-pro/internals';
|
|
3
|
+
import { type ChartDataProviderProProps } from '@mui/x-charts-pro/ChartDataProviderPro';
|
|
4
4
|
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
5
|
export type ChartDataProviderPremiumProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartDataProviderProProps<TSeries, TSignatures> & ChartProviderProps<TSeries, TSignatures>['pluginParams'] & {
|
|
6
6
|
/**
|
|
@@ -12,6 +12,7 @@ export type ChartDataProviderPremiumProps<TSeries extends ChartSeriesType = Char
|
|
|
12
12
|
*/
|
|
13
13
|
slotProps?: Partial<ChartsSlotPropsPro>;
|
|
14
14
|
};
|
|
15
|
+
export declare const defaultSeriesConfigPremium: ChartSeriesConfig<'bar' | 'rangeBar' | 'scatter' | 'line' | 'pie'>;
|
|
15
16
|
/**
|
|
16
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
17
18
|
*
|
|
@@ -6,17 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.ChartDataProviderPremium = ChartDataProviderPremium;
|
|
9
|
+
exports.defaultSeriesConfigPremium = void 0;
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _Watermark = require("@mui/x-license/Watermark");
|
|
12
13
|
var _internals = require("@mui/x-charts/internals");
|
|
13
14
|
var _ChartsLocalizationProvider = require("@mui/x-charts/ChartsLocalizationProvider");
|
|
14
15
|
var _useLicenseVerifier = require("@mui/x-license/useLicenseVerifier");
|
|
16
|
+
var _internals2 = require("@mui/x-charts-pro/internals");
|
|
17
|
+
var _seriesConfig = require("../BarChartPremium/RangeBar/seriesConfig");
|
|
15
18
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
16
19
|
var _useChartDataProviderPremiumProps = require("./useChartDataProviderPremiumProps");
|
|
17
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const releaseInfo = "
|
|
21
|
+
const releaseInfo = "MTc2NzgzMDQwMDAwMA==";
|
|
19
22
|
const packageIdentifier = 'x-charts-premium';
|
|
23
|
+
const defaultSeriesConfigPremium = exports.defaultSeriesConfigPremium = (0, _extends2.default)({}, _internals2.defaultSeriesConfigPro, {
|
|
24
|
+
rangeBar: _seriesConfig.rangeBarSeriesConfig
|
|
25
|
+
});
|
|
26
|
+
|
|
20
27
|
/**
|
|
21
28
|
* Orchestrates the data providers for the chart components and hooks.
|
|
22
29
|
*
|
|
@@ -52,6 +59,7 @@ function ChartDataProviderPremium(props) {
|
|
|
52
59
|
slots,
|
|
53
60
|
slotProps
|
|
54
61
|
} = (0, _useChartDataProviderPremiumProps.useChartDataProviderPremiumProps)((0, _extends2.default)({}, props, {
|
|
62
|
+
seriesConfig: props.seriesConfig ?? defaultSeriesConfigPremium,
|
|
55
63
|
plugins: props.plugins ?? _allPlugins.DEFAULT_PLUGINS
|
|
56
64
|
}));
|
|
57
65
|
(0, _useLicenseVerifier.useLicenseVerifier)(packageIdentifier, releaseInfo);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ChartDataProviderPremium, type ChartDataProviderPremiumProps } from "./ChartDataProviderPremium.js";
|
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return _ChartDataProviderPremium[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
6
|
+
Object.defineProperty(exports, "ChartDataProviderPremium", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ChartDataProviderPremium.ChartDataProviderPremium;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _ChartDataProviderPremium = require("./ChartDataProviderPremium");
|