@mui/x-charts 8.3.1 → 8.5.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 +9 -2
- package/BarChart/BarChart.js +11 -3
- package/BarChart/useBarChartProps.js +1 -1
- package/CHANGELOG.md +213 -0
- package/ChartContainer/ChartContainer.d.ts +21 -2
- package/ChartContainer/ChartContainer.js +17 -1
- package/ChartContainer/useChartContainerProps.js +7 -3
- package/ChartDataProvider/ChartDataProvider.d.ts +11 -1
- package/ChartDataProvider/ChartDataProvider.js +19 -2
- package/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
- package/ChartDataProvider/useChartDataProviderProps.js +7 -3
- package/ChartsAxis/axisClasses.d.ts +5 -0
- package/ChartsAxis/axisClasses.js +1 -1
- package/ChartsLegend/ChartsLegend.js +1 -0
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.js +1 -3
- package/ChartsSurface/ChartsSurface.js +1 -0
- package/ChartsXAxis/ChartsXAxis.js +7 -16
- package/ChartsYAxis/ChartsYAxis.js +4 -8
- package/Gauge/Gauge.js +1 -0
- package/Gauge/GaugeContainer.js +1 -0
- package/Gauge/GaugeProvider.js +1 -3
- package/LineChart/AnimatedLine.js +1 -0
- package/LineChart/LineChart.d.ts +9 -2
- package/LineChart/LineChart.js +11 -3
- package/LineChart/LineHighlightPlot.js +1 -4
- package/LineChart/MarkPlot.js +1 -4
- package/LineChart/useLineChartProps.js +1 -1
- package/PieChart/PieArc.js +1 -0
- package/PieChart/PieArcLabel.js +1 -0
- package/PieChart/PieChart.d.ts +10 -3
- package/PieChart/PieChart.js +18 -9
- package/RadarChart/RadarChart.d.ts +21 -3
- package/RadarChart/RadarChart.js +20 -4
- package/RadarChart/RadarChart.plugins.d.ts +5 -0
- package/RadarChart/RadarChart.plugins.js +10 -0
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
- package/RadarChart/RadarDataProvider/RadarDataProvider.js +6 -116
- package/RadarChart/index.d.ts +2 -0
- package/RadarChart/index.js +15 -1
- package/RadarChart/useRadarChartProps.d.ts +2 -1
- package/RadarChart/useRadarChartProps.js +3 -1
- package/ScatterChart/Scatter.js +3 -11
- package/ScatterChart/ScatterChart.d.ts +9 -2
- package/ScatterChart/ScatterChart.js +13 -5
- package/ScatterChart/useScatterChartProps.js +4 -2
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +31 -26
- package/Toolbar/Toolbar.d.ts +9 -3
- package/Toolbar/Toolbar.js +23 -7
- package/Toolbar/Toolbar.types.d.ts +15 -0
- package/Toolbar/Toolbar.types.js +5 -0
- package/Toolbar/ToolbarButton.d.ts +8 -2
- package/Toolbar/ToolbarButton.js +25 -6
- package/Toolbar/chartToolbarClasses.d.ts +6 -0
- package/Toolbar/chartToolbarClasses.js +9 -0
- package/Toolbar/index.d.ts +3 -1
- package/Toolbar/index.js +22 -0
- package/Toolbar/internals/ChartsToolbar.d.ts +6 -0
- package/Toolbar/internals/ChartsToolbar.js +14 -0
- package/context/ChartProvider/ChartContext.js +1 -3
- package/context/ChartsSlotsContext.d.ts +20 -0
- package/context/ChartsSlotsContext.js +44 -0
- package/context/index.d.ts +2 -1
- package/context/index.js +11 -0
- package/context/useChartApiContext.d.ts +10 -0
- package/context/useChartApiContext.js +27 -0
- package/esm/BarChart/BarChart.d.ts +9 -2
- package/esm/BarChart/BarChart.js +11 -3
- package/esm/BarChart/useBarChartProps.js +1 -1
- package/esm/ChartContainer/ChartContainer.d.ts +21 -2
- package/esm/ChartContainer/ChartContainer.js +17 -1
- package/esm/ChartContainer/useChartContainerProps.js +7 -3
- package/esm/ChartDataProvider/ChartDataProvider.d.ts +11 -1
- package/esm/ChartDataProvider/ChartDataProvider.js +19 -2
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -3
- package/esm/ChartsAxis/axisClasses.d.ts +5 -0
- package/esm/ChartsAxis/axisClasses.js +1 -1
- package/esm/ChartsLegend/ChartsLegend.js +1 -0
- package/esm/ChartsLocalizationProvider/ChartsLocalizationProvider.js +1 -3
- package/esm/ChartsSurface/ChartsSurface.js +1 -0
- package/esm/ChartsXAxis/ChartsXAxis.js +7 -16
- package/esm/ChartsYAxis/ChartsYAxis.js +4 -8
- package/esm/Gauge/Gauge.js +1 -0
- package/esm/Gauge/GaugeContainer.js +1 -0
- package/esm/Gauge/GaugeProvider.js +1 -3
- package/esm/LineChart/AnimatedLine.js +1 -0
- package/esm/LineChart/LineChart.d.ts +9 -2
- package/esm/LineChart/LineChart.js +11 -3
- package/esm/LineChart/LineHighlightPlot.js +1 -4
- package/esm/LineChart/MarkPlot.js +1 -4
- package/esm/LineChart/useLineChartProps.js +1 -1
- package/esm/PieChart/PieArc.js +1 -0
- package/esm/PieChart/PieArcLabel.js +1 -0
- package/esm/PieChart/PieChart.d.ts +10 -3
- package/esm/PieChart/PieChart.js +16 -7
- package/esm/RadarChart/RadarChart.d.ts +21 -3
- package/esm/RadarChart/RadarChart.js +20 -4
- package/esm/RadarChart/RadarChart.plugins.d.ts +5 -0
- package/esm/RadarChart/RadarChart.plugins.js +4 -0
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.js +5 -115
- package/esm/RadarChart/index.d.ts +2 -0
- package/esm/RadarChart/index.js +2 -0
- package/esm/RadarChart/useRadarChartProps.d.ts +2 -1
- package/esm/RadarChart/useRadarChartProps.js +3 -1
- package/esm/ScatterChart/Scatter.js +3 -11
- package/esm/ScatterChart/ScatterChart.d.ts +9 -2
- package/esm/ScatterChart/ScatterChart.js +13 -5
- package/esm/ScatterChart/useScatterChartProps.js +4 -2
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +31 -26
- package/esm/Toolbar/Toolbar.d.ts +9 -3
- package/esm/Toolbar/Toolbar.js +22 -7
- package/esm/Toolbar/Toolbar.types.d.ts +15 -0
- package/esm/Toolbar/Toolbar.types.js +1 -0
- package/esm/Toolbar/ToolbarButton.d.ts +8 -2
- package/esm/Toolbar/ToolbarButton.js +24 -5
- package/esm/Toolbar/chartToolbarClasses.d.ts +6 -0
- package/esm/Toolbar/chartToolbarClasses.js +2 -0
- package/esm/Toolbar/index.d.ts +3 -1
- package/esm/Toolbar/index.js +3 -1
- package/esm/Toolbar/internals/ChartsToolbar.d.ts +6 -0
- package/esm/Toolbar/internals/ChartsToolbar.js +8 -0
- package/esm/context/ChartProvider/ChartContext.js +1 -3
- package/esm/context/ChartsSlotsContext.d.ts +20 -0
- package/esm/context/ChartsSlotsContext.js +35 -0
- package/esm/context/index.d.ts +2 -1
- package/esm/context/index.js +1 -0
- package/esm/context/useChartApiContext.d.ts +10 -0
- package/esm/context/useChartApiContext.js +21 -0
- package/esm/hooks/index.d.ts +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useTicks.js +2 -6
- package/esm/index.js +1 -1
- package/esm/internals/constants.d.ts +3 -1
- package/esm/internals/constants.js +2 -1
- package/esm/internals/consumeSlots.js +2 -1
- package/esm/internals/consumeThemeProps.js +3 -1
- package/esm/internals/dateHelpers.d.ts +15 -0
- package/esm/internals/dateHelpers.js +20 -0
- package/esm/internals/domUtils.d.ts +1 -2
- package/esm/internals/domUtils.js +8 -19
- package/esm/internals/index.d.ts +4 -1
- package/esm/internals/index.js +4 -1
- package/esm/internals/material/index.d.ts +2 -0
- package/esm/internals/plugins/allPlugins.d.ts +1 -0
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +11 -17
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +16 -13
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +2 -8
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +4 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +83 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +17 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -8
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +1 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +2 -5
- package/esm/models/index.d.ts +2 -2
- package/esm/models/index.js +1 -0
- package/esm/models/slots/chartsBaseSlotProps.d.ts +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useTicks.js +2 -6
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -1
- package/internals/constants.js +3 -2
- package/internals/consumeSlots.js +2 -1
- package/internals/consumeThemeProps.js +3 -1
- package/internals/dateHelpers.d.ts +15 -0
- package/internals/dateHelpers.js +28 -0
- package/internals/domUtils.d.ts +1 -2
- package/internals/domUtils.js +8 -20
- package/internals/index.d.ts +4 -1
- package/internals/index.js +44 -8
- package/internals/material/index.d.ts +2 -0
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +11 -17
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +16 -13
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +7 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +6 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +4 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +83 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +17 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +5 -11
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +2 -5
- package/models/index.d.ts +2 -2
- package/models/index.js +11 -0
- package/models/slots/chartsBaseSlotProps.d.ts +1 -0
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartYAxis = exports.selectorChartXAxis = exports.selectorChartAxisZoomOptionsLookup = exports.createZoomMap = void 0;
|
|
7
|
+
exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartYAxis = exports.selectorChartXAxis = exports.selectorChartRawAxis = exports.selectorChartAxisZoomOptionsLookup = exports.createZoomMap = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions");
|
|
10
10
|
var _useChartSeries = require("../../corePlugins/useChartSeries");
|
|
@@ -95,4 +95,11 @@ const selectorChartYAxis = exports.selectorChartYAxis = (0, _selectors.createSel
|
|
|
95
95
|
zoomMap,
|
|
96
96
|
zoomOptions,
|
|
97
97
|
getFilters
|
|
98
|
-
}));
|
|
98
|
+
}));
|
|
99
|
+
const selectorChartRawAxis = exports.selectorChartRawAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis, (state, axisId) => axisId], (xAxes, yAxes, axisId) => {
|
|
100
|
+
const axis = xAxes?.find(a => a.id === axisId) ?? yAxes?.find(a => a.id === axisId) ?? null;
|
|
101
|
+
if (!axis) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
return axis;
|
|
105
|
+
});
|
|
@@ -15,6 +15,7 @@ export type ZoomData = {
|
|
|
15
15
|
end: number;
|
|
16
16
|
};
|
|
17
17
|
export type ZoomFilterMode = 'keep' | 'discard';
|
|
18
|
+
export type ZoomSliderShowTooltip = 'always' | 'hover' | 'never';
|
|
18
19
|
export interface ZoomOptions {
|
|
19
20
|
/**
|
|
20
21
|
* The starting percentage of the zoom range. In the range of 0 to 100.
|
|
@@ -77,6 +78,22 @@ export interface ZoomSliderOptions {
|
|
|
77
78
|
* If `true`, the slider will be shown.
|
|
78
79
|
*/
|
|
79
80
|
enabled?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The size reserved for the zoom slider. The actual size of the slider might be smaller, so
|
|
83
|
+
* increasing this value effectively increases the margin around the slider.
|
|
84
|
+
* This means the height for the x-axis and the width for the y-axis.
|
|
85
|
+
*
|
|
86
|
+
* @default 28
|
|
87
|
+
*/
|
|
88
|
+
size?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Defines when the tooltip with the zoom values should be shown.
|
|
91
|
+
* - 'always': The tooltip is always shown.
|
|
92
|
+
* - 'hover': The tooltip is shown when hovering over the track or thumb.
|
|
93
|
+
* - 'never': The tooltip is never shown.
|
|
94
|
+
* @default 'hover'
|
|
95
|
+
*/
|
|
96
|
+
showTooltip?: ZoomSliderShowTooltip;
|
|
80
97
|
}
|
|
81
98
|
export type ZoomAxisFilters = Record<AxisId, ExtremumFilter>;
|
|
82
99
|
export type GetZoomAxisFilters = (params: {
|
|
@@ -9,6 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _useAssertModelConsistency = require("@mui/x-internals/useAssertModelConsistency");
|
|
10
10
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
11
11
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
12
|
+
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
12
13
|
const useChartHighlight = ({
|
|
13
14
|
store,
|
|
14
15
|
params
|
|
@@ -36,6 +37,10 @@ const useChartHighlight = ({
|
|
|
36
37
|
}));
|
|
37
38
|
});
|
|
38
39
|
const setHighlight = (0, _useEventCallback.default)(newItem => {
|
|
40
|
+
const prevItem = store.getSnapshot().highlight.item;
|
|
41
|
+
if ((0, _fastObjectShallowCompare.fastObjectShallowCompare)(prevItem, newItem)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
39
44
|
params.onHighlightChange?.(newItem);
|
|
40
45
|
store.update(prev => (0, _extends2.default)({}, prev, {
|
|
41
46
|
highlight: {
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useChartInteraction = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
10
|
+
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
10
11
|
const useChartInteraction = ({
|
|
11
12
|
store
|
|
12
13
|
}) => {
|
|
@@ -43,11 +44,16 @@ const useChartInteraction = ({
|
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
const setItemInteraction = (0, _useEventCallback.default)(newItem => {
|
|
46
|
-
store.update(prev =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
47
|
+
store.update(prev => {
|
|
48
|
+
if ((0, _fastObjectShallowCompare.fastObjectShallowCompare)(prev.interaction.item, newItem)) {
|
|
49
|
+
return prev;
|
|
50
|
+
}
|
|
51
|
+
return (0, _extends2.default)({}, prev, {
|
|
52
|
+
interaction: (0, _extends2.default)({}, prev.interaction, {
|
|
53
|
+
item: newItem
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
});
|
|
51
57
|
});
|
|
52
58
|
const setPointerCoordinate = (0, _useEventCallback.default)(coordinate => {
|
|
53
59
|
store.update(prev => (0, _extends2.default)({}, prev, {
|
|
@@ -11,6 +11,7 @@ var _axis = require("../../../../models/axis");
|
|
|
11
11
|
var _colorScale = require("../../../colorScale");
|
|
12
12
|
var _ticks = require("../../../ticks");
|
|
13
13
|
var _getScale = require("../../../getScale");
|
|
14
|
+
var _dateHelpers = require("../../../dateHelpers");
|
|
14
15
|
var _getAxisExtremum = require("./getAxisExtremum");
|
|
15
16
|
var _angleConversion = require("../../../angleConversion");
|
|
16
17
|
var _getAxisTriggerTooltip = require("./getAxisTriggerTooltip");
|
|
@@ -29,13 +30,6 @@ function getRange(drawingArea, axisDirection, axis) {
|
|
|
29
30
|
}
|
|
30
31
|
return [0, Math.min(drawingArea.height, drawingArea.width) / 2];
|
|
31
32
|
}
|
|
32
|
-
const isDateData = data => data?.[0] instanceof Date;
|
|
33
|
-
function createDateFormatter(axis, range) {
|
|
34
|
-
const timeScale = (0, _d3Scale.scaleTime)(axis.data, range);
|
|
35
|
-
return (v, {
|
|
36
|
-
location
|
|
37
|
-
}) => location === 'tick' ? timeScale.tickFormat(axis.tickNumber)(v) : `${v.toLocaleString()}`;
|
|
38
|
-
}
|
|
39
33
|
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
|
|
40
34
|
const DEFAULT_BAR_GAP_RATIO = 0.1;
|
|
41
35
|
function computeAxisValue({
|
|
@@ -75,8 +69,8 @@ function computeAxisValue({
|
|
|
75
69
|
values: axis.data
|
|
76
70
|
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap))
|
|
77
71
|
});
|
|
78
|
-
if (isDateData(axis.data)) {
|
|
79
|
-
const dateFormatter = createDateFormatter(axis, range);
|
|
72
|
+
if ((0, _dateHelpers.isDateData)(axis.data)) {
|
|
73
|
+
const dateFormatter = (0, _dateHelpers.createDateFormatter)(axis, range);
|
|
80
74
|
completeAxis[axis.id].valueFormatter = axis.valueFormatter ?? dateFormatter;
|
|
81
75
|
}
|
|
82
76
|
}
|
|
@@ -92,8 +86,8 @@ function computeAxisValue({
|
|
|
92
86
|
values: axis.data
|
|
93
87
|
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap))
|
|
94
88
|
});
|
|
95
|
-
if (isDateData(axis.data)) {
|
|
96
|
-
const dateFormatter = createDateFormatter(axis, range);
|
|
89
|
+
if ((0, _dateHelpers.isDateData)(axis.data)) {
|
|
90
|
+
const dateFormatter = (0, _dateHelpers.createDateFormatter)(axis, range);
|
|
97
91
|
completeAxis[axis.id].valueFormatter = axis.valueFormatter ?? dateFormatter;
|
|
98
92
|
}
|
|
99
93
|
}
|
|
@@ -104,9 +104,7 @@ const useChartPolarAxis = ({
|
|
|
104
104
|
mousePosition.current.y = svgPoint.y;
|
|
105
105
|
|
|
106
106
|
// Test if it's in the drawing area
|
|
107
|
-
if (!instance.isPointInside(svgPoint, {
|
|
108
|
-
targetElement: event.target
|
|
109
|
-
})) {
|
|
107
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.target)) {
|
|
110
108
|
if (mousePosition.current.isInChart) {
|
|
111
109
|
instance?.cleanInteraction();
|
|
112
110
|
mousePosition.current.isInChart = false;
|
|
@@ -79,10 +79,7 @@ const useChartVoronoi = ({
|
|
|
79
79
|
}) => {
|
|
80
80
|
const pointX = getXPosition(x);
|
|
81
81
|
const pointY = getYPosition(y);
|
|
82
|
-
if (!instance.isPointInside({
|
|
83
|
-
x: pointX,
|
|
84
|
-
y: pointY
|
|
85
|
-
})) {
|
|
82
|
+
if (!instance.isPointInside(pointX, pointY)) {
|
|
86
83
|
// If the point is not displayed we move them to a trash coordinate.
|
|
87
84
|
// This avoids managing index mapping before/after filtering.
|
|
88
85
|
// The trash point is far enough such that any point in the drawing area will be closer to the mouse than the trash coordinate.
|
|
@@ -108,7 +105,7 @@ const useChartVoronoi = ({
|
|
|
108
105
|
function getClosestPoint(event) {
|
|
109
106
|
// Get mouse coordinate in global SVG space
|
|
110
107
|
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event);
|
|
111
|
-
if (!instance.isPointInside(svgPoint)) {
|
|
108
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y)) {
|
|
112
109
|
lastFind.current = undefined;
|
|
113
110
|
return 'outside-chart';
|
|
114
111
|
}
|
package/models/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./seriesType/index.js";
|
|
2
2
|
export * from "./stacking.js";
|
|
3
|
+
export * from "./slots/index.js";
|
|
3
4
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis } from "./axis.js";
|
|
4
5
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
|
5
6
|
export type { Position } from "./position.js";
|
|
6
|
-
export type { CurveType } from "./curve.js";
|
|
7
|
-
export type { ChartBaseCommonProps, ChartBaseIconProps, ChartsIconSlots, ChartsBaseSlots } from "./slots/index.js";
|
|
7
|
+
export type { CurveType } from "./curve.js";
|
package/models/index.js
CHANGED
|
@@ -24,4 +24,15 @@ Object.keys(_stacking).forEach(function (key) {
|
|
|
24
24
|
return _stacking[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
+
});
|
|
28
|
+
var _slots = require("./slots");
|
|
29
|
+
Object.keys(_slots).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _slots[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _slots[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
27
38
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of MUI X Charts components.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"prop-types": "^15.8.1",
|
|
37
37
|
"reselect": "^5.1.1",
|
|
38
38
|
"use-sync-external-store": "^1.5.0",
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
39
|
+
"@mui/x-charts-vendor": "8.4.0",
|
|
40
|
+
"@mui/x-internals": "8.5.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@emotion/react": "^11.9.0",
|