@mui/x-charts 7.8.0 → 7.9.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 +3 -3
- package/BarChart/useBarChartProps.d.ts +1 -1
- package/CHANGELOG.md +66 -0
- package/ChartContainer/ChartContainer.js +3 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsSurface.js +5 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +3 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.js +4 -39
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +7 -6
- package/ChartsTooltip/ChartsItemTooltipContent.js +4 -27
- package/ChartsTooltip/ChartsTooltip.d.ts +10 -9
- package/ChartsTooltip/ChartsTooltip.js +8 -2
- package/ChartsTooltip/ChartsTooltipTable.d.ts +15 -0
- package/ChartsTooltip/ChartsTooltipTable.js +19 -0
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +11 -0
- package/ChartsTooltip/utils.d.ts +7 -6
- package/ChartsTooltip/utils.js +24 -30
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -5
- package/ChartsXAxis/ChartsXAxis.js +7 -5
- package/LineChart/LineChart.d.ts +3 -3
- package/LineChart/MarkPlot.js +6 -2
- package/LineChart/useLineChartProps.d.ts +1 -1
- package/PieChart/PieChart.d.ts +3 -3
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/ScatterChart/Scatter.js +7 -5
- package/ScatterChart/ScatterChart.d.ts +3 -3
- package/ScatterChart/ScatterChart.js +3 -1
- package/ScatterChart/useScatterChartProps.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.d.ts +3 -3
- package/context/CartesianProvider/computeValue.d.ts +2 -2
- package/context/CartesianProvider/computeValue.js +21 -5
- package/context/ZAxisContextProvider.js +7 -2
- package/esm/ChartContainer/ChartContainer.js +3 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/esm/ChartsSurface.js +5 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +3 -38
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +3 -26
- package/esm/ChartsTooltip/ChartsTooltip.js +8 -2
- package/esm/ChartsTooltip/ChartsTooltipTable.js +20 -0
- package/esm/ChartsTooltip/index.js +2 -1
- package/esm/ChartsTooltip/utils.js +23 -30
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -5
- package/esm/ChartsXAxis/ChartsXAxis.js +7 -5
- package/esm/LineChart/MarkPlot.js +6 -2
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/esm/ScatterChart/Scatter.js +7 -5
- package/esm/ScatterChart/ScatterChart.js +3 -1
- package/esm/context/CartesianProvider/computeValue.js +21 -5
- package/esm/context/ZAxisContextProvider.js +7 -2
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useAxis.js +17 -0
- package/esm/hooks/useAxisEvents.js +20 -9
- package/esm/hooks/useInteractionItemProps.js +11 -4
- package/esm/hooks/useScale.js +6 -13
- package/esm/internals/index.js +2 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useAxis.d.ts +2 -0
- package/hooks/useAxis.js +24 -0
- package/hooks/useAxisEvents.js +20 -9
- package/hooks/useInteractionItemProps.d.ts +4 -2
- package/hooks/useInteractionItemProps.js +11 -4
- package/hooks/useScale.js +5 -13
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +20 -0
- package/models/colorMapping.d.ts +1 -1
- package/models/z-axis.d.ts +8 -0
- package/modern/ChartContainer/ChartContainer.js +3 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/modern/ChartsSurface.js +5 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -38
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -26
- package/modern/ChartsTooltip/ChartsTooltip.js +8 -2
- package/modern/ChartsTooltip/ChartsTooltipTable.js +20 -0
- package/modern/ChartsTooltip/index.js +2 -1
- package/modern/ChartsTooltip/utils.js +23 -30
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -5
- package/modern/ChartsXAxis/ChartsXAxis.js +7 -5
- package/modern/LineChart/MarkPlot.js +6 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
- package/modern/ScatterChart/Scatter.js +7 -5
- package/modern/ScatterChart/ScatterChart.js +3 -1
- package/modern/context/CartesianProvider/computeValue.js +21 -5
- package/modern/context/ZAxisContextProvider.js +7 -2
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useAxis.js +17 -0
- package/modern/hooks/useAxisEvents.js +20 -9
- package/modern/hooks/useInteractionItemProps.js +11 -4
- package/modern/hooks/useScale.js +6 -13
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/package.json +3 -3
- package/themeAugmentation/props.d.ts +2 -1
|
@@ -13,7 +13,12 @@ export const useInteractionItemProps = skip => {
|
|
|
13
13
|
return () => ({});
|
|
14
14
|
}
|
|
15
15
|
const getInteractionItemProps = data => {
|
|
16
|
-
const
|
|
16
|
+
const onPointerDown = event => {
|
|
17
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
18
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const onPointerEnter = () => {
|
|
17
22
|
dispatchInteraction({
|
|
18
23
|
type: 'enterItem',
|
|
19
24
|
data
|
|
@@ -23,7 +28,8 @@ export const useInteractionItemProps = skip => {
|
|
|
23
28
|
dataIndex: data.dataIndex
|
|
24
29
|
});
|
|
25
30
|
};
|
|
26
|
-
const
|
|
31
|
+
const onPointerLeave = event => {
|
|
32
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
27
33
|
dispatchInteraction({
|
|
28
34
|
type: 'leaveItem',
|
|
29
35
|
data
|
|
@@ -31,8 +37,9 @@ export const useInteractionItemProps = skip => {
|
|
|
31
37
|
clearHighlighted();
|
|
32
38
|
};
|
|
33
39
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
onPointerEnter,
|
|
41
|
+
onPointerLeave,
|
|
42
|
+
onPointerDown
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
45
|
return getInteractionItemProps;
|
package/modern/hooks/useScale.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useCartesianContext } from '../context/CartesianProvider';
|
|
2
1
|
import { isBandScale } from '../internals/isBandScale';
|
|
2
|
+
import { useXAxis, useYAxis } from './useAxis';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* For a given scale return a function that map value to their position.
|
|
5
6
|
* Useful when dealing with specific scale such as band.
|
|
@@ -13,18 +14,10 @@ export function getValueToPositionMapper(scale) {
|
|
|
13
14
|
return value => scale(value);
|
|
14
15
|
}
|
|
15
16
|
export function useXScale(identifier) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
xAxisIds
|
|
19
|
-
} = useCartesianContext();
|
|
20
|
-
const id = typeof identifier === 'string' ? identifier : xAxisIds[identifier ?? 0];
|
|
21
|
-
return xAxis[id].scale;
|
|
17
|
+
const axis = useXAxis(identifier);
|
|
18
|
+
return axis.scale;
|
|
22
19
|
}
|
|
23
20
|
export function useYScale(identifier) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
yAxisIds
|
|
27
|
-
} = useCartesianContext();
|
|
28
|
-
const id = typeof identifier === 'string' ? identifier : yAxisIds[identifier ?? 0];
|
|
29
|
-
return yAxis[id].scale;
|
|
21
|
+
const axis = useYAxis(identifier);
|
|
22
|
+
return axis.scale;
|
|
30
23
|
}
|
package/modern/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from '../ResponsiveChartContainer/ResizableContainer';
|
|
|
6
6
|
// hooks
|
|
7
7
|
export { useReducedMotion } from '../hooks/useReducedMotion';
|
|
8
8
|
export { useSeries } from '../hooks/useSeries';
|
|
9
|
+
export { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
9
10
|
export { useDrawingArea } from '../hooks/useDrawingArea';
|
|
10
11
|
export { useChartContainerHooks } from '../ChartContainer/useChartContainerHooks';
|
|
11
12
|
export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
@@ -15,6 +16,7 @@ export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
|
15
16
|
// utils
|
|
16
17
|
export * from './defaultizeValueFormatter';
|
|
17
18
|
export * from './configInit';
|
|
19
|
+
export * from './getLabel';
|
|
18
20
|
export * from './getSVGPoint';
|
|
19
21
|
|
|
20
22
|
// contexts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.9.0",
|
|
4
4
|
"description": "The community edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.24.7",
|
|
33
33
|
"@mui/base": "^5.0.0-beta.40",
|
|
34
|
-
"@mui/system": "^5.
|
|
35
|
-
"@mui/utils": "^5.
|
|
34
|
+
"@mui/system": "^5.16.0",
|
|
35
|
+
"@mui/utils": "^5.16.0",
|
|
36
36
|
"@react-spring/rafz": "^9.7.3",
|
|
37
37
|
"@react-spring/web": "^9.7.3",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
@@ -13,6 +13,7 @@ import { LineChartProps } from '../LineChart/LineChart';
|
|
|
13
13
|
import { ScatterProps } from '../ScatterChart/Scatter';
|
|
14
14
|
import { ScatterChartProps } from '../ScatterChart/ScatterChart';
|
|
15
15
|
import { ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
16
|
+
import { ChartSeriesType } from '../models/seriesType/config';
|
|
16
17
|
|
|
17
18
|
export interface ChartsComponentsPropsList {
|
|
18
19
|
MuiChartsAxis: ChartsAxisProps;
|
|
@@ -22,7 +23,7 @@ export interface ChartsComponentsPropsList {
|
|
|
22
23
|
MuiChartsClipPath: ChartsClipPathProps;
|
|
23
24
|
MuiChartsGrid: ChartsGridProps;
|
|
24
25
|
MuiChartsLegend: ChartsLegendProps;
|
|
25
|
-
MuiChartsTooltip: ChartsTooltipProps
|
|
26
|
+
MuiChartsTooltip: ChartsTooltipProps<ChartSeriesType>;
|
|
26
27
|
MuiChartsSurface: ChartsSurfaceProps;
|
|
27
28
|
|
|
28
29
|
// BarChart components
|