@mui/x-charts 7.5.0 → 7.6.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 (245) hide show
  1. package/BarChart/BarChart.js +30 -3
  2. package/BarChart/BarElement.d.ts +0 -3
  3. package/BarChart/BarElement.js +8 -19
  4. package/BarChart/BarLabel/BarLabel.d.ts +1342 -0
  5. package/BarChart/BarLabel/BarLabel.js +60 -0
  6. package/BarChart/BarLabel/BarLabel.types.d.ts +39 -0
  7. package/BarChart/BarLabel/BarLabel.types.js +5 -0
  8. package/BarChart/BarLabel/BarLabelItem.d.ts +53 -0
  9. package/BarChart/BarLabel/BarLabelItem.js +127 -0
  10. package/BarChart/BarLabel/BarLabelPlot.d.ts +16 -0
  11. package/BarChart/BarLabel/BarLabelPlot.js +106 -0
  12. package/BarChart/BarLabel/barLabelClasses.d.ts +13 -0
  13. package/BarChart/BarLabel/barLabelClasses.js +29 -0
  14. package/BarChart/BarLabel/getBarLabel.d.ts +10 -0
  15. package/BarChart/BarLabel/getBarLabel.js +31 -0
  16. package/BarChart/BarLabel/index.d.ts +6 -0
  17. package/BarChart/BarLabel/index.js +25 -0
  18. package/BarChart/BarPlot.d.ts +15 -4
  19. package/BarChart/BarPlot.js +22 -34
  20. package/BarChart/checkScaleErrors.d.ts +11 -0
  21. package/BarChart/checkScaleErrors.js +33 -0
  22. package/BarChart/index.d.ts +1 -0
  23. package/BarChart/index.js +11 -0
  24. package/BarChart/types.d.ts +0 -2
  25. package/CHANGELOG.md +148 -5418
  26. package/ChartContainer/ChartContainer.d.ts +3 -2
  27. package/ChartContainer/ChartContainer.js +20 -3
  28. package/ChartsAxis/ChartsAxis.js +1 -1
  29. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  30. package/ChartsClipPath/ChartsClipPath.js +1 -1
  31. package/ChartsGrid/ChartsGrid.js +1 -1
  32. package/ChartsLegend/ChartsLegend.js +1 -1
  33. package/ChartsLegend/DefaultChartsLegend.js +1 -1
  34. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  35. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  36. package/ChartsSurface.js +1 -1
  37. package/ChartsText/ChartsText.js +1 -1
  38. package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  39. package/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
  40. package/ChartsTooltip/ChartsTooltip.js +1 -1
  41. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  42. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  43. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
  44. package/ChartsXAxis/ChartsXAxis.js +1 -1
  45. package/ChartsYAxis/ChartsYAxis.js +1 -1
  46. package/Gauge/Gauge.js +1 -1
  47. package/Gauge/GaugeContainer.js +1 -1
  48. package/Gauge/GaugeValueText.js +1 -1
  49. package/LineChart/AnimatedArea.js +1 -1
  50. package/LineChart/AnimatedLine.js +1 -1
  51. package/LineChart/AreaElement.d.ts +0 -2
  52. package/LineChart/AreaElement.js +8 -18
  53. package/LineChart/AreaPlot.js +1 -3
  54. package/LineChart/LineChart.js +19 -2
  55. package/LineChart/LineElement.d.ts +0 -2
  56. package/LineChart/LineElement.js +8 -18
  57. package/LineChart/LineHighlightElement.js +1 -1
  58. package/LineChart/LineHighlightPlot.js +1 -1
  59. package/LineChart/LinePlot.js +1 -3
  60. package/LineChart/MarkElement.d.ts +0 -2
  61. package/LineChart/MarkElement.js +11 -33
  62. package/LineChart/MarkPlot.js +1 -2
  63. package/PieChart/PieArc.d.ts +4 -1
  64. package/PieChart/PieArc.js +8 -4
  65. package/PieChart/PieArcLabel.js +1 -1
  66. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  67. package/PieChart/PieArcLabelPlot.js +2 -8
  68. package/PieChart/PieArcPlot.d.ts +1 -1
  69. package/PieChart/PieArcPlot.js +6 -8
  70. package/PieChart/PieChart.js +19 -2
  71. package/PieChart/PiePlot.js +3 -7
  72. package/PieChart/dataTransform/useTransformData.d.ts +1 -1
  73. package/PieChart/dataTransform/useTransformData.js +10 -25
  74. package/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
  75. package/ScatterChart/Scatter.js +15 -11
  76. package/ScatterChart/ScatterChart.js +19 -2
  77. package/ScatterChart/ScatterPlot.js +1 -1
  78. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  79. package/SparkLineChart/SparkLineChart.js +14 -1
  80. package/context/HighlightedProvider/HighlightedContext.d.ts +65 -0
  81. package/context/HighlightedProvider/HighlightedContext.js +36 -0
  82. package/context/HighlightedProvider/HighlightedProvider.d.ts +20 -0
  83. package/context/HighlightedProvider/HighlightedProvider.js +97 -0
  84. package/context/HighlightedProvider/createIsFaded.d.ts +2 -0
  85. package/context/HighlightedProvider/createIsFaded.js +19 -0
  86. package/context/HighlightedProvider/createIsHighlighted.d.ts +2 -0
  87. package/context/HighlightedProvider/createIsHighlighted.js +19 -0
  88. package/context/HighlightedProvider/index.d.ts +4 -0
  89. package/context/HighlightedProvider/index.js +49 -0
  90. package/context/HighlightedProvider/useHighlighted.d.ts +9 -0
  91. package/context/HighlightedProvider/useHighlighted.js +24 -0
  92. package/context/HighlightedProvider/useItemHighlighted.d.ts +21 -0
  93. package/context/HighlightedProvider/useItemHighlighted.js +37 -0
  94. package/context/ZAxisContextProvider.js +1 -1
  95. package/context/index.d.ts +1 -1
  96. package/context/index.js +15 -0
  97. package/esm/BarChart/BarChart.js +30 -3
  98. package/esm/BarChart/BarElement.js +9 -20
  99. package/esm/BarChart/BarLabel/BarLabel.js +51 -0
  100. package/esm/BarChart/BarLabel/BarLabel.types.js +1 -0
  101. package/esm/BarChart/BarLabel/BarLabelItem.js +119 -0
  102. package/esm/BarChart/BarLabel/BarLabelPlot.js +98 -0
  103. package/esm/BarChart/BarLabel/barLabelClasses.js +19 -0
  104. package/esm/BarChart/BarLabel/getBarLabel.js +24 -0
  105. package/esm/BarChart/BarLabel/index.js +2 -0
  106. package/esm/BarChart/BarPlot.js +22 -34
  107. package/esm/BarChart/checkScaleErrors.js +27 -0
  108. package/esm/BarChart/index.js +2 -1
  109. package/esm/ChartContainer/ChartContainer.js +20 -3
  110. package/esm/ChartsAxis/ChartsAxis.js +1 -1
  111. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  112. package/esm/ChartsClipPath/ChartsClipPath.js +1 -1
  113. package/esm/ChartsGrid/ChartsGrid.js +1 -1
  114. package/esm/ChartsLegend/ChartsLegend.js +1 -1
  115. package/esm/ChartsLegend/DefaultChartsLegend.js +1 -1
  116. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  117. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  118. package/esm/ChartsSurface.js +1 -1
  119. package/esm/ChartsText/ChartsText.js +1 -1
  120. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  121. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
  122. package/esm/ChartsTooltip/ChartsTooltip.js +1 -1
  123. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  124. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  125. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
  126. package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
  127. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  128. package/esm/Gauge/Gauge.js +1 -1
  129. package/esm/Gauge/GaugeContainer.js +1 -1
  130. package/esm/Gauge/GaugeValueText.js +1 -1
  131. package/esm/LineChart/AnimatedArea.js +1 -1
  132. package/esm/LineChart/AnimatedLine.js +1 -1
  133. package/esm/LineChart/AreaElement.js +9 -19
  134. package/esm/LineChart/AreaPlot.js +1 -3
  135. package/esm/LineChart/LineChart.js +19 -2
  136. package/esm/LineChart/LineElement.js +9 -19
  137. package/esm/LineChart/LineHighlightElement.js +1 -1
  138. package/esm/LineChart/LineHighlightPlot.js +1 -1
  139. package/esm/LineChart/LinePlot.js +1 -3
  140. package/esm/LineChart/MarkElement.js +12 -34
  141. package/esm/LineChart/MarkPlot.js +1 -2
  142. package/esm/PieChart/PieArc.js +8 -4
  143. package/esm/PieChart/PieArcLabel.js +1 -1
  144. package/esm/PieChart/PieArcLabelPlot.js +2 -8
  145. package/esm/PieChart/PieArcPlot.js +6 -8
  146. package/esm/PieChart/PieChart.js +19 -2
  147. package/esm/PieChart/PiePlot.js +3 -7
  148. package/esm/PieChart/dataTransform/useTransformData.js +10 -25
  149. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
  150. package/esm/ScatterChart/Scatter.js +16 -12
  151. package/esm/ScatterChart/ScatterChart.js +19 -2
  152. package/esm/ScatterChart/ScatterPlot.js +1 -1
  153. package/esm/SparkLineChart/SparkLineChart.js +14 -1
  154. package/esm/context/HighlightedProvider/HighlightedContext.js +29 -0
  155. package/esm/context/HighlightedProvider/HighlightedProvider.js +89 -0
  156. package/esm/context/HighlightedProvider/createIsFaded.js +12 -0
  157. package/esm/context/HighlightedProvider/createIsHighlighted.js +12 -0
  158. package/esm/context/HighlightedProvider/index.js +4 -0
  159. package/esm/context/HighlightedProvider/useHighlighted.js +17 -0
  160. package/esm/context/HighlightedProvider/useItemHighlighted.js +29 -0
  161. package/esm/context/ZAxisContextProvider.js +1 -1
  162. package/esm/context/index.js +1 -0
  163. package/esm/hooks/useInteractionItemProps.js +9 -41
  164. package/hooks/useInteractionItemProps.d.ts +1 -4
  165. package/hooks/useInteractionItemProps.js +11 -45
  166. package/index.js +1 -1
  167. package/internals/colorScale.d.ts +1 -1
  168. package/internals/defaultizeColor.d.ts +13 -13
  169. package/models/seriesType/common.d.ts +4 -1
  170. package/modern/BarChart/BarChart.js +30 -3
  171. package/modern/BarChart/BarElement.js +9 -20
  172. package/modern/BarChart/BarLabel/BarLabel.js +51 -0
  173. package/modern/BarChart/BarLabel/BarLabel.types.js +1 -0
  174. package/modern/BarChart/BarLabel/BarLabelItem.js +119 -0
  175. package/modern/BarChart/BarLabel/BarLabelPlot.js +98 -0
  176. package/modern/BarChart/BarLabel/barLabelClasses.js +19 -0
  177. package/modern/BarChart/BarLabel/getBarLabel.js +24 -0
  178. package/modern/BarChart/BarLabel/index.js +2 -0
  179. package/modern/BarChart/BarPlot.js +22 -34
  180. package/modern/BarChart/checkScaleErrors.js +27 -0
  181. package/modern/BarChart/index.js +2 -1
  182. package/modern/ChartContainer/ChartContainer.js +20 -3
  183. package/modern/ChartsAxis/ChartsAxis.js +1 -1
  184. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  185. package/modern/ChartsClipPath/ChartsClipPath.js +1 -1
  186. package/modern/ChartsGrid/ChartsGrid.js +1 -1
  187. package/modern/ChartsLegend/ChartsLegend.js +1 -1
  188. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -1
  189. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  190. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  191. package/modern/ChartsSurface.js +1 -1
  192. package/modern/ChartsText/ChartsText.js +1 -1
  193. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  194. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
  195. package/modern/ChartsTooltip/ChartsTooltip.js +1 -1
  196. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  197. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  198. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
  199. package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
  200. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  201. package/modern/Gauge/Gauge.js +1 -1
  202. package/modern/Gauge/GaugeContainer.js +1 -1
  203. package/modern/Gauge/GaugeValueText.js +1 -1
  204. package/modern/LineChart/AnimatedArea.js +1 -1
  205. package/modern/LineChart/AnimatedLine.js +1 -1
  206. package/modern/LineChart/AreaElement.js +9 -19
  207. package/modern/LineChart/AreaPlot.js +1 -3
  208. package/modern/LineChart/LineChart.js +19 -2
  209. package/modern/LineChart/LineElement.js +9 -19
  210. package/modern/LineChart/LineHighlightElement.js +1 -1
  211. package/modern/LineChart/LineHighlightPlot.js +1 -1
  212. package/modern/LineChart/LinePlot.js +1 -3
  213. package/modern/LineChart/MarkElement.js +12 -34
  214. package/modern/LineChart/MarkPlot.js +1 -2
  215. package/modern/PieChart/PieArc.js +8 -4
  216. package/modern/PieChart/PieArcLabel.js +1 -1
  217. package/modern/PieChart/PieArcLabelPlot.js +2 -8
  218. package/modern/PieChart/PieArcPlot.js +6 -8
  219. package/modern/PieChart/PieChart.js +19 -2
  220. package/modern/PieChart/PiePlot.js +3 -7
  221. package/modern/PieChart/dataTransform/useTransformData.js +10 -25
  222. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
  223. package/modern/ScatterChart/Scatter.js +16 -12
  224. package/modern/ScatterChart/ScatterChart.js +19 -2
  225. package/modern/ScatterChart/ScatterPlot.js +1 -1
  226. package/modern/SparkLineChart/SparkLineChart.js +14 -1
  227. package/modern/context/HighlightedProvider/HighlightedContext.js +29 -0
  228. package/modern/context/HighlightedProvider/HighlightedProvider.js +89 -0
  229. package/modern/context/HighlightedProvider/createIsFaded.js +12 -0
  230. package/modern/context/HighlightedProvider/createIsHighlighted.js +12 -0
  231. package/modern/context/HighlightedProvider/index.js +4 -0
  232. package/modern/context/HighlightedProvider/useHighlighted.js +17 -0
  233. package/modern/context/HighlightedProvider/useItemHighlighted.js +29 -0
  234. package/modern/context/ZAxisContextProvider.js +1 -1
  235. package/modern/context/index.js +1 -0
  236. package/modern/hooks/useInteractionItemProps.js +9 -41
  237. package/modern/index.js +1 -1
  238. package/package.json +3 -3
  239. package/themeAugmentation/components.d.ts +4 -0
  240. package/themeAugmentation/overrides.d.ts +3 -0
  241. package/themeAugmentation/props.d.ts +2 -0
  242. package/context/HighlightProvider.d.ts +0 -45
  243. package/context/HighlightProvider.js +0 -60
  244. package/esm/context/HighlightProvider.js +0 -51
  245. package/modern/context/HighlightProvider.js +0 -51
@@ -61,7 +61,10 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
61
61
  children,
62
62
  slots,
63
63
  slotProps,
64
- loading
64
+ loading,
65
+ barLabel,
66
+ highlightedItem,
67
+ onHighlightChange
65
68
  } = props;
66
69
  const id = (0, _useId.default)();
67
70
  const clipPathId = `${id}-clip-path`;
@@ -97,6 +100,8 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
97
100
  dataset: dataset,
98
101
  sx: sx,
99
102
  disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
103
+ highlightedItem: highlightedItem,
104
+ onHighlightChange: onHighlightChange,
100
105
  children: [onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, {
101
106
  onAxisClick: onAxisClick
102
107
  }), grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, {
@@ -109,7 +114,8 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
109
114
  slotProps: slotProps,
110
115
  skipAnimation: skipAnimation,
111
116
  onItemClick: onItemClick,
112
- borderRadius: borderRadius
117
+ borderRadius: borderRadius,
118
+ barLabel: barLabel
113
119
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, {
114
120
  loading: loading,
115
121
  slots: slots,
@@ -136,7 +142,7 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
136
142
  process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
137
143
  // ----------------------------- Warning --------------------------------
138
144
  // | These PropTypes are generated from the TypeScript type definitions |
139
- // | To update them edit the TypeScript types and run "yarn proptypes" |
145
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
140
146
  // ----------------------------------------------------------------------
141
147
  /**
142
148
  * The configuration of axes highlight.
@@ -148,6 +154,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
148
154
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
149
155
  y: _propTypes.default.oneOf(['band', 'line', 'none'])
150
156
  }),
157
+ /**
158
+ * If provided, the function will be used to format the label of the bar.
159
+ * It can be set to 'value' to display the current value.
160
+ * @param {BarItem} item The item to format.
161
+ * @param {BarLabelContext} context data about the bar.
162
+ * @returns {string} The formatted label.
163
+ */
164
+ barLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['value']), _propTypes.default.func]),
151
165
  /**
152
166
  * Defines the border radius of the bar element.
153
167
  */
@@ -187,6 +201,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
187
201
  * The height of the chart in px. If not defined, it takes the height of the parent element.
188
202
  */
189
203
  height: _propTypes.default.number,
204
+ /**
205
+ * The item currently highlighted. Turns highlighting into a controlled prop.
206
+ */
207
+ highlightedItem: _propTypes.default.shape({
208
+ dataIndex: _propTypes.default.number,
209
+ seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
210
+ }),
190
211
  /**
191
212
  * The direction of the bar elements.
192
213
  * @default 'vertical'
@@ -236,6 +257,12 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
236
257
  * @param {null | AxisData} data The data about the clicked axis and items associated with it.
237
258
  */
238
259
  onAxisClick: _propTypes.default.func,
260
+ /**
261
+ * The callback fired when the highlighted item changes.
262
+ *
263
+ * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
264
+ */
265
+ onHighlightChange: _propTypes.default.func,
239
266
  /**
240
267
  * Callback fired when a bar item is clicked.
241
268
  * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
@@ -1,7 +1,6 @@
1
1
  /// <reference types="@react-spring/shared" />
2
2
  import * as React from 'react';
3
3
  import { AnimatedProps } from '@react-spring/web';
4
- import { HighlightScope } from '../context/HighlightProvider';
5
4
  import { SeriesId } from '../models/seriesType/common';
6
5
  export interface BarElementClasses {
7
6
  /** Styles applied to the root element. */
@@ -1359,7 +1358,6 @@ interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'color' |
1359
1358
  height?: string | number | undefined;
1360
1359
  width?: string | number | undefined;
1361
1360
  }> {
1362
- highlightScope?: Partial<HighlightScope>;
1363
1361
  ownerState: BarElementOwnerState;
1364
1362
  }
1365
1363
  export interface BarElementSlots {
@@ -1373,7 +1371,6 @@ export interface BarElementSlotProps {
1373
1371
  bar?: Partial<BarProps>;
1374
1372
  }
1375
1373
  export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.SVGProps<SVGRectElement>, 'ref' | 'id'> & {
1376
- highlightScope?: Partial<HighlightScope>;
1377
1374
  /**
1378
1375
  * The props used for each component slot.
1379
1376
  * @default {}
@@ -19,9 +19,9 @@ var _d3Color = require("d3-color");
19
19
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
20
20
  var _web = require("@react-spring/web");
21
21
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
22
- var _InteractionProvider = require("../context/InteractionProvider");
22
+ var _context = require("../context");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
24
- const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style", "onClick"];
24
+ const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick"];
25
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
26
26
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
27
  function getBarElementUtilityClass(slot) {
@@ -56,27 +56,20 @@ function BarElement(props) {
56
56
  dataIndex,
57
57
  classes: innerClasses,
58
58
  color,
59
- highlightScope,
60
59
  slots,
61
60
  slotProps,
62
61
  style,
63
62
  onClick
64
63
  } = props,
65
64
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
66
- const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(highlightScope);
65
+ const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)();
67
66
  const {
68
- item
69
- } = React.useContext(_InteractionProvider.InteractionContext);
70
- const isHighlighted = (0, _useInteractionItemProps.getIsHighlighted)(item, {
71
- type: 'bar',
72
- seriesId: id,
73
- dataIndex
74
- }, highlightScope);
75
- const isFaded = !isHighlighted && (0, _useInteractionItemProps.getIsFaded)(item, {
76
- type: 'bar',
67
+ isFaded,
68
+ isHighlighted
69
+ } = (0, _context.useItemHighlighted)({
77
70
  seriesId: id,
78
71
  dataIndex
79
- }, highlightScope);
72
+ });
80
73
  const ownerState = {
81
74
  id,
82
75
  dataIndex,
@@ -108,14 +101,10 @@ function BarElement(props) {
108
101
  process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
109
102
  // ----------------------------- Warning --------------------------------
110
103
  // | These PropTypes are generated from the TypeScript type definitions |
111
- // | To update them edit the TypeScript types and run "yarn proptypes" |
104
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
112
105
  // ----------------------------------------------------------------------
113
106
  classes: _propTypes.default.object,
114
107
  dataIndex: _propTypes.default.number.isRequired,
115
- highlightScope: _propTypes.default.shape({
116
- faded: _propTypes.default.oneOf(['global', 'none', 'series']),
117
- highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
118
- }),
119
108
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
120
109
  /**
121
110
  * The props used for each component slot.