@mui/x-charts 7.0.0-alpha.2 → 7.0.0-alpha.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 (100) hide show
  1. package/BarChart/BarElement.d.ts +5 -1
  2. package/BarChart/BarElement.js +24 -1
  3. package/BarChart/index.d.ts +2 -1
  4. package/BarChart/index.js +15 -4
  5. package/CHANGELOG.md +241 -0
  6. package/ChartsLegend/index.d.ts +1 -0
  7. package/ChartsLegend/index.js +11 -0
  8. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +5 -2
  9. package/ChartsTooltip/ChartsAxisTooltipContent.js +93 -73
  10. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -2
  11. package/ChartsTooltip/ChartsItemTooltipContent.js +38 -57
  12. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +7 -0
  13. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +174 -0
  14. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +8 -0
  15. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +99 -0
  16. package/ChartsTooltip/index.d.ts +4 -0
  17. package/ChartsTooltip/index.js +44 -0
  18. package/ChartsYAxis/ChartsYAxis.js +6 -4
  19. package/LineChart/extremums.js +25 -8
  20. package/LineChart/index.d.ts +1 -1
  21. package/LineChart/index.js +11 -11
  22. package/PieChart/PieArc.d.ts +5 -2
  23. package/PieChart/PieArc.js +17 -2
  24. package/PieChart/PieArcLabel.d.ts +1 -1
  25. package/PieChart/PieArcLabel.js +5 -10
  26. package/PieChart/PieArcLabelPlot.d.ts +5 -1
  27. package/PieChart/PieArcLabelPlot.js +91 -3
  28. package/PieChart/PieArcPlot.d.ts +5 -1
  29. package/PieChart/PieArcPlot.js +90 -3
  30. package/PieChart/index.d.ts +3 -1
  31. package/PieChart/index.js +26 -4
  32. package/README.md +0 -1
  33. package/ScatterChart/Scatter.js +1 -1
  34. package/ScatterChart/index.d.ts +1 -1
  35. package/ScatterChart/index.js +8 -8
  36. package/esm/BarChart/BarElement.js +26 -2
  37. package/esm/BarChart/index.js +2 -1
  38. package/esm/ChartsLegend/index.js +2 -1
  39. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +95 -75
  40. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
  41. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +168 -0
  42. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
  43. package/esm/ChartsTooltip/index.js +5 -1
  44. package/esm/ChartsYAxis/ChartsYAxis.js +6 -4
  45. package/esm/LineChart/extremums.js +25 -8
  46. package/esm/LineChart/index.js +1 -1
  47. package/esm/PieChart/PieArc.js +18 -2
  48. package/esm/PieChart/PieArcLabel.js +7 -11
  49. package/esm/PieChart/PieArcLabelPlot.js +92 -3
  50. package/esm/PieChart/PieArcPlot.js +91 -3
  51. package/esm/PieChart/index.js +3 -1
  52. package/esm/ScatterChart/Scatter.js +1 -1
  53. package/esm/ScatterChart/index.js +1 -1
  54. package/esm/internals/defaultizeValueFormatter.js +4 -3
  55. package/index.js +1 -1
  56. package/internals/defaultizeValueFormatter.d.ts +3 -1
  57. package/internals/defaultizeValueFormatter.js +3 -3
  58. package/legacy/BarChart/BarElement.js +26 -2
  59. package/legacy/BarChart/index.js +2 -1
  60. package/legacy/ChartsLegend/index.js +2 -1
  61. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
  62. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +40 -55
  63. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
  64. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +89 -0
  65. package/legacy/ChartsTooltip/index.js +5 -1
  66. package/legacy/ChartsYAxis/ChartsYAxis.js +6 -4
  67. package/legacy/LineChart/extremums.js +29 -14
  68. package/legacy/LineChart/index.js +1 -1
  69. package/legacy/PieChart/PieArc.js +18 -2
  70. package/legacy/PieChart/PieArcLabel.js +7 -11
  71. package/legacy/PieChart/PieArcLabelPlot.js +92 -3
  72. package/legacy/PieChart/PieArcPlot.js +91 -3
  73. package/legacy/PieChart/index.js +3 -1
  74. package/legacy/ScatterChart/Scatter.js +1 -1
  75. package/legacy/ScatterChart/index.js +1 -1
  76. package/legacy/index.js +1 -1
  77. package/legacy/internals/defaultizeValueFormatter.js +4 -3
  78. package/models/seriesType/config.d.ts +5 -1
  79. package/models/seriesType/scatter.d.ts +1 -1
  80. package/modern/BarChart/BarElement.js +26 -2
  81. package/modern/BarChart/index.js +2 -1
  82. package/modern/ChartsLegend/index.js +2 -1
  83. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
  84. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
  85. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
  86. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
  87. package/modern/ChartsTooltip/index.js +5 -1
  88. package/modern/ChartsYAxis/ChartsYAxis.js +6 -4
  89. package/modern/LineChart/extremums.js +25 -8
  90. package/modern/LineChart/index.js +1 -1
  91. package/modern/PieChart/PieArc.js +18 -2
  92. package/modern/PieChart/PieArcLabel.js +7 -11
  93. package/modern/PieChart/PieArcLabelPlot.js +92 -3
  94. package/modern/PieChart/PieArcPlot.js +91 -3
  95. package/modern/PieChart/index.js +3 -1
  96. package/modern/ScatterChart/Scatter.js +1 -1
  97. package/modern/ScatterChart/index.js +1 -1
  98. package/modern/index.js +1 -1
  99. package/modern/internals/defaultizeValueFormatter.js +3 -3
  100. package/package.json +2 -2
@@ -0,0 +1,92 @@
1
+ import * as React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import clsx from 'clsx';
4
+ import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ function DefaultChartsItemTooltipContent(props) {
8
+ const {
9
+ series,
10
+ itemData,
11
+ sx,
12
+ classes
13
+ } = props;
14
+ if (itemData.dataIndex === undefined) {
15
+ return null;
16
+ }
17
+ const {
18
+ displayedLabel,
19
+ color
20
+ } = series.type === 'pie' ? {
21
+ color: series.data[itemData.dataIndex].color,
22
+ displayedLabel: series.data[itemData.dataIndex].label
23
+ } : {
24
+ color: series.color,
25
+ displayedLabel: series.label
26
+ };
27
+
28
+ // TODO: Manage to let TS understand series.data and series.valueFormatter are coherent
29
+ // @ts-ignore
30
+ const formattedValue = series.valueFormatter(series.data[itemData.dataIndex]);
31
+ return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
32
+ sx: sx,
33
+ className: classes.root,
34
+ children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
35
+ className: classes.table,
36
+ children: /*#__PURE__*/_jsx("tbody", {
37
+ children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
38
+ className: classes.row,
39
+ children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
40
+ className: clsx(classes.markCell, classes.cell),
41
+ children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
42
+ ownerState: {
43
+ color
44
+ },
45
+ className: classes.mark
46
+ })
47
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
48
+ className: clsx(classes.labelCell, classes.cell),
49
+ children: displayedLabel
50
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
51
+ className: clsx(classes.valueCell, classes.cell),
52
+ children: formattedValue
53
+ })]
54
+ })
55
+ })
56
+ })
57
+ });
58
+ }
59
+ process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propTypes = {
60
+ // ----------------------------- Warning --------------------------------
61
+ // | These PropTypes are generated from the TypeScript type definitions |
62
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
63
+ // ----------------------------------------------------------------------
64
+ /**
65
+ * Override or extend the styles applied to the component.
66
+ */
67
+ classes: PropTypes.object.isRequired,
68
+ /**
69
+ * The data used to identify the triggered item.
70
+ */
71
+ itemData: PropTypes.shape({
72
+ dataIndex: PropTypes.number,
73
+ seriesId: PropTypes.string.isRequired,
74
+ type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
75
+ }).isRequired,
76
+ /**
77
+ * The series linked to the triggered axis.
78
+ */
79
+ series: PropTypes.shape({
80
+ color: PropTypes.string,
81
+ data: PropTypes.arrayOf(PropTypes.number).isRequired,
82
+ highlightScope: PropTypes.shape({
83
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
84
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
85
+ }),
86
+ id: PropTypes.string.isRequired,
87
+ type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired,
88
+ valueFormatter: PropTypes.func.isRequired
89
+ }).isRequired,
90
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
91
+ } : void 0;
92
+ export { DefaultChartsItemTooltipContent };
@@ -1,2 +1,6 @@
1
1
  export * from './ChartsTooltip';
2
- export * from './chartsTooltipClasses';
2
+ export * from './chartsTooltipClasses';
3
+ export * from './ChartsAxisTooltipContent';
4
+ export * from './ChartsItemTooltipContent';
5
+ export * from './DefaultChartsAxisTooltipContent';
6
+ export * from './DefaultChartsItemTooltipContent';
@@ -74,6 +74,8 @@ function ChartsYAxis(inProps) {
74
74
  tickFontSize,
75
75
  label,
76
76
  labelFontSize,
77
+ labelStyle,
78
+ tickLabelStyle,
77
79
  tickSize: tickSizeProp,
78
80
  valueFormatter,
79
81
  slots,
@@ -108,11 +110,11 @@ function ChartsYAxis(inProps) {
108
110
  elementType: TickLabel,
109
111
  externalSlotProps: slotProps?.axisTickLabel,
110
112
  additionalProps: {
111
- style: {
113
+ style: _extends({
112
114
  fontSize: tickFontSize,
113
115
  textAnchor: position === 'right' ? 'start' : 'end',
114
116
  dominantBaseline: 'central'
115
- },
117
+ }, tickLabelStyle),
116
118
  className: classes.tickLabel
117
119
  },
118
120
  ownerState: {}
@@ -121,12 +123,12 @@ function ChartsYAxis(inProps) {
121
123
  elementType: Label,
122
124
  externalSlotProps: slotProps?.axisLabel,
123
125
  additionalProps: {
124
- style: {
126
+ style: _extends({
125
127
  fontSize: labelFontSize,
126
128
  angle: positionSign * 90,
127
129
  textAnchor: 'middle',
128
130
  dominantBaseline: 'auto'
129
- }
131
+ }, labelStyle)
130
132
  },
131
133
  ownerState: {}
132
134
  });
@@ -6,6 +6,18 @@ export const getExtremumX = params => {
6
6
  const maxX = Math.max(...(axis.data ?? []));
7
7
  return [minX, maxX];
8
8
  };
9
+ function getSeriesExtremums(getValues, stackedData) {
10
+ if (stackedData.length === 0) {
11
+ return [null, null];
12
+ }
13
+ return stackedData.reduce((seriesAcc, stackedValue) => {
14
+ const [base, value] = getValues(stackedValue);
15
+ if (seriesAcc[0] === null) {
16
+ return [Math.min(base, value), Math.max(base, value)];
17
+ }
18
+ return [Math.min(base, value, seriesAcc[0]), Math.max(base, value, seriesAcc[1])];
19
+ }, getValues(stackedData[0]));
20
+ }
9
21
  export const getExtremumY = params => {
10
22
  const {
11
23
  series,
@@ -13,16 +25,21 @@ export const getExtremumY = params => {
13
25
  isDefaultAxis
14
26
  } = params;
15
27
  return Object.keys(series).filter(seriesId => series[seriesId].yAxisKey === axis.id || isDefaultAxis && series[seriesId].yAxisKey === undefined).reduce((acc, seriesId) => {
16
- const isArea = series[seriesId].area !== undefined;
17
- const getValues = isArea ? d => d : d => [d[1], d[1]]; // Id area should go from bottom to top, without area should only consider the top
28
+ const {
29
+ area,
30
+ stackedData
31
+ } = series[seriesId];
32
+ const isArea = area !== undefined;
33
+ const getValues = isArea ? d => d : d => [d[1], d[1]]; // Since this series is not used to display an area, we do not consider the base (the d[0]).
18
34
 
19
- const [seriesMin, seriesMax] = series[seriesId].stackedData.reduce((seriesAcc, stackedValue) => {
20
- const [base, value] = getValues(stackedValue);
21
- return [Math.min(base, value, seriesAcc[0]), Math.max(base, value, seriesAcc[1])];
22
- }, getValues(series[seriesId].stackedData[0]));
23
- if (acc[0] === null || acc[1] === null) {
24
- return [seriesMin, seriesMax];
35
+ const seriesExtremums = getSeriesExtremums(getValues, stackedData);
36
+ if (acc[0] === null) {
37
+ return seriesExtremums;
38
+ }
39
+ if (seriesExtremums[0] === null) {
40
+ return acc;
25
41
  }
42
+ const [seriesMin, seriesMax] = seriesExtremums;
26
43
  return [Math.min(seriesMin, acc[0]), Math.max(seriesMax, acc[1])];
27
44
  }, [null, null]);
28
45
  };
@@ -1,8 +1,8 @@
1
+ export * from './LineChart';
1
2
  export * from './LinePlot';
2
3
  export * from './AreaPlot';
3
4
  export * from './MarkPlot';
4
5
  export * from './LineHighlightPlot';
5
- export * from './LineChart';
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 _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _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';
@@ -37,7 +38,7 @@ const PieArcRoot = styled(animated.path, {
37
38
  strokeWidth: 1,
38
39
  strokeLinejoin: 'round'
39
40
  }));
40
- export default function PieArc(props) {
41
+ function PieArc(props) {
41
42
  const {
42
43
  id,
43
44
  dataIndex,
@@ -82,4 +83,19 @@ export default function PieArc(props) {
82
83
  seriesId: id,
83
84
  dataIndex
84
85
  })));
85
- }
86
+ }
87
+ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
88
+ // ----------------------------- Warning --------------------------------
89
+ // | These PropTypes are generated from the TypeScript type definitions |
90
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
91
+ // ----------------------------------------------------------------------
92
+ classes: PropTypes.object,
93
+ dataIndex: PropTypes.number.isRequired,
94
+ highlightScope: PropTypes.shape({
95
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
96
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
97
+ }),
98
+ isFaded: PropTypes.bool.isRequired,
99
+ isHighlighted: PropTypes.bool.isRequired
100
+ } : void 0;
101
+ export { PieArc };
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import { animated, to } from '@react-spring/web';
6
7
  import { arc as d3Arc } from 'd3-shape';
7
- import PropTypes from 'prop-types';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
10
10
  import { styled } from '@mui/material/styles';
@@ -57,7 +57,7 @@ const getLabelPosition = (formattedArcLabel, variable) => (startAngle, endAngle,
57
57
  }
58
58
  return y;
59
59
  };
60
- export default function PieArcLabel(props) {
60
+ function PieArcLabel(props) {
61
61
  const {
62
62
  id,
63
63
  classes: innerClasses,
@@ -98,12 +98,8 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
98
98
  // | To update them edit the TypeScript types and run "yarn proptypes" |
99
99
  // ----------------------------------------------------------------------
100
100
  classes: PropTypes.object,
101
- cornerRadius: PropTypes.number,
102
- dataIndex: PropTypes.number.isRequired,
103
- highlightScope: PropTypes.shape({
104
- faded: PropTypes.oneOf(['global', 'none', 'series']),
105
- highlighted: PropTypes.oneOf(['item', 'none', 'series'])
106
- }),
107
- innerRadius: PropTypes.number,
108
- outerRadius: PropTypes.number.isRequired
109
- } : void 0;
101
+ formattedArcLabel: PropTypes.string,
102
+ isFaded: PropTypes.bool.isRequired,
103
+ isHighlighted: PropTypes.bool.isRequired
104
+ } : void 0;
105
+ export { PieArcLabel };
@@ -3,10 +3,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _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
  const RATIO = 180 / Math.PI;
12
13
  function getItemLabel(arcLabel, arcLabelMinAngle, item) {
@@ -22,7 +23,7 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
22
23
  }
23
24
  return arcLabel(item);
24
25
  }
25
- export function PieArcLabelPlot(props) {
26
+ function PieArcLabelPlot(props) {
26
27
  const {
27
28
  slots,
28
29
  slotProps,
@@ -87,4 +88,92 @@ export function PieArcLabelPlot(props) {
87
88
  }, slotProps?.pieArcLabel));
88
89
  })
89
90
  }));
90
- }
91
+ }
92
+ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
93
+ // ----------------------------- Warning --------------------------------
94
+ // | These PropTypes are generated from the TypeScript type definitions |
95
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
96
+ // ----------------------------------------------------------------------
97
+ /**
98
+ * The label displayed into the arc.
99
+ */
100
+ arcLabel: PropTypes.oneOfType([PropTypes.oneOf(['formattedValue', 'label', 'value']), PropTypes.func]),
101
+ /**
102
+ * The minimal angle required to display the arc label.
103
+ */
104
+ arcLabelMinAngle: PropTypes.number,
105
+ /**
106
+ * The radius applied to arc corners (similar to border radius).
107
+ * @default 0
108
+ */
109
+ cornerRadius: PropTypes.number,
110
+ data: PropTypes.arrayOf(PropTypes.shape({
111
+ color: PropTypes.string.isRequired,
112
+ endAngle: PropTypes.number.isRequired,
113
+ formattedValue: PropTypes.string.isRequired,
114
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
115
+ index: PropTypes.number.isRequired,
116
+ label: PropTypes.string,
117
+ padAngle: PropTypes.number.isRequired,
118
+ startAngle: PropTypes.number.isRequired,
119
+ value: PropTypes.number.isRequired
120
+ })).isRequired,
121
+ /**
122
+ * Override the arc attibutes when it is faded.
123
+ */
124
+ faded: PropTypes.shape({
125
+ additionalRadius: PropTypes.number,
126
+ color: PropTypes.string,
127
+ cornerRadius: PropTypes.number,
128
+ innerRadius: PropTypes.number,
129
+ outerRadius: PropTypes.number,
130
+ paddingAngle: PropTypes.number
131
+ }),
132
+ /**
133
+ * Override the arc attibutes when it is highlighted.
134
+ */
135
+ highlighted: PropTypes.shape({
136
+ additionalRadius: PropTypes.number,
137
+ color: PropTypes.string,
138
+ cornerRadius: PropTypes.number,
139
+ innerRadius: PropTypes.number,
140
+ outerRadius: PropTypes.number,
141
+ paddingAngle: PropTypes.number
142
+ }),
143
+ highlightScope: PropTypes.shape({
144
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
145
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
146
+ }),
147
+ id: PropTypes.string.isRequired,
148
+ /**
149
+ * The radius between circle center and the begining of the arc.
150
+ * @default 0
151
+ */
152
+ innerRadius: PropTypes.number,
153
+ /**
154
+ * The radius between circle center and the end of the arc.
155
+ * @default R_max The maximal radius that fit into the drawing area.
156
+ */
157
+ outerRadius: PropTypes.number.isRequired,
158
+ /**
159
+ * The padding angle (deg) between two arcs.
160
+ * @default 0
161
+ */
162
+ paddingAngle: PropTypes.number,
163
+ /**
164
+ * If `true`, animations are skiped.
165
+ * @default false
166
+ */
167
+ skipAnimation: PropTypes.bool,
168
+ /**
169
+ * The props used for each component slot.
170
+ * @default {}
171
+ */
172
+ slotProps: PropTypes.object,
173
+ /**
174
+ * Overridable component slots.
175
+ * @default {}
176
+ */
177
+ slots: PropTypes.object
178
+ } : void 0;
179
+ export { PieArcLabelPlot };
@@ -3,12 +3,13 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _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
  const {
13
14
  slots,
14
15
  slotProps,
@@ -80,4 +81,91 @@ export function PieArcPlot(props) {
80
81
  }, slotProps?.pieArc));
81
82
  })
82
83
  }));
83
- }
84
+ }
85
+ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
86
+ // ----------------------------- Warning --------------------------------
87
+ // | These PropTypes are generated from the TypeScript type definitions |
88
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
89
+ // ----------------------------------------------------------------------
90
+ /**
91
+ * The radius applied to arc corners (similar to border radius).
92
+ * @default 0
93
+ */
94
+ cornerRadius: PropTypes.number,
95
+ data: PropTypes.arrayOf(PropTypes.shape({
96
+ color: PropTypes.string.isRequired,
97
+ endAngle: PropTypes.number.isRequired,
98
+ formattedValue: PropTypes.string.isRequired,
99
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
100
+ index: PropTypes.number.isRequired,
101
+ label: PropTypes.string,
102
+ padAngle: PropTypes.number.isRequired,
103
+ startAngle: PropTypes.number.isRequired,
104
+ value: PropTypes.number.isRequired
105
+ })).isRequired,
106
+ /**
107
+ * Override the arc attibutes when it is faded.
108
+ */
109
+ faded: PropTypes.shape({
110
+ additionalRadius: PropTypes.number,
111
+ color: PropTypes.string,
112
+ cornerRadius: PropTypes.number,
113
+ innerRadius: PropTypes.number,
114
+ outerRadius: PropTypes.number,
115
+ paddingAngle: PropTypes.number
116
+ }),
117
+ /**
118
+ * Override the arc attibutes when it is highlighted.
119
+ */
120
+ highlighted: PropTypes.shape({
121
+ additionalRadius: PropTypes.number,
122
+ color: PropTypes.string,
123
+ cornerRadius: PropTypes.number,
124
+ innerRadius: PropTypes.number,
125
+ outerRadius: PropTypes.number,
126
+ paddingAngle: PropTypes.number
127
+ }),
128
+ highlightScope: PropTypes.shape({
129
+ faded: PropTypes.oneOf(['global', 'none', 'series']),
130
+ highlighted: PropTypes.oneOf(['item', 'none', 'series'])
131
+ }),
132
+ id: PropTypes.string.isRequired,
133
+ /**
134
+ * The radius between circle center and the begining of the arc.
135
+ * @default 0
136
+ */
137
+ innerRadius: PropTypes.number,
138
+ /**
139
+ * Callback fired when a pie item is clicked.
140
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
141
+ * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
142
+ * @param {DefaultizedPieValueType} item The pie item.
143
+ */
144
+ onClick: PropTypes.func,
145
+ /**
146
+ * The radius between circle center and the end of the arc.
147
+ * @default R_max The maximal radius that fit into the drawing area.
148
+ */
149
+ outerRadius: PropTypes.number.isRequired,
150
+ /**
151
+ * The padding angle (deg) between two arcs.
152
+ * @default 0
153
+ */
154
+ paddingAngle: PropTypes.number,
155
+ /**
156
+ * If `true`, animations are skiped.
157
+ * @default false
158
+ */
159
+ skipAnimation: PropTypes.bool,
160
+ /**
161
+ * The props used for each component slot.
162
+ * @default {}
163
+ */
164
+ slotProps: PropTypes.object,
165
+ /**
166
+ * Overridable component slots.
167
+ * @default {}
168
+ */
169
+ slots: PropTypes.object
170
+ } : void 0;
171
+ export { PieArcPlot };
@@ -1,4 +1,6 @@
1
- export * from './PiePlot';
2
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 * from './ScatterPlot';
2
1
  export * from './ScatterChart';
2
+ export * from './ScatterPlot';
3
3
  export * from './Scatter';
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-alpha.2
2
+ * @mui/x-charts v7.0.0-alpha.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  function defaultizeValueFormatter(series, defaultValueFormatter) {
3
3
  const defaultizedSeries = {};
4
4
  Object.keys(series).forEach(seriesId => {
5
- defaultizedSeries[seriesId] = _extends({
6
- valueFormatter: defaultValueFormatter
7
- }, series[seriesId]);
5
+ defaultizedSeries[seriesId] = _extends({}, series[seriesId], {
6
+ valueFormatter: series[seriesId].valueFormatter ?? defaultValueFormatter
7
+ });
8
8
  });
9
9
  return defaultizedSeries;
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.0-alpha.3",
4
4
  "description": "The community edition of the charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -30,6 +30,7 @@
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.23.4",
32
32
  "@mui/base": "^5.0.0-beta.24",
33
+ "@mui/system": "^5.14.18",
33
34
  "@react-spring/rafz": "^9.7.3",
34
35
  "@react-spring/web": "^9.7.3",
35
36
  "clsx": "^2.0.0",
@@ -42,7 +43,6 @@
42
43
  "@emotion/react": "^11.9.0",
43
44
  "@emotion/styled": "^11.8.1",
44
45
  "@mui/material": "^5.4.1",
45
- "@mui/system": "^5.4.1",
46
46
  "react": "^17.0.0 || ^18.0.0",
47
47
  "react-dom": "^17.0.0 || ^18.0.0"
48
48
  },