@mui/x-charts 8.2.0 → 8.3.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 (134) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/ChartsClipPath/ChartsClipPath.d.ts +8 -0
  3. package/ChartsClipPath/ChartsClipPath.js +8 -0
  4. package/LineChart/AppearingMask.js +1 -2
  5. package/LineChart/CircleMarkElement.d.ts +10 -0
  6. package/LineChart/CircleMarkElement.js +5 -15
  7. package/LineChart/MarkElement.d.ts +10 -0
  8. package/LineChart/MarkElement.js +15 -15
  9. package/LineChart/MarkPlot.js +18 -2
  10. package/PieChart/PieArcLabel.js +3 -4
  11. package/SparkLineChart/SparkLineChart.d.ts +19 -0
  12. package/SparkLineChart/SparkLineChart.js +52 -15
  13. package/Toolbar/Toolbar.d.ts +5 -0
  14. package/Toolbar/Toolbar.js +34 -0
  15. package/Toolbar/ToolbarButton.d.ts +5 -0
  16. package/Toolbar/ToolbarButton.js +27 -0
  17. package/Toolbar/index.d.ts +2 -0
  18. package/Toolbar/index.js +27 -0
  19. package/esm/ChartsClipPath/ChartsClipPath.d.ts +8 -0
  20. package/esm/ChartsClipPath/ChartsClipPath.js +8 -0
  21. package/esm/LineChart/AppearingMask.js +1 -2
  22. package/esm/LineChart/CircleMarkElement.d.ts +10 -0
  23. package/esm/LineChart/CircleMarkElement.js +5 -15
  24. package/esm/LineChart/MarkElement.d.ts +10 -0
  25. package/esm/LineChart/MarkElement.js +15 -15
  26. package/esm/LineChart/MarkPlot.js +19 -3
  27. package/esm/PieChart/PieArcLabel.js +3 -4
  28. package/esm/SparkLineChart/SparkLineChart.d.ts +19 -0
  29. package/esm/SparkLineChart/SparkLineChart.js +52 -15
  30. package/esm/Toolbar/Toolbar.d.ts +5 -0
  31. package/esm/Toolbar/Toolbar.js +27 -0
  32. package/esm/Toolbar/ToolbarButton.d.ts +5 -0
  33. package/esm/Toolbar/ToolbarButton.js +20 -0
  34. package/esm/Toolbar/index.d.ts +2 -0
  35. package/esm/Toolbar/index.js +2 -0
  36. package/esm/hooks/animation/useAnimatePieArcLabel.d.ts +10 -1
  37. package/esm/hooks/animation/useAnimatePieArcLabel.js +4 -4
  38. package/esm/index.d.ts +2 -1
  39. package/esm/index.js +3 -2
  40. package/esm/internals/constants.d.ts +4 -0
  41. package/esm/internals/constants.js +5 -0
  42. package/esm/internals/createSvgIcon.d.ts +3 -0
  43. package/esm/internals/createSvgIcon.js +2 -0
  44. package/esm/internals/index.d.ts +4 -1
  45. package/esm/internals/index.js +4 -1
  46. package/esm/internals/material/index.d.ts +4 -0
  47. package/esm/internals/material/index.js +7 -0
  48. package/esm/internals/plugins/corePlugins/corePlugins.d.ts +6 -4
  49. package/esm/internals/plugins/corePlugins/corePlugins.js +1 -1
  50. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +35 -0
  51. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +1 -1
  52. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +3 -4
  53. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +10 -2
  54. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +16 -4
  55. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +7 -2
  56. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +5 -4
  57. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +2 -1
  58. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +159 -0
  59. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +2 -1
  60. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +10 -0
  61. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +28 -13
  62. package/esm/internals/plugins/models/helpers.d.ts +0 -1
  63. package/esm/internals/plugins/models/plugin.d.ts +0 -30
  64. package/esm/internals/store/useCharts.d.ts +1 -1
  65. package/esm/internals/store/useCharts.js +11 -12
  66. package/esm/locales/enUS.d.ts +2 -0
  67. package/esm/locales/enUS.js +3 -1
  68. package/esm/locales/frFR.d.ts +2 -0
  69. package/esm/locales/frFR.js +2 -0
  70. package/esm/locales/utils/chartsLocaleTextApi.d.ts +8 -0
  71. package/esm/locales/utils/getChartsLocalization.d.ts +2 -0
  72. package/esm/models/axis.d.ts +10 -3
  73. package/esm/models/axis.js +4 -0
  74. package/esm/models/index.d.ts +2 -1
  75. package/esm/models/slots/chartsBaseSlotProps.d.ts +13 -0
  76. package/esm/models/slots/chartsBaseSlotProps.js +1 -0
  77. package/esm/models/slots/chartsBaseSlots.d.ts +5 -0
  78. package/esm/models/slots/chartsBaseSlots.js +1 -0
  79. package/esm/models/slots/chartsIconSlots.d.ts +1 -0
  80. package/esm/models/slots/chartsIconSlots.js +1 -0
  81. package/esm/models/slots/index.d.ts +3 -0
  82. package/esm/models/slots/index.js +3 -0
  83. package/hooks/animation/useAnimatePieArcLabel.d.ts +10 -1
  84. package/hooks/animation/useAnimatePieArcLabel.js +4 -4
  85. package/index.d.ts +2 -1
  86. package/index.js +12 -1
  87. package/internals/constants.d.ts +4 -0
  88. package/internals/constants.js +11 -0
  89. package/internals/createSvgIcon.d.ts +3 -0
  90. package/internals/createSvgIcon.js +8 -0
  91. package/internals/index.d.ts +4 -1
  92. package/internals/index.js +36 -0
  93. package/internals/material/index.d.ts +4 -0
  94. package/internals/material/index.js +14 -0
  95. package/internals/plugins/corePlugins/corePlugins.d.ts +6 -4
  96. package/internals/plugins/corePlugins/corePlugins.js +1 -1
  97. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +35 -0
  98. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +2 -2
  99. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +3 -4
  100. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +10 -2
  101. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +21 -9
  102. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +7 -2
  103. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +5 -4
  104. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +2 -1
  105. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +159 -0
  106. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +3 -2
  107. package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +10 -0
  108. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +28 -13
  109. package/internals/plugins/models/helpers.d.ts +0 -1
  110. package/internals/plugins/models/plugin.d.ts +0 -30
  111. package/internals/store/useCharts.d.ts +1 -1
  112. package/internals/store/useCharts.js +11 -12
  113. package/locales/enUS.d.ts +2 -0
  114. package/locales/enUS.js +3 -1
  115. package/locales/frFR.d.ts +2 -0
  116. package/locales/frFR.js +2 -0
  117. package/locales/utils/chartsLocaleTextApi.d.ts +8 -0
  118. package/locales/utils/getChartsLocalization.d.ts +2 -0
  119. package/models/axis.d.ts +10 -3
  120. package/models/axis.js +4 -0
  121. package/models/index.d.ts +2 -1
  122. package/models/slots/chartsBaseSlotProps.d.ts +13 -0
  123. package/models/slots/chartsBaseSlotProps.js +5 -0
  124. package/models/slots/chartsBaseSlots.d.ts +5 -0
  125. package/models/slots/chartsBaseSlots.js +5 -0
  126. package/models/slots/chartsIconSlots.d.ts +1 -0
  127. package/models/slots/chartsIconSlots.js +5 -0
  128. package/models/slots/index.d.ts +3 -0
  129. package/models/slots/index.js +38 -0
  130. package/package.json +5 -5
  131. package/esm/internals/store/useChartModels.d.ts +0 -7
  132. package/esm/internals/store/useChartModels.js +0 -64
  133. package/internals/store/useChartModels.d.ts +0 -7
  134. package/internals/store/useChartModels.js +0 -73
package/CHANGELOG.md CHANGED
@@ -5,6 +5,113 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.3.0
9
+
10
+ _May 8, 2025_
11
+
12
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🎨 Added new styling options and shapes for `<FunnelChart />`, including `variant`, `borderRadius`, `pyramid`, and `step-pyramid` curves.
15
+ - 📚 Documentation improvements
16
+ - 🐞 Bugfixes
17
+
18
+ Special thanks go out to this community member for a valuable contribution:
19
+ @ptuukkan.
20
+ Team members who have contributed to this release:
21
+ @alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @MBilalShafi, @rita-codes, @romgrk.
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@8.3.0`
26
+
27
+ - [DataGrid] Fix cell editing of computed columns with data source (#17684) @ptuukkan
28
+ - [DataGrid] Fix lazy loading crash with `isRowSelectable` prop (#17629) @MBilalShafi
29
+ - [DataGrid] Fix: use CSS nonce (#17726) @romgrk
30
+ - [DataGrid] Ignore `preProcessEditCellProps` for non-editable columns when starting a row update (#17732) @arminmeh
31
+ - [DataGrid] Avoid applying row selection propagation on filtered rows (#17739) @MBilalShafi
32
+
33
+ #### `@mui/x-data-grid-pro@8.3.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@8.3.0`.
36
+
37
+ #### `@mui/x-data-grid-premium@8.3.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
38
+
39
+ Same changes as in `@mui/x-data-grid-pro@8.3.0`.
40
+
41
+ ### Date and Time Pickers
42
+
43
+ #### `@mui/x-date-pickers@8.3.0`
44
+
45
+ - [DateTimePicker] Fix focus behavior on desktop variant (#17719) @LukasTy
46
+ - [pickers] Avoid `DigitalClock` stealing focus from a Picker open button on close (#17686) @LukasTy
47
+
48
+ #### `@mui/x-date-pickers-pro@8.3.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-date-pickers@8.3.0`, plus:
51
+
52
+ - [DateRangePicker] Fix to reset range position after closing mobile Picker (#17631) @LukasTy
53
+
54
+ ### Charts
55
+
56
+ - The `<FunnelChart />` series now accepts a `variant='outlined'` prop for a simpler style.
57
+ <img width="398" alt="Screenshot 2025-05-06 at 20 36 12" src="https://github.com/user-attachments/assets/00fef14f-9026-421e-a4b6-7e081adce1e8" />
58
+
59
+ - Add a `borderRadius` property to `<FunnelChart />`. All funnels have `8px` as a default value.
60
+ <img width="386" alt="Screenshot 2025-05-06 at 14 00 20" src="https://github.com/user-attachments/assets/4f4cc0e7-01ce-4ed6-a0e1-a387f78def23" />
61
+
62
+ - Add a `pyramid` curve to `<FunnelChart />`, which allows creation of a pyramid-shaped funnel.
63
+ <img width="344" alt="Screenshot 2025-05-06 at 14 32 59" src="https://github.com/user-attachments/assets/0b2896e0-0478-4766-bb1b-258a4977a751" />
64
+
65
+ - Add a `step-pyramid` curve to `<FunnelChart />`, which creates a stepped-pyramid like shape.
66
+ <img width="344" alt="Screenshot 2025-05-06 at 14 33 03" src="https://github.com/user-attachments/assets/894f0ab3-7898-40fe-b0df-560feea4085a" />
67
+
68
+ #### `@mui/x-charts@8.3.0`
69
+
70
+ - [charts] Add charts toolbar with zoom options (#17615) @bernardobelchior
71
+ - [charts] Add zoom slider (#17496) @bernardobelchior
72
+ - [charts] Cleanup compiler warnings (#17360) @alexfauquette
73
+ - [charts] Fix `<PieArcLabel />` not taking `arcLabelRadius` into account (#17655) @bernardobelchior
74
+ - [charts] Fix spark line not having clip path (#17501) @bernardobelchior
75
+ - [charts] Fix type issue with ESM (#17624) @alexfauquette
76
+ - [charts] Improve `<MarkElement />` performance (#17546) @bernardobelchior
77
+ - [charts] Rename `materialSlots` internal constant (#17710) @bernardobelchior
78
+ - [charts] Update zoom slider design (#17682) @bernardobelchior
79
+ - [charts] Fix zoom being documented as available for heatmap (#17657) @bernardobelchior
80
+
81
+ #### `@mui/x-charts-pro@8.3.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
82
+
83
+ Same changes as in `@mui/x-charts@8.3.0`, plus:
84
+
85
+ - [charts-pro] Add `pyramid` curve to `<FunnelChart />` (#17665) @JCQuintas
86
+ - [charts-pro] Add `variant='outlined'` to `<FunnelChart />` series (#17661) @JCQuintas
87
+ - [charts-pro] Add a `borderRadius` property to `<FunnelChart />` (#17660) @JCQuintas
88
+
89
+ ### Tree View
90
+
91
+ #### `@mui/x-tree-view@8.3.0`
92
+
93
+ - [tree view] Bug fix - Escape does not cancel Drag n Drop (#17735) @rita-codes
94
+ - [tree view] Fix keyboard navigation error (#17685) @rita-codes
95
+ - [tree view] Continue cleaning the plugin system (#17386) @flaviendelangle
96
+
97
+ #### `@mui/x-tree-view-pro@8.3.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
98
+
99
+ Same changes as in `@mui/x-tree-view@8.3.0`.
100
+
101
+ ### Docs
102
+
103
+ - [charts] Add population pyramid demo (#17652) @bernardobelchior
104
+ - [charts] Fix randomised argos test (#17658) @JCQuintas
105
+ - [docs] Make preview messaging consistent in charts @bernardobelchior
106
+
107
+ ### Core
108
+
109
+ - [code-infra] Avoid `node` types in the built packages (#17533) @LukasTy
110
+ - [code-infra] Add `pkg.pr.new` publishing (#17402) @Janpot
111
+ - [code-infra] Normalize author package in org @oliviertassinari
112
+ - [code-infra] Remove required checkout step (#17729) @JCQuintas
113
+ - [docs-infra] Normalize netlify.toml in org @oliviertassinari
114
+
8
115
  ## 8.2.0
9
116
 
10
117
  _May 1, 2025_
@@ -1,6 +1,14 @@
1
1
  import * as React from 'react';
2
2
  export type ChartsClipPathProps = {
3
+ /**
4
+ * The id of the clip path.
5
+ */
3
6
  id: string;
7
+ /**
8
+ * Offset, in pixels, of the clip path rectangle from the drawing area.
9
+ *
10
+ * A positive value will move the rectangle outside the drawing area.
11
+ */
4
12
  offset?: {
5
13
  top?: number;
6
14
  right?: number;
@@ -49,7 +49,15 @@ process.env.NODE_ENV !== "production" ? ChartsClipPath.propTypes = {
49
49
  // | These PropTypes are generated from the TypeScript type definitions |
50
50
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
51
51
  // ----------------------------------------------------------------------
52
+ /**
53
+ * The id of the clip path.
54
+ */
52
55
  id: _propTypes.default.string.isRequired,
56
+ /**
57
+ * Offset, in pixels, of the clip path rectangle from the drawing area.
58
+ *
59
+ * A positive value will move the rectangle outside the drawing area.
60
+ */
53
61
  offset: _propTypes.default.shape({
54
62
  bottom: _propTypes.default.number,
55
63
  left: _propTypes.default.number,
@@ -11,7 +11,6 @@ exports.appearingMaskClasses = void 0;
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _styles = require("@mui/material/styles");
13
13
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
14
- var _clsx = _interopRequireDefault(require("clsx"));
15
14
  var _animation = require("../internals/animation/animation");
16
15
  var _cleanId = require("../internals/cleanId");
17
16
  var _hooks = require("../hooks");
@@ -42,7 +41,7 @@ function AppearingMask(props) {
42
41
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("clipPath", {
43
42
  id: clipId,
44
43
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedRect, {
45
- className: (0, _clsx.default)(!props.skipAnimation && appearingMaskClasses.animate),
44
+ className: props.skipAnimation ? '' : appearingMaskClasses.animate,
46
45
  x: 0,
47
46
  y: 0,
48
47
  width: drawingArea.left + drawingArea.width + drawingArea.right,
@@ -10,6 +10,16 @@ export type CircleMarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'is
10
10
  * The index to the element in the series' data array.
11
11
  */
12
12
  dataIndex: number;
13
+ /**
14
+ * If `true`, the marker is faded.
15
+ * @default false
16
+ */
17
+ isFaded?: boolean;
18
+ /**
19
+ * If `true`, the marker is highlighted.
20
+ * @default false
21
+ */
22
+ isHighlighted?: boolean;
13
23
  };
14
24
  /**
15
25
  * The line mark element that only render circle for performance improvement.
@@ -14,13 +14,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _styles = require("@mui/material/styles");
15
15
  var _animation = require("../internals/animation/animation");
16
16
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
17
- var _useItemHighlighted = require("../hooks/useItemHighlighted");
18
17
  var _markElementClasses = require("./markElementClasses");
19
- var _useSelector = require("../internals/store/useSelector");
20
- var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
21
- var _useStore = require("../internals/store/useStore");
22
18
  var _jsxRuntime = require("react/jsx-runtime");
23
- const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"];
19
+ const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
24
20
  const Circle = (0, _styles.styled)('circle')({
25
21
  [`&.${_markElementClasses.markElementClasses.animate}`]: {
26
22
  transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
@@ -50,7 +46,9 @@ function CircleMarkElement(props) {
50
46
  color,
51
47
  dataIndex,
52
48
  onClick,
53
- skipAnimation
49
+ skipAnimation,
50
+ isFaded = false,
51
+ isHighlighted = false
54
52
  } = props,
55
53
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
56
54
  const theme = (0, _styles.useTheme)();
@@ -59,18 +57,10 @@ function CircleMarkElement(props) {
59
57
  seriesId: id,
60
58
  dataIndex
61
59
  });
62
- const {
63
- isFaded,
64
- isHighlighted
65
- } = (0, _useItemHighlighted.useItemHighlighted)({
66
- seriesId: id
67
- });
68
- const store = (0, _useStore.useStore)();
69
- const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
70
60
  const ownerState = {
71
61
  id,
72
62
  classes: innerClasses,
73
- isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
63
+ isHighlighted,
74
64
  isFaded,
75
65
  color,
76
66
  skipAnimation
@@ -14,6 +14,16 @@ export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighli
14
14
  * The index to the element in the series' data array.
15
15
  */
16
16
  dataIndex: number;
17
+ /**
18
+ * If `true`, the marker is faded.
19
+ * @default false
20
+ */
21
+ isFaded?: boolean;
22
+ /**
23
+ * If `true`, the marker is highlighted.
24
+ * @default false
25
+ */
26
+ isHighlighted?: boolean;
17
27
  };
18
28
  /**
19
29
  * Demos:
@@ -16,13 +16,9 @@ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
16
16
  var _animation = require("../internals/animation/animation");
17
17
  var _getSymbol = require("../internals/getSymbol");
18
18
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
19
- var _useItemHighlighted = require("../hooks/useItemHighlighted");
20
- var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
21
19
  var _markElementClasses = require("./markElementClasses");
22
- var _useSelector = require("../internals/store/useSelector");
23
- var _useStore = require("../internals/store/useStore");
24
20
  var _jsxRuntime = require("react/jsx-runtime");
25
- const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation"];
21
+ const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
26
22
  const MarkElementPath = (0, _styles.styled)('path', {
27
23
  name: 'MuiMarkElement',
28
24
  slot: 'Root'
@@ -59,7 +55,9 @@ function MarkElement(props) {
59
55
  shape,
60
56
  dataIndex,
61
57
  onClick,
62
- skipAnimation
58
+ skipAnimation,
59
+ isFaded = false,
60
+ isHighlighted = false
63
61
  } = props,
64
62
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
65
63
  const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)({
@@ -67,18 +65,10 @@ function MarkElement(props) {
67
65
  seriesId: id,
68
66
  dataIndex
69
67
  });
70
- const {
71
- isFaded,
72
- isHighlighted
73
- } = (0, _useItemHighlighted.useItemHighlighted)({
74
- seriesId: id
75
- });
76
- const store = (0, _useStore.useStore)();
77
- const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
78
68
  const ownerState = {
79
69
  id,
80
70
  classes: innerClasses,
81
- isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
71
+ isHighlighted,
82
72
  isFaded,
83
73
  color,
84
74
  skipAnimation
@@ -107,6 +97,16 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
107
97
  */
108
98
  dataIndex: _propTypes.default.number.isRequired,
109
99
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
100
+ /**
101
+ * If `true`, the marker is faded.
102
+ * @default false
103
+ */
104
+ isFaded: _propTypes.default.bool,
105
+ /**
106
+ * If `true`, the marker is highlighted.
107
+ * @default false
108
+ */
109
+ isHighlighted: _propTypes.default.bool,
110
110
  /**
111
111
  * The shape of the marker.
112
112
  */
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var React = _interopRequireWildcard(require("react"));
14
+ var _useChartCartesianInteraction = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors");
14
15
  var _constants = require("../constants");
15
16
  var _useSkipAnimation = require("../hooks/useSkipAnimation");
16
17
  var _useChartId = require("../hooks/useChartId");
@@ -23,6 +24,7 @@ var _MarkElement = require("./MarkElement");
23
24
  var _ChartProvider = require("../context/ChartProvider");
24
25
  var _hooks = require("../hooks");
25
26
  var _useInternalIsZoomInteracting = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting");
27
+ var _useSelector = require("../internals/store/useSelector");
26
28
  var _jsxRuntime = require("react/jsx-runtime");
27
29
  const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
28
30
  /**
@@ -56,8 +58,14 @@ function MarkPlot(props) {
56
58
  } = (0, _hooks.useYAxes)();
57
59
  const chartId = (0, _useChartId.useChartId)();
58
60
  const {
59
- instance
61
+ instance,
62
+ store
60
63
  } = (0, _ChartProvider.useChartContext)();
64
+ const {
65
+ isFaded,
66
+ isHighlighted
67
+ } = (0, _hooks.useItemHighlightedGetter)();
68
+ const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianInteraction.selectorChartsInteractionXAxisIndex);
61
69
  if (seriesData === undefined) {
62
70
  return null;
63
71
  }
@@ -93,6 +101,12 @@ function MarkPlot(props) {
93
101
 
94
102
  const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
95
103
  const Mark = slots?.mark ?? (shape === 'circle' ? _CircleMarkElement.CircleMarkElement : _MarkElement.MarkElement);
104
+ const isSeriesHighlighted = isHighlighted({
105
+ seriesId
106
+ });
107
+ const isSeriesFaded = !isSeriesHighlighted && isFaded({
108
+ seriesId
109
+ });
96
110
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
97
111
  clipPath: `url(#${clipId})`,
98
112
  children: xData?.map((x, index) => {
@@ -150,7 +164,9 @@ function MarkPlot(props) {
150
164
  type: 'line',
151
165
  seriesId,
152
166
  dataIndex: index
153
- }))
167
+ })),
168
+ isHighlighted: xAxisInteractionIndex === index || isSeriesHighlighted,
169
+ isFaded: isSeriesFaded
154
170
  }, slotProps?.mark), `${seriesId}-${index}`);
155
171
  })
156
172
  }, seriesId);
@@ -68,8 +68,7 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
68
68
  startAngle,
69
69
  endAngle,
70
70
  paddingAngle,
71
- innerRadius,
72
- outerRadius,
71
+ arcLabelRadius,
73
72
  cornerRadius,
74
73
  formattedArcLabel,
75
74
  isHighlighted,
@@ -90,8 +89,8 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
90
89
  cornerRadius,
91
90
  startAngle,
92
91
  endAngle,
93
- innerRadius,
94
- outerRadius,
92
+ innerRadius: arcLabelRadius,
93
+ outerRadius: arcLabelRadius,
95
94
  paddingAngle,
96
95
  skipAnimation,
97
96
  ref
@@ -86,6 +86,25 @@ export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series'
86
86
  * @default rainbowSurgePalette[0]
87
87
  */
88
88
  color?: ChartsColor;
89
+ /**
90
+ * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart.
91
+ *
92
+ * @default false
93
+ */
94
+ disableClipping?: boolean;
95
+ /**
96
+ * The clipped area offset in pixels.
97
+ *
98
+ * This prevents partial clipping of lines when they are drawn on the edge of the drawing area.
99
+ *
100
+ * @default { top: 1, right: 1, bottom: 1, left: 1 }
101
+ */
102
+ clipAreaOffset?: {
103
+ top?: number;
104
+ right?: number;
105
+ bottom?: number;
106
+ left?: number;
107
+ };
89
108
  }
90
109
  /**
91
110
  * Demos:
@@ -11,6 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
15
+ var _ChartsClipPath = require("../ChartsClipPath");
14
16
  var _BarChart = require("../BarChart");
15
17
  var _LineChart = require("../LineChart");
16
18
  var _ChartContainer = require("../ChartContainer");
@@ -18,7 +20,7 @@ var _constants = require("../constants");
18
20
  var _ChartsTooltip = require("../ChartsTooltip");
19
21
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
20
22
  var _jsxRuntime = require("react/jsx-runtime");
21
- const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
23
+ const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className", "disableClipping", "clipAreaOffset"];
22
24
  const SPARK_LINE_DEFAULT_MARGIN = 5;
23
25
 
24
26
  /**
@@ -50,9 +52,19 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
50
52
  valueFormatter = value => value === null ? '' : value.toString(),
51
53
  area,
52
54
  curve = 'linear',
53
- className
55
+ className,
56
+ disableClipping,
57
+ clipAreaOffset
54
58
  } = props,
55
59
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
60
+ const id = (0, _useId.default)();
61
+ const clipPathId = `${id}-clip-path`;
62
+ const clipPathOffset = {
63
+ top: clipAreaOffset?.top ?? 1,
64
+ right: clipAreaOffset?.right ?? 1,
65
+ bottom: clipAreaOffset?.bottom ?? 1,
66
+ left: clipAreaOffset?.left ?? 1
67
+ };
56
68
  const defaultXHighlight = showHighlight && plotType === 'bar' ? {
57
69
  x: 'band'
58
70
  } : {
@@ -99,23 +111,29 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
99
111
  colors: colors,
100
112
  sx: sx,
101
113
  disableAxisListener: (!showTooltip || slotProps?.tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
102
- children: [plotType === 'bar' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.BarPlot, {
103
- skipAnimation: true,
104
- slots: slots,
105
- slotProps: slotProps
106
- }), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
107
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.AreaPlot, {
108
- skipAnimation: true,
109
- slots: slots,
110
- slotProps: slotProps
111
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LinePlot, {
114
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
115
+ clipPath: `url(#${clipPathId})`,
116
+ children: [plotType === 'bar' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.BarPlot, {
112
117
  skipAnimation: true,
113
118
  slots: slots,
114
119
  slotProps: slotProps
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, {
116
- slots: slots,
117
- slotProps: slotProps
120
+ }), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
121
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.AreaPlot, {
122
+ skipAnimation: true,
123
+ slots: slots,
124
+ slotProps: slotProps
125
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LinePlot, {
126
+ skipAnimation: true,
127
+ slots: slots,
128
+ slotProps: slotProps
129
+ })]
118
130
  })]
131
+ }), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, {
132
+ slots: slots,
133
+ slotProps: slotProps
134
+ }), disableClipping ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
135
+ id: clipPathId,
136
+ offset: clipPathOffset
119
137
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip)), children]
120
138
  }));
121
139
  });
@@ -139,6 +157,19 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
139
157
  }),
140
158
  children: _propTypes.default.node,
141
159
  className: _propTypes.default.string,
160
+ /**
161
+ * The clipped area offset in pixels.
162
+ *
163
+ * This prevents partial clipping of lines when they are drawn on the edge of the drawing area.
164
+ *
165
+ * @default { top: 1, right: 1, bottom: 1, left: 1 }
166
+ */
167
+ clipAreaOffset: _propTypes.default.shape({
168
+ bottom: _propTypes.default.number,
169
+ left: _propTypes.default.number,
170
+ right: _propTypes.default.number,
171
+ top: _propTypes.default.number
172
+ }),
142
173
  /**
143
174
  * Color used to colorize the sparkline.
144
175
  * @default rainbowSurgePalette[0]
@@ -163,6 +194,12 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
163
194
  * @default false
164
195
  */
165
196
  disableAxisListener: _propTypes.default.bool,
197
+ /**
198
+ * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart.
199
+ *
200
+ * @default false
201
+ */
202
+ disableClipping: _propTypes.default.bool,
166
203
  /**
167
204
  * If true, the voronoi interaction are ignored.
168
205
  */
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ToolbarProps extends React.PropsWithChildren {}
3
+ export declare function Toolbar({
4
+ children
5
+ }: ToolbarProps): React.JSX.Element;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Toolbar = Toolbar;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _styles = require("@mui/material/styles");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ const ToolbarRoot = (0, _styles.styled)('div', {
12
+ name: 'MuiChartsToolbar',
13
+ slot: 'Root'
14
+ })(({
15
+ theme
16
+ }) => ({
17
+ flex: 0,
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ justifyContent: 'end',
21
+ gap: theme.spacing(0.25),
22
+ padding: theme.spacing(0.5),
23
+ minHeight: 44,
24
+ boxSizing: 'border-box',
25
+ border: `1px solid ${(theme.vars || theme).palette.divider}`,
26
+ borderRadius: 4
27
+ }));
28
+ function Toolbar({
29
+ children
30
+ }) {
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarRoot, {
32
+ children: children
33
+ });
34
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { ChartBaseIconButtonProps } from "../models/slots/chartsBaseSlotProps.js";
3
+ export interface ToolbarButtonProps extends ChartBaseIconButtonProps {}
4
+ declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
+ export { ToolbarButton };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ToolbarButton = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _material = require("../internals/material");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ const ToolbarButton = exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function ToolbarButton(props, ref) {
15
+ const IconButton = _material.defaultSlotsMaterial.baseIconButton;
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, (0, _extends2.default)({
17
+ ref: ref
18
+ }, props));
19
+ });
20
+ process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
21
+ // ----------------------------- Warning --------------------------------
22
+ // | These PropTypes are generated from the TypeScript type definitions |
23
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
24
+ // ----------------------------------------------------------------------
25
+ className: _propTypes.default.string,
26
+ style: _propTypes.default.object
27
+ } : void 0;
@@ -0,0 +1,2 @@
1
+ export * from "./Toolbar.js";
2
+ export * from "./ToolbarButton.js";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Toolbar = require("./Toolbar");
7
+ Object.keys(_Toolbar).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Toolbar[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Toolbar[key];
14
+ }
15
+ });
16
+ });
17
+ var _ToolbarButton = require("./ToolbarButton");
18
+ Object.keys(_ToolbarButton).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _ToolbarButton[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _ToolbarButton[key];
25
+ }
26
+ });
27
+ });
@@ -1,6 +1,14 @@
1
1
  import * as React from 'react';
2
2
  export type ChartsClipPathProps = {
3
+ /**
4
+ * The id of the clip path.
5
+ */
3
6
  id: string;
7
+ /**
8
+ * Offset, in pixels, of the clip path rectangle from the drawing area.
9
+ *
10
+ * A positive value will move the rectangle outside the drawing area.
11
+ */
4
12
  offset?: {
5
13
  top?: number;
6
14
  right?: number;