@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
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style", "onClick"];
3
+ const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import composeClasses from '@mui/utils/composeClasses';
@@ -10,8 +10,8 @@ import { styled } from '@mui/material/styles';
10
10
  import { color as d3Color } from 'd3-color';
11
11
  import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
12
12
  import { animated } from '@react-spring/web';
13
- import { getIsFaded, getIsHighlighted, useInteractionItemProps } from '../hooks/useInteractionItemProps';
14
- import { InteractionContext } from '../context/InteractionProvider';
13
+ import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
14
+ import { useItemHighlighted } from '../context';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  export function getBarElementUtilityClass(slot) {
17
17
  return generateUtilityClass('MuiBarElement', slot);
@@ -45,27 +45,20 @@ function BarElement(props) {
45
45
  dataIndex,
46
46
  classes: innerClasses,
47
47
  color,
48
- highlightScope,
49
48
  slots,
50
49
  slotProps,
51
50
  style,
52
51
  onClick
53
52
  } = props,
54
53
  other = _objectWithoutPropertiesLoose(props, _excluded);
55
- const getInteractionItemProps = useInteractionItemProps(highlightScope);
54
+ const getInteractionItemProps = useInteractionItemProps();
56
55
  const {
57
- item
58
- } = React.useContext(InteractionContext);
59
- const isHighlighted = getIsHighlighted(item, {
60
- type: 'bar',
61
- seriesId: id,
62
- dataIndex
63
- }, highlightScope);
64
- const isFaded = !isHighlighted && getIsFaded(item, {
65
- type: 'bar',
56
+ isFaded,
57
+ isHighlighted
58
+ } = useItemHighlighted({
66
59
  seriesId: id,
67
60
  dataIndex
68
- }, highlightScope);
61
+ });
69
62
  const ownerState = {
70
63
  id,
71
64
  dataIndex,
@@ -97,14 +90,10 @@ function BarElement(props) {
97
90
  process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
98
91
  // ----------------------------- Warning --------------------------------
99
92
  // | These PropTypes are generated from the TypeScript type definitions |
100
- // | To update them edit the TypeScript types and run "yarn proptypes" |
93
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
101
94
  // ----------------------------------------------------------------------
102
95
  classes: PropTypes.object,
103
96
  dataIndex: PropTypes.number.isRequired,
104
- highlightScope: PropTypes.shape({
105
- faded: PropTypes.oneOf(['global', 'none', 'series']),
106
- highlighted: PropTypes.oneOf(['item', 'none', 'series'])
107
- }),
108
97
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
109
98
  /**
110
99
  * The props used for each component slot.
@@ -0,0 +1,51 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
4
+ import * as React from 'react';
5
+ import { styled, useThemeProps } from '@mui/material/styles';
6
+ import { animated } from '@react-spring/web';
7
+ import PropTypes from 'prop-types';
8
+ import { barLabelClasses } from './barLabelClasses';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export const BarLabelComponent = styled(animated.text, {
11
+ name: 'MuiBarLabel',
12
+ slot: 'Root',
13
+ overridesResolver: (_, styles) => [{
14
+ [`&.${barLabelClasses.faded}`]: styles.faded
15
+ }, {
16
+ [`&.${barLabelClasses.highlighted}`]: styles.highlighted
17
+ }, styles.root]
18
+ })(({
19
+ theme
20
+ }) => _extends({}, theme?.typography?.body2, {
21
+ stroke: 'none',
22
+ fill: (theme.vars || theme)?.palette?.text?.primary,
23
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
24
+ textAnchor: 'middle',
25
+ dominantBaseline: 'central',
26
+ pointerEvents: 'none',
27
+ opacity: 1,
28
+ [`&.${barLabelClasses.faded}`]: {
29
+ opacity: 0.3
30
+ }
31
+ }));
32
+ function BarLabel(props) {
33
+ const themeProps = useThemeProps({
34
+ props,
35
+ name: 'MuiBarLabel'
36
+ });
37
+ const otherProps = _objectWithoutPropertiesLoose(themeProps, _excluded);
38
+ return /*#__PURE__*/_jsx(BarLabelComponent, _extends({}, otherProps));
39
+ }
40
+ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
41
+ // ----------------------------- Warning --------------------------------
42
+ // | These PropTypes are generated from the TypeScript type definitions |
43
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
44
+ // ----------------------------------------------------------------------
45
+ classes: PropTypes.object,
46
+ dataIndex: PropTypes.number.isRequired,
47
+ isFaded: PropTypes.bool.isRequired,
48
+ isHighlighted: PropTypes.bool.isRequired,
49
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
50
+ } : void 0;
51
+ export { BarLabel };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,119 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["seriesId", "classes", "color", "style", "dataIndex", "barLabel", "slots", "slotProps", "height", "width", "value"],
4
+ _excluded2 = ["ownerState"];
5
+ import * as React from 'react';
6
+ import { useSlotProps } from '@mui/base/utils';
7
+ import PropTypes from 'prop-types';
8
+ import { useUtilityClasses } from './barLabelClasses';
9
+ import { getBarLabel } from './getBarLabel';
10
+ import { BarLabel } from './BarLabel';
11
+ import { useItemHighlighted } from '../../context';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * @ignore - internal component.
15
+ */
16
+ function BarLabelItem(props) {
17
+ const {
18
+ seriesId,
19
+ classes: innerClasses,
20
+ color,
21
+ style,
22
+ dataIndex,
23
+ barLabel,
24
+ slots,
25
+ slotProps,
26
+ height,
27
+ width,
28
+ value
29
+ } = props,
30
+ other = _objectWithoutPropertiesLoose(props, _excluded);
31
+ const {
32
+ isFaded,
33
+ isHighlighted
34
+ } = useItemHighlighted({
35
+ seriesId,
36
+ dataIndex
37
+ });
38
+ const ownerState = {
39
+ seriesId,
40
+ classes: innerClasses,
41
+ color,
42
+ isFaded,
43
+ isHighlighted,
44
+ dataIndex
45
+ };
46
+ const classes = useUtilityClasses(ownerState);
47
+ const Component = slots?.barLabel ?? BarLabel;
48
+ const _useSlotProps = useSlotProps({
49
+ elementType: Component,
50
+ externalSlotProps: slotProps?.barLabel,
51
+ additionalProps: _extends({}, other, {
52
+ style,
53
+ className: classes.root
54
+ }),
55
+ ownerState
56
+ }),
57
+ {
58
+ ownerState: barLabelOwnerState
59
+ } = _useSlotProps,
60
+ barLabelProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
61
+ if (!barLabel) {
62
+ return null;
63
+ }
64
+ const formattedLabelText = getBarLabel({
65
+ barLabel,
66
+ value,
67
+ dataIndex,
68
+ seriesId,
69
+ height,
70
+ width
71
+ });
72
+ if (!formattedLabelText) {
73
+ return null;
74
+ }
75
+ return /*#__PURE__*/_jsx(Component, _extends({}, barLabelProps, barLabelOwnerState, {
76
+ children: formattedLabelText
77
+ }));
78
+ }
79
+ process.env.NODE_ENV !== "production" ? BarLabelItem.propTypes = {
80
+ // ----------------------------- Warning --------------------------------
81
+ // | These PropTypes are generated from the TypeScript type definitions |
82
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
83
+ // ----------------------------------------------------------------------
84
+ /**
85
+ * If provided, the function will be used to format the label of the bar.
86
+ * It can be set to 'value' to display the current value.
87
+ * @param {BarItem} item The item to format.
88
+ * @param {BarLabelContext} context data about the bar.
89
+ * @returns {string} The formatted label.
90
+ */
91
+ barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
92
+ classes: PropTypes.object,
93
+ color: PropTypes.string.isRequired,
94
+ dataIndex: PropTypes.number.isRequired,
95
+ /**
96
+ * The height of the bar.
97
+ */
98
+ height: PropTypes.number.isRequired,
99
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
100
+ /**
101
+ * The props used for each component slot.
102
+ * @default {}
103
+ */
104
+ slotProps: PropTypes.object,
105
+ /**
106
+ * Overridable component slots.
107
+ * @default {}
108
+ */
109
+ slots: PropTypes.object,
110
+ /**
111
+ * The value of the data point.
112
+ */
113
+ value: PropTypes.number,
114
+ /**
115
+ * The width of the bar.
116
+ */
117
+ width: PropTypes.number.isRequired
118
+ } : void 0;
119
+ export { BarLabelItem };
@@ -0,0 +1,98 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["bars", "skipAnimation"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { useTransition } from '@react-spring/web';
7
+ import { BarLabelItem } from './BarLabelItem';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ const leaveStyle = ({
10
+ layout,
11
+ yOrigin,
12
+ x,
13
+ width,
14
+ y,
15
+ xOrigin,
16
+ height
17
+ }) => _extends({}, layout === 'vertical' ? {
18
+ y: yOrigin,
19
+ x: x + width / 2,
20
+ height: 0,
21
+ width
22
+ } : {
23
+ y: y + height / 2,
24
+ x: xOrigin,
25
+ height,
26
+ width: 0
27
+ });
28
+ const enterStyle = ({
29
+ x,
30
+ width,
31
+ y,
32
+ height
33
+ }) => ({
34
+ x: x + width / 2,
35
+ y: y + height / 2,
36
+ height,
37
+ width
38
+ });
39
+ /**
40
+ * @ignore - internal component.
41
+ */
42
+ function BarLabelPlot(props) {
43
+ const {
44
+ bars,
45
+ skipAnimation
46
+ } = props,
47
+ other = _objectWithoutPropertiesLoose(props, _excluded);
48
+ const barLabelTransition = useTransition(bars, {
49
+ keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
50
+ from: leaveStyle,
51
+ leave: null,
52
+ enter: enterStyle,
53
+ update: enterStyle,
54
+ immediate: skipAnimation
55
+ });
56
+ return /*#__PURE__*/_jsx(React.Fragment, {
57
+ children: barLabelTransition((style, {
58
+ seriesId,
59
+ dataIndex,
60
+ color,
61
+ value,
62
+ width,
63
+ height
64
+ }) => /*#__PURE__*/_jsx(BarLabelItem, _extends({
65
+ seriesId: seriesId,
66
+ dataIndex: dataIndex,
67
+ value: value,
68
+ color: color,
69
+ width: width,
70
+ height: height
71
+ }, other, {
72
+ style: style
73
+ })))
74
+ });
75
+ }
76
+ process.env.NODE_ENV !== "production" ? BarLabelPlot.propTypes = {
77
+ // ----------------------------- Warning --------------------------------
78
+ // | These PropTypes are generated from the TypeScript type definitions |
79
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
80
+ // ----------------------------------------------------------------------
81
+ barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
82
+ bars: PropTypes.arrayOf(PropTypes.shape({
83
+ color: PropTypes.string.isRequired,
84
+ dataIndex: PropTypes.number.isRequired,
85
+ height: PropTypes.number.isRequired,
86
+ layout: PropTypes.oneOf(['horizontal', 'vertical']),
87
+ maskId: PropTypes.string.isRequired,
88
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
89
+ value: PropTypes.number,
90
+ width: PropTypes.number.isRequired,
91
+ x: PropTypes.number.isRequired,
92
+ xOrigin: PropTypes.number.isRequired,
93
+ y: PropTypes.number.isRequired,
94
+ yOrigin: PropTypes.number.isRequired
95
+ })).isRequired,
96
+ skipAnimation: PropTypes.bool
97
+ } : void 0;
98
+ export { BarLabelPlot };
@@ -0,0 +1,19 @@
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
+ import composeClasses from '@mui/utils/composeClasses';
4
+ export function getBarLabelUtilityClass(slot) {
5
+ return generateUtilityClass('MuiBarLabel', slot);
6
+ }
7
+ export const barLabelClasses = generateUtilityClasses('MuiBarLabel', ['root', 'highlighted', 'faded']);
8
+ export const useUtilityClasses = ownerState => {
9
+ const {
10
+ classes,
11
+ seriesId,
12
+ isFaded,
13
+ isHighlighted
14
+ } = ownerState;
15
+ const slots = {
16
+ root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
17
+ };
18
+ return composeClasses(slots, getBarLabelUtilityClass, classes);
19
+ };
@@ -0,0 +1,24 @@
1
+ export const getBarLabel = options => {
2
+ const {
3
+ barLabel,
4
+ value,
5
+ dataIndex,
6
+ seriesId,
7
+ height,
8
+ width
9
+ } = options;
10
+ if (barLabel === 'value') {
11
+ // We don't want to show the label if the value is 0
12
+ return value ? value?.toString() : null;
13
+ }
14
+ return barLabel({
15
+ seriesId,
16
+ dataIndex,
17
+ value
18
+ }, {
19
+ bar: {
20
+ height,
21
+ width
22
+ }
23
+ });
24
+ };
@@ -0,0 +1,2 @@
1
+ export { BarLabel } from './BarLabel';
2
+ export { barLabelClasses, getBarLabelUtilityClass } from './barLabelClasses';
@@ -1,17 +1,17 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["skipAnimation", "onItemClick", "borderRadius"];
3
+ const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useTransition } from '@react-spring/web';
7
7
  import { SeriesContext } from '../context/SeriesContextProvider';
8
8
  import { CartesianContext } from '../context/CartesianContextProvider';
9
9
  import { BarElement } from './BarElement';
10
- import { isBandScaleConfig, isPointScaleConfig } from '../models/axis';
11
- import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
12
10
  import getColor from './getColor';
13
11
  import { useChartId } from '../hooks';
14
12
  import { BarClipPath } from './BarClipPath';
13
+ import { BarLabelPlot } from './BarLabel/BarLabelPlot';
14
+ import { checkScaleErrors } from './checkScaleErrors';
15
15
 
16
16
  /**
17
17
  * Solution of the equations
@@ -71,30 +71,8 @@ const useAggregatedData = () => {
71
71
  const xAxisConfig = xAxis[xAxisKey];
72
72
  const yAxisConfig = yAxis[yAxisKey];
73
73
  const verticalLayout = series[seriesId].layout === 'vertical';
74
- let baseScaleConfig;
75
- if (verticalLayout) {
76
- if (!isBandScaleConfig(xAxisConfig)) {
77
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should be of type "band" to display the bar series of id "${seriesId}".`);
78
- }
79
- if (xAxis[xAxisKey].data === undefined) {
80
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property.`);
81
- }
82
- baseScaleConfig = xAxisConfig;
83
- if (isBandScaleConfig(yAxisConfig) || isPointScaleConfig(yAxisConfig)) {
84
- throw new Error(`MUI X Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should be a continuous type to display the bar series of id "${seriesId}".`);
85
- }
86
- } else {
87
- if (!isBandScaleConfig(yAxisConfig)) {
88
- throw new Error(`MUI X Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should be of type "band" to display the bar series of id "${seriesId}".`);
89
- }
90
- if (yAxis[yAxisKey].data === undefined) {
91
- throw new Error(`MUI X Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should have data property.`);
92
- }
93
- baseScaleConfig = yAxisConfig;
94
- if (isBandScaleConfig(xAxisConfig) || isPointScaleConfig(xAxisConfig)) {
95
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should be a continuous type to display the bar series of id "${seriesId}".`);
96
- }
97
- }
74
+ checkScaleErrors(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis);
75
+ const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
98
76
  const xScale = xAxisConfig.scale;
99
77
  const yScale = yAxisConfig.scale;
100
78
  const colorGetter = getColor(series[seriesId], xAxis[xAxisKey], yAxis[yAxisKey]);
@@ -127,7 +105,6 @@ const useAggregatedData = () => {
127
105
  height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
128
106
  width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
129
107
  color: colorGetter(dataIndex),
130
- highlightScope: series[seriesId].highlightScope,
131
108
  value: series[seriesId].data[dataIndex],
132
109
  maskId: `${chartId}_${stackId || seriesId}_${groupIndex}_${dataIndex}`
133
110
  };
@@ -211,7 +188,8 @@ function BarPlot(props) {
211
188
  const {
212
189
  skipAnimation,
213
190
  onItemClick,
214
- borderRadius
191
+ borderRadius,
192
+ barLabel
215
193
  } = props,
216
194
  other = _objectWithoutPropertiesLoose(props, _excluded);
217
195
  const transition = useTransition(completedData, {
@@ -249,14 +227,12 @@ function BarPlot(props) {
249
227
  seriesId,
250
228
  dataIndex,
251
229
  color,
252
- highlightScope,
253
230
  maskId
254
231
  }) => {
255
232
  const barElement = /*#__PURE__*/_jsx(BarElement, _extends({
256
233
  id: seriesId,
257
234
  dataIndex: dataIndex,
258
- color: color,
259
- highlightScope: highlightScope
235
+ color: color
260
236
  }, other, {
261
237
  onClick: onItemClick && (event => {
262
238
  onItemClick(event, {
@@ -274,14 +250,26 @@ function BarPlot(props) {
274
250
  clipPath: `url(#${maskId})`,
275
251
  children: barElement
276
252
  });
277
- })]
253
+ }), barLabel && /*#__PURE__*/_jsx(BarLabelPlot, _extends({
254
+ bars: completedData,
255
+ skipAnimation: skipAnimation,
256
+ barLabel: barLabel
257
+ }, other))]
278
258
  });
279
259
  }
280
260
  process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
281
261
  // ----------------------------- Warning --------------------------------
282
262
  // | These PropTypes are generated from the TypeScript type definitions |
283
- // | To update them edit the TypeScript types and run "yarn proptypes" |
263
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
284
264
  // ----------------------------------------------------------------------
265
+ /**
266
+ * If provided, the function will be used to format the label of the bar.
267
+ * It can be set to 'value' to display the current value.
268
+ * @param {BarItem} item The item to format.
269
+ * @param {BarLabelContext} context data about the bar.
270
+ * @returns {string} The formatted label.
271
+ */
272
+ barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
285
273
  /**
286
274
  * Defines the border radius of the bar element.
287
275
  */
@@ -0,0 +1,27 @@
1
+ import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
2
+ import { isBandScaleConfig, isPointScaleConfig } from '../models/axis';
3
+ const getAxisMessage = (axisDirection, axisKey) => {
4
+ const axisName = `${axisDirection}-axis`;
5
+ const axisKeyName = `${axisDirection}Axis`;
6
+ const axisDefaultKey = axisDirection === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY;
7
+ return axisKey === axisDefaultKey ? `The first \`${axisKeyName}\`` : `The ${axisName} with id "${axisKey}"`;
8
+ };
9
+ export function checkScaleErrors(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis) {
10
+ const xAxisConfig = xAxis[xAxisKey];
11
+ const yAxisConfig = yAxis[yAxisKey];
12
+ const discreteAxisConfig = verticalLayout ? xAxisConfig : yAxisConfig;
13
+ const continuousAxisConfig = verticalLayout ? yAxisConfig : xAxisConfig;
14
+ const discreteAxisKey = verticalLayout ? xAxisKey : yAxisKey;
15
+ const continuousAxisKey = verticalLayout ? yAxisKey : xAxisKey;
16
+ const discreteAxisDirection = verticalLayout ? 'x' : 'y';
17
+ const continuousAxisDirection = verticalLayout ? 'y' : 'x';
18
+ if (!isBandScaleConfig(discreteAxisConfig)) {
19
+ throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should be of type "band" to display the bar series of id "${seriesId}".`);
20
+ }
21
+ if (discreteAxisConfig.data === undefined) {
22
+ throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should have data property.`);
23
+ }
24
+ if (isBandScaleConfig(continuousAxisConfig) || isPointScaleConfig(continuousAxisConfig)) {
25
+ throw new Error(`MUI X Charts: ${getAxisMessage(continuousAxisDirection, continuousAxisKey)} should be a continuous type to display the bar series of id "${seriesId}".`);
26
+ }
27
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './BarChart';
2
2
  export * from './BarPlot';
3
- export * from './BarElement';
3
+ export * from './BarElement';
4
+ export * from './BarLabel';
@@ -7,8 +7,8 @@ import { InteractionProvider } from '../context/InteractionProvider';
7
7
  import { useReducedMotion } from '../hooks/useReducedMotion';
8
8
  import { ChartsSurface } from '../ChartsSurface';
9
9
  import { CartesianContextProvider } from '../context/CartesianContextProvider';
10
- import { HighlightProvider } from '../context/HighlightProvider';
11
10
  import { ChartsAxesGradients } from '../internals/components/ChartsAxesGradients';
11
+ import { HighlightedProvider } from '../context';
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
14
14
  const {
@@ -24,6 +24,8 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
24
24
  title,
25
25
  desc,
26
26
  disableAxisListener,
27
+ highlightedItem,
28
+ onHighlightChange,
27
29
  children
28
30
  } = props;
29
31
  const svgRef = React.useRef(null);
@@ -44,7 +46,9 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
44
46
  yAxis: yAxis,
45
47
  dataset: dataset,
46
48
  children: /*#__PURE__*/_jsx(InteractionProvider, {
47
- children: /*#__PURE__*/_jsx(HighlightProvider, {
49
+ children: /*#__PURE__*/_jsx(HighlightedProvider, {
50
+ highlightedItem: highlightedItem,
51
+ onHighlightChange: onHighlightChange,
48
52
  children: /*#__PURE__*/_jsxs(ChartsSurface, {
49
53
  width: width,
50
54
  height: height,
@@ -64,7 +68,7 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
64
68
  process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
65
69
  // ----------------------------- Warning --------------------------------
66
70
  // | These PropTypes are generated from the TypeScript type definitions |
67
- // | To update them edit the TypeScript types and run "yarn proptypes" |
71
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
68
72
  // ----------------------------------------------------------------------
69
73
  children: PropTypes.node,
70
74
  className: PropTypes.string,
@@ -88,6 +92,13 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
88
92
  * The height of the chart in px.
89
93
  */
90
94
  height: PropTypes.number.isRequired,
95
+ /**
96
+ * The item currently highlighted. Turns highlighting into a controlled prop.
97
+ */
98
+ highlightedItem: PropTypes.shape({
99
+ dataIndex: PropTypes.number,
100
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
101
+ }),
91
102
  /**
92
103
  * The margin between the SVG and the drawing area.
93
104
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -100,6 +111,12 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
100
111
  right: PropTypes.number,
101
112
  top: PropTypes.number
102
113
  }),
114
+ /**
115
+ * The callback fired when the highlighted item changes.
116
+ *
117
+ * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
118
+ */
119
+ onHighlightChange: PropTypes.func,
103
120
  /**
104
121
  * The array of series to display.
105
122
  * Each type of series has its own specificity.
@@ -91,7 +91,7 @@ function ChartsAxis(props) {
91
91
  process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
92
92
  // ----------------------------- Warning --------------------------------
93
93
  // | These PropTypes are generated from the TypeScript type definitions |
94
- // | To update them edit the TypeScript types and run "yarn proptypes" |
94
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
95
95
  // ----------------------------------------------------------------------
96
96
  /**
97
97
  * Indicate which axis to display the bottom of the charts.
@@ -97,7 +97,7 @@ function ChartsAxisHighlight(props) {
97
97
  process.env.NODE_ENV !== "production" ? ChartsAxisHighlight.propTypes = {
98
98
  // ----------------------------- Warning --------------------------------
99
99
  // | These PropTypes are generated from the TypeScript type definitions |
100
- // | To update them edit the TypeScript types and run "yarn proptypes" |
100
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
101
101
  // ----------------------------------------------------------------------
102
102
  x: PropTypes.oneOf(['band', 'line', 'none']),
103
103
  y: PropTypes.oneOf(['band', 'line', 'none'])
@@ -38,7 +38,7 @@ function ChartsClipPath(props) {
38
38
  process.env.NODE_ENV !== "production" ? ChartsClipPath.propTypes = {
39
39
  // ----------------------------- Warning --------------------------------
40
40
  // | These PropTypes are generated from the TypeScript type definitions |
41
- // | To update them edit the TypeScript types and run "yarn proptypes" |
41
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
42
42
  // ----------------------------------------------------------------------
43
43
  id: PropTypes.string.isRequired,
44
44
  offset: PropTypes.shape({
@@ -113,7 +113,7 @@ function ChartsGrid(props) {
113
113
  process.env.NODE_ENV !== "production" ? ChartsGrid.propTypes = {
114
114
  // ----------------------------- Warning --------------------------------
115
115
  // | These PropTypes are generated from the TypeScript type definitions |
116
- // | To update them edit the TypeScript types and run "yarn proptypes" |
116
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
117
117
  // ----------------------------------------------------------------------
118
118
  /**
119
119
  * Override or extend the styles applied to the component.
@@ -69,7 +69,7 @@ function ChartsLegend(inProps) {
69
69
  process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
70
70
  // ----------------------------- Warning --------------------------------
71
71
  // | These PropTypes are generated from the TypeScript type definitions |
72
- // | To update them edit the TypeScript types and run "yarn proptypes" |
72
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
73
73
  // ----------------------------------------------------------------------
74
74
  /**
75
75
  * Override or extend the styles applied to the component.
@@ -204,7 +204,7 @@ function DefaultChartsLegend(props) {
204
204
  process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
205
205
  // ----------------------------- Warning --------------------------------
206
206
  // | These PropTypes are generated from the TypeScript type definitions |
207
- // | To update them edit the TypeScript types and run "yarn proptypes" |
207
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
208
208
  // ----------------------------------------------------------------------
209
209
  /**
210
210
  * Override or extend the styles applied to the component.