@mui/x-charts 7.7.1 → 7.8.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/BarElement.d.ts +225 -228
- package/BarChart/BarLabel/BarLabel.d.ts +225 -228
- package/BarChart/BarLabel/getBarLabel.d.ts +1 -1
- package/BarChart/useBarChartProps.d.ts +20 -88
- package/CHANGELOG.md +100 -1
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/useChartContainerHooks.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/ChartsReferenceLine/common.d.ts +0 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/ChartsYAxis/ChartsYAxis.js +3 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/LineChart/AnimatedArea.d.ts +225 -228
- package/LineChart/AnimatedLine.d.ts +225 -228
- package/LineChart/useLineChartProps.d.ts +26 -103
- package/LineChart/useLineChartProps.js +3 -3
- package/PieChart/PieArc.d.ts +0 -1
- package/PieChart/PieArcLabel.d.ts +0 -1
- package/PieChart/dataTransform/transition.d.ts +0 -1
- package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -2
- package/ScatterChart/useScatterChartProps.d.ts +20 -75
- package/context/CartesianProvider/computeValue.js +15 -0
- package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
- package/esm/BarChart/useBarChartProps.js +0 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +3 -1
- package/esm/LineChart/useLineChartProps.js +3 -3
- package/esm/context/CartesianProvider/computeValue.js +16 -1
- package/esm/hooks/useAxisEvents.js +5 -8
- package/esm/hooks/useScale.js +1 -1
- package/esm/hooks/useTicks.js +2 -1
- package/esm/internals/getSVGPoint.js +11 -0
- package/esm/internals/index.js +2 -0
- package/esm/internals/utils.js +0 -12
- package/hooks/useAxisEvents.js +6 -9
- package/hooks/useChartDimensions.d.ts +1 -1
- package/hooks/useColor.d.ts +1 -1
- package/hooks/useScale.js +1 -1
- package/hooks/useTicks.js +2 -1
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +68 -68
- package/internals/getSVGPoint.d.ts +6 -0
- package/internals/getSVGPoint.js +17 -0
- package/internals/getWordsByLines.d.ts +0 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +20 -0
- package/internals/useAnimatedPath.d.ts +0 -1
- package/internals/utils.d.ts +0 -6
- package/internals/utils.js +0 -13
- package/models/axis.d.ts +1 -2
- package/modern/BarChart/useBarChartProps.js +0 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +3 -1
- package/modern/LineChart/useLineChartProps.js +3 -3
- package/modern/context/CartesianProvider/computeValue.js +16 -1
- package/modern/hooks/useAxisEvents.js +5 -8
- package/modern/hooks/useScale.js +1 -1
- package/modern/hooks/useTicks.js +2 -1
- package/modern/index.js +1 -1
- package/modern/internals/getSVGPoint.js +11 -0
- package/modern/internals/index.js +2 -0
- package/modern/internals/utils.js +0 -12
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform mouse event position to coordinates inside the SVG.
|
|
3
|
+
* @param svg The SVG element
|
|
4
|
+
* @param event The mouseEvent to transform
|
|
5
|
+
*/
|
|
6
|
+
export function getSVGPoint(svg, event) {
|
|
7
|
+
const pt = svg.createSVGPoint();
|
|
8
|
+
pt.x = event.clientX;
|
|
9
|
+
pt.y = event.clientY;
|
|
10
|
+
return pt.matrixTransform(svg.getScreenCTM().inverse());
|
|
11
|
+
}
|
|
@@ -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 { useDrawingArea } from '../hooks/useDrawingArea';
|
|
9
10
|
export { useChartContainerHooks } from '../ChartContainer/useChartContainerHooks';
|
|
10
11
|
export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
11
12
|
export { useLineChartProps } from '../LineChart/useLineChartProps';
|
|
@@ -14,6 +15,7 @@ export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
|
14
15
|
// utils
|
|
15
16
|
export * from './defaultizeValueFormatter';
|
|
16
17
|
export * from './configInit';
|
|
18
|
+
export * from './getSVGPoint';
|
|
17
19
|
|
|
18
20
|
// contexts
|
|
19
21
|
|
|
@@ -3,18 +3,6 @@ export function getSymbol(shape) {
|
|
|
3
3
|
const symbolNames = 'circle cross diamond square star triangle wye'.split(/ /);
|
|
4
4
|
return symbolNames.indexOf(shape) || 0;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* Transform mouse event position to coordinates inside the SVG.
|
|
8
|
-
* @param svg The SVG element
|
|
9
|
-
* @param event The mouseEvent to transform
|
|
10
|
-
*/
|
|
11
|
-
export function getSVGPoint(svg, event) {
|
|
12
|
-
const pt = svg.createSVGPoint();
|
|
13
|
-
pt.x = event.clientX;
|
|
14
|
-
pt.y = event.clientY;
|
|
15
|
-
return pt.matrixTransform(svg.getScreenCTM().inverse());
|
|
16
|
-
}
|
|
17
|
-
|
|
18
6
|
/**
|
|
19
7
|
* Helper that converts values and percentages into values.
|
|
20
8
|
* @param value The value provided by the developer. Can either be a number or a string with '%' or 'px'.
|