@mui/x-charts 7.3.2 → 7.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.js +18 -11
- package/BarChart/BarClipPath.d.ts +14 -0
- package/BarChart/BarClipPath.js +50 -0
- package/BarChart/BarElement.d.ts +10 -5
- package/BarChart/BarElement.js +3 -2
- package/BarChart/BarPlot.d.ts +4 -0
- package/BarChart/BarPlot.js +102 -30
- package/BarChart/getRadius.d.ts +15 -0
- package/BarChart/getRadius.js +37 -0
- package/BarChart/legend.js +13 -6
- package/BarChart/types.d.ts +25 -0
- package/BarChart/types.js +5 -0
- package/CHANGELOG.md +160 -2
- package/ChartContainer/ChartContainer.js +10 -10
- package/ChartsGrid/ChartsGrid.js +22 -11
- package/ChartsOverlay/ChartsLoadingOverlay.js +3 -3
- package/ChartsOverlay/ChartsNoDataOverlay.js +2 -2
- package/ChartsOverlay/ChartsOverlay.d.ts +9 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +4 -2
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +7 -3
- package/ChartsTooltip/utils.js +13 -8
- package/ChartsXAxis/ChartsXAxis.js +1 -2
- package/ChartsYAxis/ChartsYAxis.js +2 -2
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaElement.js +3 -3
- package/LineChart/AreaPlot.js +3 -2
- package/LineChart/LineChart.js +11 -10
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineElement.js +3 -3
- package/LineChart/LineHighlightElement.d.ts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/legend.js +13 -6
- package/PieChart/PieArc.d.ts +1 -1
- package/PieChart/PieArcLabel.d.ts +1 -1
- package/PieChart/PieArcLabel.js +3 -1
- package/PieChart/PieArcLabelPlot.js +14 -5
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.js +11 -10
- package/PieChart/formatter.js +4 -1
- package/PieChart/legend.js +15 -5
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +10 -10
- package/ScatterChart/ScatterChart.js +16 -15
- package/ScatterChart/legend.js +13 -6
- package/SparkLineChart/SparkLineChart.js +5 -5
- package/context/ZAxisContextProvider.js +5 -5
- package/esm/BarChart/BarChart.js +18 -11
- package/esm/BarChart/BarClipPath.js +42 -0
- package/esm/BarChart/BarElement.js +3 -2
- package/esm/BarChart/BarPlot.js +103 -31
- package/esm/BarChart/getRadius.js +30 -0
- package/esm/BarChart/legend.js +13 -6
- package/esm/BarChart/types.js +1 -0
- package/esm/ChartContainer/ChartContainer.js +10 -10
- package/esm/ChartsGrid/ChartsGrid.js +23 -12
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +3 -3
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +4 -2
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +7 -3
- package/esm/ChartsTooltip/utils.js +13 -8
- package/esm/ChartsXAxis/ChartsXAxis.js +1 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
- package/esm/LineChart/AreaElement.js +3 -3
- package/esm/LineChart/AreaPlot.js +3 -2
- package/esm/LineChart/LineChart.js +11 -10
- package/esm/LineChart/LineElement.js +3 -3
- package/esm/LineChart/legend.js +13 -6
- package/esm/PieChart/PieArcLabel.js +3 -1
- package/esm/PieChart/PieArcLabelPlot.js +14 -5
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +11 -10
- package/esm/PieChart/formatter.js +4 -1
- package/esm/PieChart/legend.js +15 -5
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +10 -10
- package/esm/ScatterChart/ScatterChart.js +16 -15
- package/esm/ScatterChart/legend.js +13 -6
- package/esm/SparkLineChart/SparkLineChart.js +5 -5
- package/esm/context/ZAxisContextProvider.js +5 -5
- package/esm/hooks/useAxisEvents.js +12 -7
- package/esm/internals/getLabel.js +3 -0
- package/hooks/useAxisEvents.js +12 -7
- package/index.js +1 -1
- package/internals/defaultizeColor.d.ts +7 -5
- package/internals/getLabel.d.ts +1 -0
- package/internals/getLabel.js +9 -0
- package/internals/utils.d.ts +1 -1
- package/models/seriesType/bar.d.ts +4 -1
- package/models/seriesType/line.d.ts +4 -1
- package/models/seriesType/pie.d.ts +9 -4
- package/models/seriesType/scatter.d.ts +4 -1
- package/modern/BarChart/BarChart.js +18 -11
- package/modern/BarChart/BarClipPath.js +42 -0
- package/modern/BarChart/BarElement.js +3 -2
- package/modern/BarChart/BarPlot.js +103 -31
- package/modern/BarChart/getRadius.js +30 -0
- package/modern/BarChart/legend.js +13 -6
- package/modern/BarChart/types.js +1 -0
- package/modern/ChartContainer/ChartContainer.js +10 -10
- package/modern/ChartsGrid/ChartsGrid.js +23 -12
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +3 -3
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +4 -2
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +7 -3
- package/modern/ChartsTooltip/utils.js +13 -8
- package/modern/ChartsXAxis/ChartsXAxis.js +1 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
- package/modern/LineChart/AreaElement.js +3 -3
- package/modern/LineChart/AreaPlot.js +3 -2
- package/modern/LineChart/LineChart.js +11 -10
- package/modern/LineChart/LineElement.js +3 -3
- package/modern/LineChart/legend.js +13 -6
- package/modern/PieChart/PieArcLabel.js +3 -1
- package/modern/PieChart/PieArcLabelPlot.js +14 -5
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +11 -10
- package/modern/PieChart/formatter.js +4 -1
- package/modern/PieChart/legend.js +15 -5
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +10 -10
- package/modern/ScatterChart/ScatterChart.js +16 -15
- package/modern/ScatterChart/legend.js +13 -6
- package/modern/SparkLineChart/SparkLineChart.js +5 -5
- package/modern/context/ZAxisContextProvider.js +5 -5
- package/modern/hooks/useAxisEvents.js +12 -7
- package/modern/index.js +1 -1
- package/modern/internals/getLabel.js +3 -0
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +4 -0
- package/themeAugmentation/overrides.d.ts +2 -0
- package/themeAugmentation/props.d.ts +2 -0
|
@@ -90,7 +90,7 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
90
90
|
value: axisData[dataIndex]
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
const
|
|
93
|
+
const handleOut = () => {
|
|
94
94
|
mousePosition.current = {
|
|
95
95
|
x: -1,
|
|
96
96
|
y: -1
|
|
@@ -99,8 +99,9 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
99
99
|
type: 'exitChart'
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
const
|
|
103
|
-
const
|
|
102
|
+
const handleMove = event => {
|
|
103
|
+
const target = 'targetTouches' in event ? event.targetTouches[0] : event;
|
|
104
|
+
const svgPoint = getSVGPoint(svgRef.current, target);
|
|
104
105
|
mousePosition.current = {
|
|
105
106
|
x: svgPoint.x,
|
|
106
107
|
y: svgPoint.y
|
|
@@ -123,11 +124,15 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
};
|
|
126
|
-
element.addEventListener('mouseout',
|
|
127
|
-
element.addEventListener('mousemove',
|
|
127
|
+
element.addEventListener('mouseout', handleOut);
|
|
128
|
+
element.addEventListener('mousemove', handleMove);
|
|
129
|
+
element.addEventListener('touchend', handleOut);
|
|
130
|
+
element.addEventListener('touchmove', handleMove);
|
|
128
131
|
return () => {
|
|
129
|
-
element.removeEventListener('mouseout',
|
|
130
|
-
element.removeEventListener('mousemove',
|
|
132
|
+
element.removeEventListener('mouseout', handleOut);
|
|
133
|
+
element.removeEventListener('mousemove', handleMove);
|
|
134
|
+
element.removeEventListener('touchend', handleOut);
|
|
135
|
+
element.removeEventListener('touchmove', handleMove);
|
|
131
136
|
};
|
|
132
137
|
}, [svgRef, dispatch, left, width, top, height, usedYAxis, yAxis, usedXAxis, xAxis, disableAxisListener]);
|
|
133
138
|
};
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "The community edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"directory": "packages/x-charts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime": "^7.24.
|
|
32
|
+
"@babel/runtime": "^7.24.5",
|
|
33
33
|
"@mui/base": "^5.0.0-beta.40",
|
|
34
34
|
"@mui/system": "^5.15.14",
|
|
35
35
|
"@mui/utils": "^5.15.14",
|
|
36
36
|
"@react-spring/rafz": "^9.7.3",
|
|
37
37
|
"@react-spring/web": "^9.7.3",
|
|
38
|
-
"clsx": "^2.1.
|
|
38
|
+
"clsx": "^2.1.1",
|
|
39
39
|
"d3-color": "^3.1.0",
|
|
40
40
|
"d3-delaunay": "^6.0.4",
|
|
41
41
|
"d3-interpolate": "^3.0.1",
|
|
@@ -18,6 +18,10 @@ export interface ChartsComponents {
|
|
|
18
18
|
MuiChartsClipPath?: {
|
|
19
19
|
defaultProps?: ComponentsProps['MuiChartsClipPath'];
|
|
20
20
|
};
|
|
21
|
+
MuiChartsGrid?: {
|
|
22
|
+
defaultProps?: ComponentsProps['MuiChartsGrid'];
|
|
23
|
+
styleOverrides?: ComponentsOverrides['MuiChartsGrid'];
|
|
24
|
+
};
|
|
21
25
|
MuiChartsLegend?: {
|
|
22
26
|
defaultProps?: ComponentsProps['MuiChartsLegend'];
|
|
23
27
|
styleOverrides?: ComponentsOverrides['MuiChartsLegend'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BarElementClassKey } from '../BarChart/BarElement';
|
|
2
2
|
import { ChartsAxisClassKey } from '../ChartsAxis';
|
|
3
3
|
import { ChartsAxisHighlightClassKey } from '../ChartsAxisHighlight';
|
|
4
|
+
import { ChartsGridClassKey } from '../ChartsGrid';
|
|
4
5
|
import { ChartsLegendClassKey } from '../ChartsLegend';
|
|
5
6
|
import { ChartsTooltipClassKey } from '../ChartsTooltip';
|
|
6
7
|
import { AreaElementClassKey, LineElementClassKey, MarkElementClassKey } from '../LineChart';
|
|
@@ -9,6 +10,7 @@ import { AreaElementClassKey, LineElementClassKey, MarkElementClassKey } from '.
|
|
|
9
10
|
export interface PickersComponentNameToClassKey {
|
|
10
11
|
MuiChartsAxis: ChartsAxisClassKey;
|
|
11
12
|
MuiChartsAxisHighlight: ChartsAxisHighlightClassKey;
|
|
13
|
+
MuiChartsGrid: ChartsGridClassKey;
|
|
12
14
|
MuiChartsLegend: ChartsLegendClassKey;
|
|
13
15
|
MuiChartsTooltip: ChartsTooltipClassKey;
|
|
14
16
|
|
|
@@ -3,6 +3,7 @@ import { BarElementProps } from '../BarChart/BarElement';
|
|
|
3
3
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
4
4
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
5
5
|
import { ChartsClipPathProps } from '../ChartsClipPath';
|
|
6
|
+
import { ChartsGridProps } from '../ChartsGrid';
|
|
6
7
|
import { ChartsLegendProps } from '../ChartsLegend';
|
|
7
8
|
import { ChartsSurfaceProps } from '../ChartsSurface';
|
|
8
9
|
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
@@ -18,6 +19,7 @@ export interface ChartsComponentsPropsList {
|
|
|
18
19
|
MuiChartsYAxis: ChartsYAxisProps;
|
|
19
20
|
MuiChartsAxisHighlight: ChartsAxisHighlightProps;
|
|
20
21
|
MuiChartsClipPath: ChartsClipPathProps;
|
|
22
|
+
MuiChartsGrid: ChartsGridProps;
|
|
21
23
|
MuiChartsLegend: ChartsLegendProps;
|
|
22
24
|
MuiChartsTooltip: ChartsTooltipProps;
|
|
23
25
|
MuiChartsSurface: ChartsSurfaceProps;
|