@mui/x-charts 6.18.1 → 6.18.3

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 (125) hide show
  1. package/BarChart/BarElement.d.ts +5 -1
  2. package/BarChart/BarElement.js +24 -1
  3. package/BarChart/index.d.ts +3 -2
  4. package/BarChart/index.js +31 -12
  5. package/CHANGELOG.md +112 -0
  6. package/ChartsLegend/index.d.ts +1 -0
  7. package/ChartsLegend/index.js +11 -0
  8. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +6 -3
  9. package/ChartsTooltip/ChartsAxisTooltipContent.js +93 -69
  10. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +6 -3
  11. package/ChartsTooltip/ChartsItemTooltipContent.js +38 -53
  12. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  13. package/ChartsTooltip/ChartsTooltip.js +13 -5
  14. package/ChartsTooltip/ChartsTooltipTable.js +3 -3
  15. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +7 -0
  16. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +174 -0
  17. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +8 -0
  18. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +99 -0
  19. package/ChartsTooltip/chartsTooltipClasses.d.ts +21 -0
  20. package/ChartsTooltip/chartsTooltipClasses.js +12 -0
  21. package/ChartsTooltip/index.d.ts +5 -0
  22. package/ChartsTooltip/index.js +55 -0
  23. package/ChartsTooltip/utils.d.ts +1 -1
  24. package/ChartsTooltip/utils.js +2 -2
  25. package/ChartsYAxis/ChartsYAxis.js +6 -4
  26. package/LineChart/extremums.js +25 -8
  27. package/LineChart/index.d.ts +5 -5
  28. package/LineChart/index.js +50 -41
  29. package/PieChart/PieArc.d.ts +5 -2
  30. package/PieChart/PieArc.js +17 -2
  31. package/PieChart/PieArcLabel.d.ts +1 -1
  32. package/PieChart/PieArcLabel.js +5 -10
  33. package/PieChart/PieArcLabelPlot.d.ts +5 -1
  34. package/PieChart/PieArcLabelPlot.js +91 -3
  35. package/PieChart/PieArcPlot.d.ts +5 -1
  36. package/PieChart/PieArcPlot.js +90 -3
  37. package/PieChart/index.d.ts +4 -2
  38. package/PieChart/index.js +42 -18
  39. package/ScatterChart/Scatter.js +1 -1
  40. package/ScatterChart/index.d.ts +3 -3
  41. package/ScatterChart/index.js +31 -19
  42. package/esm/BarChart/BarElement.js +26 -2
  43. package/esm/BarChart/index.js +3 -2
  44. package/esm/ChartsLegend/index.js +2 -1
  45. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +95 -71
  46. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +40 -54
  47. package/esm/ChartsTooltip/ChartsTooltip.js +15 -7
  48. package/esm/ChartsTooltip/ChartsTooltipTable.js +3 -3
  49. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +168 -0
  50. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
  51. package/esm/ChartsTooltip/chartsTooltipClasses.js +5 -0
  52. package/esm/ChartsTooltip/index.js +6 -1
  53. package/esm/ChartsTooltip/utils.js +1 -1
  54. package/esm/ChartsYAxis/ChartsYAxis.js +6 -4
  55. package/esm/LineChart/extremums.js +25 -8
  56. package/esm/LineChart/index.js +5 -5
  57. package/esm/PieChart/PieArc.js +18 -2
  58. package/esm/PieChart/PieArcLabel.js +7 -11
  59. package/esm/PieChart/PieArcLabelPlot.js +92 -3
  60. package/esm/PieChart/PieArcPlot.js +91 -3
  61. package/esm/PieChart/index.js +4 -2
  62. package/esm/ScatterChart/Scatter.js +1 -1
  63. package/esm/ScatterChart/index.js +3 -3
  64. package/esm/internals/defaultizeValueFormatter.js +4 -3
  65. package/index.js +1 -1
  66. package/internals/defaultizeValueFormatter.d.ts +3 -1
  67. package/internals/defaultizeValueFormatter.js +3 -3
  68. package/legacy/BarChart/BarElement.js +26 -2
  69. package/legacy/BarChart/index.js +3 -2
  70. package/legacy/ChartsLegend/index.js +2 -1
  71. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +95 -70
  72. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +40 -51
  73. package/legacy/ChartsTooltip/ChartsTooltip.js +20 -12
  74. package/legacy/ChartsTooltip/ChartsTooltipTable.js +3 -3
  75. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
  76. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +89 -0
  77. package/legacy/ChartsTooltip/chartsTooltipClasses.js +5 -0
  78. package/legacy/ChartsTooltip/index.js +6 -1
  79. package/legacy/ChartsTooltip/utils.js +1 -1
  80. package/legacy/ChartsYAxis/ChartsYAxis.js +6 -4
  81. package/legacy/LineChart/extremums.js +29 -14
  82. package/legacy/LineChart/index.js +5 -5
  83. package/legacy/PieChart/PieArc.js +18 -2
  84. package/legacy/PieChart/PieArcLabel.js +7 -11
  85. package/legacy/PieChart/PieArcLabelPlot.js +92 -3
  86. package/legacy/PieChart/PieArcPlot.js +91 -3
  87. package/legacy/PieChart/index.js +4 -2
  88. package/legacy/ScatterChart/Scatter.js +1 -1
  89. package/legacy/ScatterChart/index.js +3 -3
  90. package/legacy/index.js +1 -1
  91. package/legacy/internals/defaultizeValueFormatter.js +4 -3
  92. package/models/seriesType/config.d.ts +5 -1
  93. package/models/seriesType/scatter.d.ts +1 -1
  94. package/modern/BarChart/BarElement.js +26 -2
  95. package/modern/BarChart/index.js +3 -2
  96. package/modern/ChartsLegend/index.js +2 -1
  97. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +95 -70
  98. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +40 -54
  99. package/modern/ChartsTooltip/ChartsTooltip.js +15 -7
  100. package/modern/ChartsTooltip/ChartsTooltipTable.js +3 -3
  101. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
  102. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
  103. package/modern/ChartsTooltip/chartsTooltipClasses.js +5 -0
  104. package/modern/ChartsTooltip/index.js +6 -1
  105. package/modern/ChartsTooltip/utils.js +1 -1
  106. package/modern/ChartsYAxis/ChartsYAxis.js +6 -4
  107. package/modern/LineChart/extremums.js +25 -8
  108. package/modern/LineChart/index.js +5 -5
  109. package/modern/PieChart/PieArc.js +18 -2
  110. package/modern/PieChart/PieArcLabel.js +7 -11
  111. package/modern/PieChart/PieArcLabelPlot.js +92 -3
  112. package/modern/PieChart/PieArcPlot.js +91 -3
  113. package/modern/PieChart/index.js +4 -2
  114. package/modern/ScatterChart/Scatter.js +1 -1
  115. package/modern/ScatterChart/index.js +3 -3
  116. package/modern/index.js +1 -1
  117. package/modern/internals/defaultizeValueFormatter.js +3 -3
  118. package/package.json +1 -1
  119. package/themeAugmentation/components.d.ts +1 -0
  120. package/themeAugmentation/overrides.d.ts +2 -0
  121. package/ChartsTooltip/tooltipClasses.d.ts +0 -13
  122. package/ChartsTooltip/tooltipClasses.js +0 -12
  123. package/esm/ChartsTooltip/tooltipClasses.js +0 -5
  124. package/legacy/ChartsTooltip/tooltipClasses.js +0 -5
  125. package/modern/ChartsTooltip/tooltipClasses.js +0 -5
@@ -65,6 +65,8 @@ function ChartsYAxis(inProps) {
65
65
  tickFontSize = defaultizedProps.tickFontSize,
66
66
  label = defaultizedProps.label,
67
67
  labelFontSize = defaultizedProps.labelFontSize,
68
+ labelStyle = defaultizedProps.labelStyle,
69
+ tickLabelStyle = defaultizedProps.tickLabelStyle,
68
70
  tickSizeProp = defaultizedProps.tickSize,
69
71
  valueFormatter = defaultizedProps.valueFormatter,
70
72
  slots = defaultizedProps.slots,
@@ -97,11 +99,11 @@ function ChartsYAxis(inProps) {
97
99
  elementType: TickLabel,
98
100
  externalSlotProps: slotProps == null ? void 0 : slotProps.axisTickLabel,
99
101
  additionalProps: {
100
- style: {
102
+ style: _extends({
101
103
  fontSize: tickFontSize,
102
104
  textAnchor: position === 'right' ? 'start' : 'end',
103
105
  dominantBaseline: 'central'
104
- },
106
+ }, tickLabelStyle),
105
107
  className: classes.tickLabel
106
108
  },
107
109
  ownerState: {}
@@ -110,12 +112,12 @@ function ChartsYAxis(inProps) {
110
112
  elementType: Label,
111
113
  externalSlotProps: slotProps == null ? void 0 : slotProps.axisLabel,
112
114
  additionalProps: {
113
- style: {
115
+ style: _extends({
114
116
  fontSize: labelFontSize,
115
117
  angle: positionSign * 90,
116
118
  textAnchor: 'middle',
117
119
  dominantBaseline: 'auto'
118
- }
120
+ }, labelStyle)
119
121
  },
120
122
  ownerState: {}
121
123
  });
@@ -7,6 +7,21 @@ export var getExtremumX = function getExtremumX(params) {
7
7
  var maxX = Math.max.apply(Math, _toConsumableArray((_axis$data2 = axis.data) != null ? _axis$data2 : []));
8
8
  return [minX, maxX];
9
9
  };
10
+ function getSeriesExtremums(getValues, stackedData) {
11
+ if (stackedData.length === 0) {
12
+ return [null, null];
13
+ }
14
+ return stackedData.reduce(function (seriesAcc, stackedValue) {
15
+ var _getValues = getValues(stackedValue),
16
+ _getValues2 = _slicedToArray(_getValues, 2),
17
+ base = _getValues2[0],
18
+ value = _getValues2[1];
19
+ if (seriesAcc[0] === null) {
20
+ return [Math.min(base, value), Math.max(base, value)];
21
+ }
22
+ return [Math.min(base, value, seriesAcc[0]), Math.max(base, value, seriesAcc[1])];
23
+ }, getValues(stackedData[0]));
24
+ }
10
25
  export var getExtremumY = function getExtremumY(params) {
11
26
  var series = params.series,
12
27
  axis = params.axis,
@@ -14,26 +29,26 @@ export var getExtremumY = function getExtremumY(params) {
14
29
  return Object.keys(series).filter(function (seriesId) {
15
30
  return series[seriesId].yAxisKey === axis.id || isDefaultAxis && series[seriesId].yAxisKey === undefined;
16
31
  }).reduce(function (acc, seriesId) {
17
- var isArea = series[seriesId].area !== undefined;
32
+ var _series$seriesId = series[seriesId],
33
+ area = _series$seriesId.area,
34
+ stackedData = _series$seriesId.stackedData;
35
+ var isArea = area !== undefined;
18
36
  var getValues = isArea ? function (d) {
19
37
  return d;
20
38
  } : function (d) {
21
39
  return [d[1], d[1]];
22
- }; // Id area should go from bottom to top, without area should only consider the top
40
+ }; // Since this series is not used to display an area, we do not consider the base (the d[0]).
23
41
 
24
- var _series$seriesId$stac = series[seriesId].stackedData.reduce(function (seriesAcc, stackedValue) {
25
- var _getValues = getValues(stackedValue),
26
- _getValues2 = _slicedToArray(_getValues, 2),
27
- base = _getValues2[0],
28
- value = _getValues2[1];
29
- return [Math.min(base, value, seriesAcc[0]), Math.max(base, value, seriesAcc[1])];
30
- }, getValues(series[seriesId].stackedData[0])),
31
- _series$seriesId$stac2 = _slicedToArray(_series$seriesId$stac, 2),
32
- seriesMin = _series$seriesId$stac2[0],
33
- seriesMax = _series$seriesId$stac2[1];
34
- if (acc[0] === null || acc[1] === null) {
35
- return [seriesMin, seriesMax];
42
+ var seriesExtremums = getSeriesExtremums(getValues, stackedData);
43
+ if (acc[0] === null) {
44
+ return seriesExtremums;
45
+ }
46
+ if (seriesExtremums[0] === null) {
47
+ return acc;
36
48
  }
49
+ var _seriesExtremums = _slicedToArray(seriesExtremums, 2),
50
+ seriesMin = _seriesExtremums[0],
51
+ seriesMax = _seriesExtremums[1];
37
52
  return [Math.min(seriesMin, acc[0]), Math.max(seriesMax, acc[1])];
38
53
  }, [null, null]);
39
54
  };
@@ -1,8 +1,8 @@
1
- export { LinePlot } from './LinePlot';
2
- export { AreaPlot } from './AreaPlot';
3
- export { MarkPlot } from './MarkPlot';
4
- export { LineHighlightPlot } from './LineHighlightPlot';
5
- export { LineChart } from './LineChart';
1
+ export * from './LineChart';
2
+ export * from './LinePlot';
3
+ export * from './AreaPlot';
4
+ export * from './MarkPlot';
5
+ export * from './LineHighlightPlot';
6
6
  export * from './AreaElement';
7
7
  export * from './LineElement';
8
8
  export * from './MarkElement';
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "onClick", "isFaded", "isHighlighted", "startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import { arc as d3Arc } from 'd3-shape';
6
7
  import { animated, to } from '@react-spring/web';
7
8
  import composeClasses from '@mui/utils/composeClasses';
@@ -38,7 +39,7 @@ var PieArcRoot = styled(animated.path, {
38
39
  strokeLinejoin: 'round'
39
40
  };
40
41
  });
41
- export default function PieArc(props) {
42
+ function PieArc(props) {
42
43
  var id = props.id,
43
44
  dataIndex = props.dataIndex,
44
45
  innerClasses = props.classes,
@@ -83,4 +84,19 @@ export default function PieArc(props) {
83
84
  seriesId: id,
84
85
  dataIndex: dataIndex
85
86
  })));
86
- }
87
+ }
88
+ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
89
+ // ----------------------------- Warning --------------------------------
90
+ // | These PropTypes are generated from the TypeScript type definitions |
91
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
92
+ // ----------------------------------------------------------------------
93
+ classes: PropTypes.object,
94
+ dataIndex: PropTypes.number.isRequired,
95
+ highlightScope: PropTypes.shape({
96
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
97
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
98
+ }),
99
+ isFaded: PropTypes.bool.isRequired,
100
+ isHighlighted: PropTypes.bool.isRequired
101
+ } : void 0;
102
+ export { PieArc };
@@ -3,9 +3,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  var _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
5
5
  import * as React from 'react';
6
+ import PropTypes from 'prop-types';
6
7
  import { animated, to } from '@react-spring/web';
7
8
  import { arc as d3Arc } from 'd3-shape';
8
- import PropTypes from 'prop-types';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
11
11
  import { styled } from '@mui/material/styles';
@@ -64,7 +64,7 @@ var getLabelPosition = function getLabelPosition(formattedArcLabel, variable) {
64
64
  return y;
65
65
  };
66
66
  };
67
- export default function PieArcLabel(props) {
67
+ function PieArcLabel(props) {
68
68
  var id = props.id,
69
69
  innerClasses = props.classes,
70
70
  color = props.color,
@@ -103,12 +103,8 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
103
103
  // | To update them edit the TypeScript types and run "yarn proptypes" |
104
104
  // ----------------------------------------------------------------------
105
105
  classes: PropTypes.object,
106
- cornerRadius: PropTypes.number,
107
- dataIndex: PropTypes.number.isRequired,
108
- highlightScope: PropTypes.shape({
109
- faded: PropTypes.oneOf(['global', 'none', 'series']),
110
- highlighted: PropTypes.oneOf(['item', 'none', 'series'])
111
- }),
112
- innerRadius: PropTypes.number,
113
- outerRadius: PropTypes.number.isRequired
114
- } : void 0;
106
+ formattedArcLabel: PropTypes.string,
107
+ isFaded: PropTypes.bool.isRequired,
108
+ isHighlighted: PropTypes.bool.isRequired
109
+ } : void 0;
110
+ export { PieArcLabel };
@@ -3,10 +3,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlightScope", "highlighted", "faded", "data", "arcLabel", "arcLabelMinAngle", "skipAnimation"],
4
4
  _excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius"];
5
5
  import * as React from 'react';
6
+ import PropTypes from 'prop-types';
6
7
  import { useTransition } from '@react-spring/web';
7
8
  import { defaultLabelTransitionConfig } from './dataTransform/transition';
8
9
  import { useTransformData } from './dataTransform/useTransformData';
9
- import PieArcLabel from './PieArcLabel';
10
+ import { PieArcLabel } from './PieArcLabel';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  var RATIO = 180 / Math.PI;
12
13
  function getItemLabel(arcLabel, arcLabelMinAngle, item) {
@@ -23,7 +24,7 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
23
24
  }
24
25
  return arcLabel(item);
25
26
  }
26
- export function PieArcLabelPlot(props) {
27
+ function PieArcLabelPlot(props) {
27
28
  var _slots$pieArcLabel;
28
29
  var slots = props.slots,
29
30
  slotProps = props.slotProps,
@@ -90,4 +91,92 @@ export function PieArcLabelPlot(props) {
90
91
  }, slotProps == null ? void 0 : slotProps.pieArcLabel));
91
92
  })
92
93
  }));
93
- }
94
+ }
95
+ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
96
+ // ----------------------------- Warning --------------------------------
97
+ // | These PropTypes are generated from the TypeScript type definitions |
98
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
99
+ // ----------------------------------------------------------------------
100
+ /**
101
+ * The label displayed into the arc.
102
+ */
103
+ arcLabel: PropTypes.oneOfType([PropTypes.oneOf(['formattedValue', 'label', 'value']), PropTypes.func]),
104
+ /**
105
+ * The minimal angle required to display the arc label.
106
+ */
107
+ arcLabelMinAngle: PropTypes.number,
108
+ /**
109
+ * The radius applied to arc corners (similar to border radius).
110
+ * @default 0
111
+ */
112
+ cornerRadius: PropTypes.number,
113
+ data: PropTypes.arrayOf(PropTypes.shape({
114
+ color: PropTypes.string.isRequired,
115
+ endAngle: PropTypes.number.isRequired,
116
+ formattedValue: PropTypes.string.isRequired,
117
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
118
+ index: PropTypes.number.isRequired,
119
+ label: PropTypes.string,
120
+ padAngle: PropTypes.number.isRequired,
121
+ startAngle: PropTypes.number.isRequired,
122
+ value: PropTypes.number.isRequired
123
+ })).isRequired,
124
+ /**
125
+ * Override the arc attibutes when it is faded.
126
+ */
127
+ faded: PropTypes.shape({
128
+ additionalRadius: PropTypes.number,
129
+ color: PropTypes.string,
130
+ cornerRadius: PropTypes.number,
131
+ innerRadius: PropTypes.number,
132
+ outerRadius: PropTypes.number,
133
+ paddingAngle: PropTypes.number
134
+ }),
135
+ /**
136
+ * Override the arc attibutes when it is highlighted.
137
+ */
138
+ highlighted: PropTypes.shape({
139
+ additionalRadius: PropTypes.number,
140
+ color: PropTypes.string,
141
+ cornerRadius: PropTypes.number,
142
+ innerRadius: PropTypes.number,
143
+ outerRadius: PropTypes.number,
144
+ paddingAngle: PropTypes.number
145
+ }),
146
+ highlightScope: PropTypes.shape({
147
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
148
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
149
+ }),
150
+ id: PropTypes.string.isRequired,
151
+ /**
152
+ * The radius between circle center and the begining of the arc.
153
+ * @default 0
154
+ */
155
+ innerRadius: PropTypes.number,
156
+ /**
157
+ * The radius between circle center and the end of the arc.
158
+ * @default R_max The maximal radius that fit into the drawing area.
159
+ */
160
+ outerRadius: PropTypes.number.isRequired,
161
+ /**
162
+ * The padding angle (deg) between two arcs.
163
+ * @default 0
164
+ */
165
+ paddingAngle: PropTypes.number,
166
+ /**
167
+ * If `true`, animations are skiped.
168
+ * @default false
169
+ */
170
+ skipAnimation: PropTypes.bool,
171
+ /**
172
+ * The props used for each component slot.
173
+ * @default {}
174
+ */
175
+ slotProps: PropTypes.object,
176
+ /**
177
+ * Overridable component slots.
178
+ * @default {}
179
+ */
180
+ slots: PropTypes.object
181
+ } : void 0;
182
+ export { PieArcLabelPlot };
@@ -3,12 +3,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlightScope", "highlighted", "faded", "data", "onClick", "skipAnimation"],
4
4
  _excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius"];
5
5
  import * as React from 'react';
6
+ import PropTypes from 'prop-types';
6
7
  import { useTransition } from '@react-spring/web';
7
- import PieArc from './PieArc';
8
+ import { PieArc } from './PieArc';
8
9
  import { defaultTransitionConfig } from './dataTransform/transition';
9
10
  import { useTransformData } from './dataTransform/useTransformData';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
- export function PieArcPlot(props) {
12
+ function PieArcPlot(props) {
12
13
  var _slots$pieArc;
13
14
  var slots = props.slots,
14
15
  slotProps = props.slotProps,
@@ -81,4 +82,91 @@ export function PieArcPlot(props) {
81
82
  }, slotProps == null ? void 0 : slotProps.pieArc));
82
83
  })
83
84
  }));
84
- }
85
+ }
86
+ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
87
+ // ----------------------------- Warning --------------------------------
88
+ // | These PropTypes are generated from the TypeScript type definitions |
89
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
90
+ // ----------------------------------------------------------------------
91
+ /**
92
+ * The radius applied to arc corners (similar to border radius).
93
+ * @default 0
94
+ */
95
+ cornerRadius: PropTypes.number,
96
+ data: PropTypes.arrayOf(PropTypes.shape({
97
+ color: PropTypes.string.isRequired,
98
+ endAngle: PropTypes.number.isRequired,
99
+ formattedValue: PropTypes.string.isRequired,
100
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
101
+ index: PropTypes.number.isRequired,
102
+ label: PropTypes.string,
103
+ padAngle: PropTypes.number.isRequired,
104
+ startAngle: PropTypes.number.isRequired,
105
+ value: PropTypes.number.isRequired
106
+ })).isRequired,
107
+ /**
108
+ * Override the arc attibutes when it is faded.
109
+ */
110
+ faded: PropTypes.shape({
111
+ additionalRadius: PropTypes.number,
112
+ color: PropTypes.string,
113
+ cornerRadius: PropTypes.number,
114
+ innerRadius: PropTypes.number,
115
+ outerRadius: PropTypes.number,
116
+ paddingAngle: PropTypes.number
117
+ }),
118
+ /**
119
+ * Override the arc attibutes when it is highlighted.
120
+ */
121
+ highlighted: PropTypes.shape({
122
+ additionalRadius: PropTypes.number,
123
+ color: PropTypes.string,
124
+ cornerRadius: PropTypes.number,
125
+ innerRadius: PropTypes.number,
126
+ outerRadius: PropTypes.number,
127
+ paddingAngle: PropTypes.number
128
+ }),
129
+ highlightScope: PropTypes.shape({
130
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
131
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
132
+ }),
133
+ id: PropTypes.string.isRequired,
134
+ /**
135
+ * The radius between circle center and the begining of the arc.
136
+ * @default 0
137
+ */
138
+ innerRadius: PropTypes.number,
139
+ /**
140
+ * Callback fired when a pie item is clicked.
141
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
142
+ * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
143
+ * @param {DefaultizedPieValueType} item The pie item.
144
+ */
145
+ onClick: PropTypes.func,
146
+ /**
147
+ * The radius between circle center and the end of the arc.
148
+ * @default R_max The maximal radius that fit into the drawing area.
149
+ */
150
+ outerRadius: PropTypes.number.isRequired,
151
+ /**
152
+ * The padding angle (deg) between two arcs.
153
+ * @default 0
154
+ */
155
+ paddingAngle: PropTypes.number,
156
+ /**
157
+ * If `true`, animations are skiped.
158
+ * @default false
159
+ */
160
+ skipAnimation: PropTypes.bool,
161
+ /**
162
+ * The props used for each component slot.
163
+ * @default {}
164
+ */
165
+ slotProps: PropTypes.object,
166
+ /**
167
+ * Overridable component slots.
168
+ * @default {}
169
+ */
170
+ slots: PropTypes.object
171
+ } : void 0;
172
+ export { PieArcPlot };
@@ -1,4 +1,6 @@
1
- export { PiePlot } from './PiePlot';
2
- export { PieChart } from './PieChart';
1
+ export * from './PieChart';
2
+ export * from './PiePlot';
3
+ export * from './PieArcPlot';
4
+ export * from './PieArcLabelPlot';
3
5
  export * from './PieArc';
4
6
  export * from './PieArcLabel';
@@ -78,7 +78,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
78
78
  color: PropTypes.string.isRequired,
79
79
  markerSize: PropTypes.number.isRequired,
80
80
  series: PropTypes.shape({
81
- color: PropTypes.string,
81
+ color: PropTypes.string.isRequired,
82
82
  data: PropTypes.arrayOf(PropTypes.shape({
83
83
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
84
84
  x: PropTypes.number.isRequired,
@@ -1,3 +1,3 @@
1
- export { ScatterPlot } from './ScatterPlot';
2
- export { ScatterChart } from './ScatterChart';
3
- export { Scatter } from './Scatter';
1
+ export * from './ScatterChart';
2
+ export * from './ScatterPlot';
3
+ export * from './Scatter';
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v6.18.1
2
+ * @mui/x-charts v6.18.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,9 +2,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  function defaultizeValueFormatter(series, defaultValueFormatter) {
3
3
  var defaultizedSeries = {};
4
4
  Object.keys(series).forEach(function (seriesId) {
5
- defaultizedSeries[seriesId] = _extends({
6
- valueFormatter: defaultValueFormatter
7
- }, series[seriesId]);
5
+ var _series$seriesId$valu;
6
+ defaultizedSeries[seriesId] = _extends({}, series[seriesId], {
7
+ valueFormatter: (_series$seriesId$valu = series[seriesId].valueFormatter) != null ? _series$seriesId$valu : defaultValueFormatter
8
+ });
8
9
  });
9
10
  return defaultizedSeries;
10
11
  }
@@ -46,7 +46,11 @@ export type ChartSeries<T extends ChartSeriesType> = ChartsSeriesConfig[T] exten
46
46
  } ? ChartsSeriesConfig[T]['seriesInput'] & {
47
47
  stackedData: [number, number][];
48
48
  } : ChartsSeriesConfig[T]['seriesInput'];
49
- export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConfig[T]['series'] & ChartSeries<T>;
49
+ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConfig[T] extends {
50
+ canBeStacked: true;
51
+ } ? ChartsSeriesConfig[T]['series'] & {
52
+ stackedData: [number, number][];
53
+ } : ChartsSeriesConfig[T]['series'];
50
54
  export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
51
55
  type ExtremumGetterParams<T extends ChartSeriesType> = {
52
56
  series: {
@@ -20,5 +20,5 @@ export type ScatterItemIdentifier = {
20
20
  seriesId: DefaultizedScatterSeriesType['id'];
21
21
  dataIndex: number;
22
22
  };
23
- export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps> {
23
+ export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps | 'color'> {
24
24
  }
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import composeClasses from '@mui/utils/composeClasses';
6
7
  import { useSlotProps } from '@mui/base/utils';
7
8
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
@@ -39,7 +40,7 @@ export const BarElementPath = styled(animated.rect, {
39
40
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
40
41
  opacity: ownerState.isFaded && 0.3 || 1
41
42
  }));
42
- export function BarElement(props) {
43
+ function BarElement(props) {
43
44
  const {
44
45
  id,
45
46
  dataIndex,
@@ -89,4 +90,27 @@ export function BarElement(props) {
89
90
  ownerState
90
91
  });
91
92
  return /*#__PURE__*/_jsx(Bar, _extends({}, barProps));
92
- }
93
+ }
94
+ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
95
+ // ----------------------------- Warning --------------------------------
96
+ // | These PropTypes are generated from the TypeScript type definitions |
97
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
98
+ // ----------------------------------------------------------------------
99
+ classes: PropTypes.object,
100
+ dataIndex: PropTypes.number.isRequired,
101
+ highlightScope: PropTypes.shape({
102
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
103
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
104
+ }),
105
+ /**
106
+ * The props used for each component slot.
107
+ * @default {}
108
+ */
109
+ slotProps: PropTypes.object,
110
+ /**
111
+ * Overridable component slots.
112
+ * @default {}
113
+ */
114
+ slots: PropTypes.object
115
+ } : void 0;
116
+ export { BarElement };
@@ -1,2 +1,3 @@
1
- export { BarPlot } from './BarPlot';
2
- export { BarChart } from './BarChart';
1
+ export * from './BarChart';
2
+ export * from './BarPlot';
3
+ export * from './BarElement';
@@ -1,2 +1,3 @@
1
1
  export * from './ChartsLegend';
2
- export * from './chartsLegendClasses';
2
+ export * from './chartsLegendClasses';
3
+ export * from './utils';