@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.
Files changed (68) hide show
  1. package/BarChart/BarElement.d.ts +225 -228
  2. package/BarChart/BarLabel/BarLabel.d.ts +225 -228
  3. package/BarChart/BarLabel/getBarLabel.d.ts +1 -1
  4. package/BarChart/useBarChartProps.d.ts +20 -88
  5. package/CHANGELOG.md +100 -1
  6. package/ChartContainer/ChartContainer.d.ts +1 -1
  7. package/ChartContainer/useChartContainerHooks.d.ts +1 -1
  8. package/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
  9. package/ChartsReferenceLine/common.d.ts +0 -1
  10. package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -1
  11. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
  12. package/ChartsYAxis/ChartsYAxis.js +3 -1
  13. package/Gauge/GaugeProvider.d.ts +1 -1
  14. package/LineChart/AnimatedArea.d.ts +225 -228
  15. package/LineChart/AnimatedLine.d.ts +225 -228
  16. package/LineChart/useLineChartProps.d.ts +26 -103
  17. package/LineChart/useLineChartProps.js +3 -3
  18. package/PieChart/PieArc.d.ts +0 -1
  19. package/PieChart/PieArcLabel.d.ts +0 -1
  20. package/PieChart/dataTransform/transition.d.ts +0 -1
  21. package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -2
  22. package/ScatterChart/useScatterChartProps.d.ts +20 -75
  23. package/context/CartesianProvider/computeValue.js +15 -0
  24. package/context/CartesianProvider/normalizeAxis.d.ts +1 -1
  25. package/esm/BarChart/useBarChartProps.js +0 -1
  26. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
  27. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
  28. package/esm/ChartsYAxis/ChartsYAxis.js +3 -1
  29. package/esm/LineChart/useLineChartProps.js +3 -3
  30. package/esm/context/CartesianProvider/computeValue.js +16 -1
  31. package/esm/hooks/useAxisEvents.js +5 -8
  32. package/esm/hooks/useScale.js +1 -1
  33. package/esm/hooks/useTicks.js +2 -1
  34. package/esm/internals/getSVGPoint.js +11 -0
  35. package/esm/internals/index.js +2 -0
  36. package/esm/internals/utils.js +0 -12
  37. package/hooks/useAxisEvents.js +6 -9
  38. package/hooks/useChartDimensions.d.ts +1 -1
  39. package/hooks/useColor.d.ts +1 -1
  40. package/hooks/useScale.js +1 -1
  41. package/hooks/useTicks.js +2 -1
  42. package/index.js +1 -1
  43. package/internals/components/AxisSharedComponents.d.ts +0 -1
  44. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
  45. package/internals/defaultizeColor.d.ts +68 -68
  46. package/internals/getSVGPoint.d.ts +6 -0
  47. package/internals/getSVGPoint.js +17 -0
  48. package/internals/getWordsByLines.d.ts +0 -1
  49. package/internals/index.d.ts +2 -0
  50. package/internals/index.js +20 -0
  51. package/internals/useAnimatedPath.d.ts +0 -1
  52. package/internals/utils.d.ts +0 -6
  53. package/internals/utils.js +0 -13
  54. package/models/axis.d.ts +1 -2
  55. package/modern/BarChart/useBarChartProps.js +0 -1
  56. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +19 -4
  57. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
  58. package/modern/ChartsYAxis/ChartsYAxis.js +3 -1
  59. package/modern/LineChart/useLineChartProps.js +3 -3
  60. package/modern/context/CartesianProvider/computeValue.js +16 -1
  61. package/modern/hooks/useAxisEvents.js +5 -8
  62. package/modern/hooks/useScale.js +1 -1
  63. package/modern/hooks/useTicks.js +2 -1
  64. package/modern/index.js +1 -1
  65. package/modern/internals/getSVGPoint.js +11 -0
  66. package/modern/internals/index.js +2 -0
  67. package/modern/internals/utils.js +0 -12
  68. 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'.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.7.1",
3
+ "version": "7.8.0",
4
4
  "description": "The community edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",