@mui/x-charts 6.18.2 → 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.
- package/BarChart/BarElement.d.ts +5 -1
- package/BarChart/BarElement.js +24 -1
- package/BarChart/index.d.ts +3 -2
- package/BarChart/index.js +31 -12
- package/CHANGELOG.md +59 -0
- package/ChartsLegend/index.d.ts +1 -0
- package/ChartsLegend/index.js +11 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +5 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +93 -73
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +38 -57
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +7 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +174 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +8 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +99 -0
- package/ChartsTooltip/index.d.ts +4 -0
- package/ChartsTooltip/index.js +44 -0
- package/ChartsYAxis/ChartsYAxis.js +6 -4
- package/LineChart/extremums.js +25 -8
- package/LineChart/index.d.ts +5 -5
- package/LineChart/index.js +50 -41
- package/PieChart/PieArcLabelPlot.d.ts +5 -1
- package/PieChart/PieArcLabelPlot.js +89 -1
- package/PieChart/PieArcPlot.d.ts +5 -1
- package/PieChart/PieArcPlot.js +88 -1
- package/PieChart/index.d.ts +6 -6
- package/PieChart/index.js +60 -46
- package/ScatterChart/Scatter.js +1 -1
- package/ScatterChart/index.d.ts +3 -3
- package/ScatterChart/index.js +31 -19
- package/esm/BarChart/BarElement.js +26 -2
- package/esm/BarChart/index.js +3 -2
- package/esm/ChartsLegend/index.js +2 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +95 -75
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +168 -0
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/esm/ChartsTooltip/index.js +5 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +6 -4
- package/esm/LineChart/extremums.js +25 -8
- package/esm/LineChart/index.js +5 -5
- package/esm/PieChart/PieArcLabelPlot.js +91 -2
- package/esm/PieChart/PieArcPlot.js +90 -2
- package/esm/PieChart/index.js +6 -4
- package/esm/ScatterChart/Scatter.js +1 -1
- package/esm/ScatterChart/index.js +3 -3
- package/esm/internals/defaultizeValueFormatter.js +4 -3
- package/index.js +1 -1
- package/internals/defaultizeValueFormatter.d.ts +3 -1
- package/internals/defaultizeValueFormatter.js +3 -3
- package/legacy/BarChart/BarElement.js +26 -2
- package/legacy/BarChart/index.js +3 -2
- package/legacy/ChartsLegend/index.js +2 -1
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +40 -55
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +89 -0
- package/legacy/ChartsTooltip/index.js +5 -1
- package/legacy/ChartsYAxis/ChartsYAxis.js +6 -4
- package/legacy/LineChart/extremums.js +29 -14
- package/legacy/LineChart/index.js +5 -5
- package/legacy/PieChart/PieArcLabelPlot.js +91 -2
- package/legacy/PieChart/PieArcPlot.js +90 -2
- package/legacy/PieChart/index.js +6 -4
- package/legacy/ScatterChart/Scatter.js +1 -1
- package/legacy/ScatterChart/index.js +3 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/defaultizeValueFormatter.js +4 -3
- package/models/seriesType/config.d.ts +5 -1
- package/models/seriesType/scatter.d.ts +1 -1
- package/modern/BarChart/BarElement.js +26 -2
- package/modern/BarChart/index.js +3 -2
- package/modern/ChartsLegend/index.js +2 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +95 -74
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +40 -58
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +167 -0
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +92 -0
- package/modern/ChartsTooltip/index.js +5 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +6 -4
- package/modern/LineChart/extremums.js +25 -8
- package/modern/LineChart/index.js +5 -5
- package/modern/PieChart/PieArcLabelPlot.js +91 -2
- package/modern/PieChart/PieArcPlot.js +90 -2
- package/modern/PieChart/index.js +6 -4
- package/modern/ScatterChart/Scatter.js +1 -1
- package/modern/ScatterChart/index.js +3 -3
- package/modern/index.js +1 -1
- package/modern/internals/defaultizeValueFormatter.js +3 -3
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ exports.PieArcLabelPlot = PieArcLabelPlot;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _web = require("@react-spring/web");
|
|
12
13
|
var _transition = require("./dataTransform/transition");
|
|
13
14
|
var _useTransformData = require("./dataTransform/useTransformData");
|
|
@@ -96,4 +97,91 @@ function PieArcLabelPlot(props) {
|
|
|
96
97
|
}, slotProps?.pieArcLabel));
|
|
97
98
|
})
|
|
98
99
|
}));
|
|
99
|
-
}
|
|
100
|
+
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* The label displayed into the arc.
|
|
108
|
+
*/
|
|
109
|
+
arcLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['formattedValue', 'label', 'value']), _propTypes.default.func]),
|
|
110
|
+
/**
|
|
111
|
+
* The minimal angle required to display the arc label.
|
|
112
|
+
*/
|
|
113
|
+
arcLabelMinAngle: _propTypes.default.number,
|
|
114
|
+
/**
|
|
115
|
+
* The radius applied to arc corners (similar to border radius).
|
|
116
|
+
* @default 0
|
|
117
|
+
*/
|
|
118
|
+
cornerRadius: _propTypes.default.number,
|
|
119
|
+
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
120
|
+
color: _propTypes.default.string.isRequired,
|
|
121
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
122
|
+
formattedValue: _propTypes.default.string.isRequired,
|
|
123
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
124
|
+
index: _propTypes.default.number.isRequired,
|
|
125
|
+
label: _propTypes.default.string,
|
|
126
|
+
padAngle: _propTypes.default.number.isRequired,
|
|
127
|
+
startAngle: _propTypes.default.number.isRequired,
|
|
128
|
+
value: _propTypes.default.number.isRequired
|
|
129
|
+
})).isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* Override the arc attibutes when it is faded.
|
|
132
|
+
*/
|
|
133
|
+
faded: _propTypes.default.shape({
|
|
134
|
+
additionalRadius: _propTypes.default.number,
|
|
135
|
+
color: _propTypes.default.string,
|
|
136
|
+
cornerRadius: _propTypes.default.number,
|
|
137
|
+
innerRadius: _propTypes.default.number,
|
|
138
|
+
outerRadius: _propTypes.default.number,
|
|
139
|
+
paddingAngle: _propTypes.default.number
|
|
140
|
+
}),
|
|
141
|
+
/**
|
|
142
|
+
* Override the arc attibutes when it is highlighted.
|
|
143
|
+
*/
|
|
144
|
+
highlighted: _propTypes.default.shape({
|
|
145
|
+
additionalRadius: _propTypes.default.number,
|
|
146
|
+
color: _propTypes.default.string,
|
|
147
|
+
cornerRadius: _propTypes.default.number,
|
|
148
|
+
innerRadius: _propTypes.default.number,
|
|
149
|
+
outerRadius: _propTypes.default.number,
|
|
150
|
+
paddingAngle: _propTypes.default.number
|
|
151
|
+
}),
|
|
152
|
+
highlightScope: _propTypes.default.shape({
|
|
153
|
+
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
154
|
+
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
155
|
+
}),
|
|
156
|
+
id: _propTypes.default.string.isRequired,
|
|
157
|
+
/**
|
|
158
|
+
* The radius between circle center and the begining of the arc.
|
|
159
|
+
* @default 0
|
|
160
|
+
*/
|
|
161
|
+
innerRadius: _propTypes.default.number,
|
|
162
|
+
/**
|
|
163
|
+
* The radius between circle center and the end of the arc.
|
|
164
|
+
* @default R_max The maximal radius that fit into the drawing area.
|
|
165
|
+
*/
|
|
166
|
+
outerRadius: _propTypes.default.number.isRequired,
|
|
167
|
+
/**
|
|
168
|
+
* The padding angle (deg) between two arcs.
|
|
169
|
+
* @default 0
|
|
170
|
+
*/
|
|
171
|
+
paddingAngle: _propTypes.default.number,
|
|
172
|
+
/**
|
|
173
|
+
* If `true`, animations are skiped.
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
skipAnimation: _propTypes.default.bool,
|
|
177
|
+
/**
|
|
178
|
+
* The props used for each component slot.
|
|
179
|
+
* @default {}
|
|
180
|
+
*/
|
|
181
|
+
slotProps: _propTypes.default.object,
|
|
182
|
+
/**
|
|
183
|
+
* Overridable component slots.
|
|
184
|
+
* @default {}
|
|
185
|
+
*/
|
|
186
|
+
slots: _propTypes.default.object
|
|
187
|
+
} : void 0;
|
package/PieChart/PieArcPlot.d.ts
CHANGED
|
@@ -32,4 +32,8 @@ export interface PieArcPlotProps extends DefaultizedProps<Pick<DefaultizedPieSer
|
|
|
32
32
|
*/
|
|
33
33
|
skipAnimation?: boolean;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
declare function PieArcPlot(props: PieArcPlotProps): React.JSX.Element | null;
|
|
36
|
+
declare namespace PieArcPlot {
|
|
37
|
+
var propTypes: any;
|
|
38
|
+
}
|
|
39
|
+
export { PieArcPlot };
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.PieArcPlot = PieArcPlot;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _web = require("@react-spring/web");
|
|
12
13
|
var _PieArc = require("./PieArc");
|
|
13
14
|
var _transition = require("./dataTransform/transition");
|
|
@@ -89,4 +90,90 @@ function PieArcPlot(props) {
|
|
|
89
90
|
}, slotProps?.pieArc));
|
|
90
91
|
})
|
|
91
92
|
}));
|
|
92
|
-
}
|
|
93
|
+
}
|
|
94
|
+
process.env.NODE_ENV !== "production" ? PieArcPlot.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
|
+
/**
|
|
100
|
+
* The radius applied to arc corners (similar to border radius).
|
|
101
|
+
* @default 0
|
|
102
|
+
*/
|
|
103
|
+
cornerRadius: _propTypes.default.number,
|
|
104
|
+
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
105
|
+
color: _propTypes.default.string.isRequired,
|
|
106
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
107
|
+
formattedValue: _propTypes.default.string.isRequired,
|
|
108
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
109
|
+
index: _propTypes.default.number.isRequired,
|
|
110
|
+
label: _propTypes.default.string,
|
|
111
|
+
padAngle: _propTypes.default.number.isRequired,
|
|
112
|
+
startAngle: _propTypes.default.number.isRequired,
|
|
113
|
+
value: _propTypes.default.number.isRequired
|
|
114
|
+
})).isRequired,
|
|
115
|
+
/**
|
|
116
|
+
* Override the arc attibutes when it is faded.
|
|
117
|
+
*/
|
|
118
|
+
faded: _propTypes.default.shape({
|
|
119
|
+
additionalRadius: _propTypes.default.number,
|
|
120
|
+
color: _propTypes.default.string,
|
|
121
|
+
cornerRadius: _propTypes.default.number,
|
|
122
|
+
innerRadius: _propTypes.default.number,
|
|
123
|
+
outerRadius: _propTypes.default.number,
|
|
124
|
+
paddingAngle: _propTypes.default.number
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* Override the arc attibutes when it is highlighted.
|
|
128
|
+
*/
|
|
129
|
+
highlighted: _propTypes.default.shape({
|
|
130
|
+
additionalRadius: _propTypes.default.number,
|
|
131
|
+
color: _propTypes.default.string,
|
|
132
|
+
cornerRadius: _propTypes.default.number,
|
|
133
|
+
innerRadius: _propTypes.default.number,
|
|
134
|
+
outerRadius: _propTypes.default.number,
|
|
135
|
+
paddingAngle: _propTypes.default.number
|
|
136
|
+
}),
|
|
137
|
+
highlightScope: _propTypes.default.shape({
|
|
138
|
+
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
139
|
+
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
140
|
+
}),
|
|
141
|
+
id: _propTypes.default.string.isRequired,
|
|
142
|
+
/**
|
|
143
|
+
* The radius between circle center and the begining of the arc.
|
|
144
|
+
* @default 0
|
|
145
|
+
*/
|
|
146
|
+
innerRadius: _propTypes.default.number,
|
|
147
|
+
/**
|
|
148
|
+
* Callback fired when a pie item is clicked.
|
|
149
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
150
|
+
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
151
|
+
* @param {DefaultizedPieValueType} item The pie item.
|
|
152
|
+
*/
|
|
153
|
+
onClick: _propTypes.default.func,
|
|
154
|
+
/**
|
|
155
|
+
* The radius between circle center and the end of the arc.
|
|
156
|
+
* @default R_max The maximal radius that fit into the drawing area.
|
|
157
|
+
*/
|
|
158
|
+
outerRadius: _propTypes.default.number.isRequired,
|
|
159
|
+
/**
|
|
160
|
+
* The padding angle (deg) between two arcs.
|
|
161
|
+
* @default 0
|
|
162
|
+
*/
|
|
163
|
+
paddingAngle: _propTypes.default.number,
|
|
164
|
+
/**
|
|
165
|
+
* If `true`, animations are skiped.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
skipAnimation: _propTypes.default.bool,
|
|
169
|
+
/**
|
|
170
|
+
* The props used for each component slot.
|
|
171
|
+
* @default {}
|
|
172
|
+
*/
|
|
173
|
+
slotProps: _propTypes.default.object,
|
|
174
|
+
/**
|
|
175
|
+
* Overridable component slots.
|
|
176
|
+
* @default {}
|
|
177
|
+
*/
|
|
178
|
+
slots: _propTypes.default.object
|
|
179
|
+
} : void 0;
|
package/PieChart/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export * from './PieChart';
|
|
2
|
+
export * from './PiePlot';
|
|
3
|
+
export * from './PieArcPlot';
|
|
4
|
+
export * from './PieArcLabelPlot';
|
|
5
|
+
export * from './PieArc';
|
|
6
|
+
export * from './PieArcLabel';
|
package/PieChart/index.js
CHANGED
|
@@ -3,55 +3,69 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PieChart", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _PieChart.PieChart;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PiePlot", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _PiePlot.PiePlot;
|
|
28
|
-
}
|
|
6
|
+
var _PieChart = require("./PieChart");
|
|
7
|
+
Object.keys(_PieChart).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _PieChart[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _PieChart[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
29
16
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
var _PiePlot = require("./PiePlot");
|
|
18
|
+
Object.keys(_PiePlot).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _PiePlot[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _PiePlot[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
35
27
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
var _PieArcPlot = require("./PieArcPlot");
|
|
29
|
+
Object.keys(_PieArcPlot).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _PieArcPlot[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _PieArcPlot[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
41
38
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
var _PieArcLabelPlot = require("./PieArcLabelPlot");
|
|
40
|
+
Object.keys(_PieArcLabelPlot).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _PieArcLabelPlot[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _PieArcLabelPlot[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
47
49
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
var _PieArc = require("./PieArc");
|
|
51
|
+
Object.keys(_PieArc).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _PieArc[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _PieArc[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
53
60
|
});
|
|
54
|
-
var _PiePlot = require("./PiePlot");
|
|
55
|
-
var _PieChart = require("./PieChart");
|
|
56
61
|
var _PieArcLabel = require("./PieArcLabel");
|
|
57
|
-
|
|
62
|
+
Object.keys(_PieArcLabel).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _PieArcLabel[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _PieArcLabel[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
package/ScatterChart/Scatter.js
CHANGED
|
@@ -87,7 +87,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
|
|
|
87
87
|
color: _propTypes.default.string.isRequired,
|
|
88
88
|
markerSize: _propTypes.default.number.isRequired,
|
|
89
89
|
series: _propTypes.default.shape({
|
|
90
|
-
color: _propTypes.default.string,
|
|
90
|
+
color: _propTypes.default.string.isRequired,
|
|
91
91
|
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
92
92
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
93
93
|
x: _propTypes.default.number.isRequired,
|
package/ScatterChart/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './ScatterChart';
|
|
2
|
+
export * from './ScatterPlot';
|
|
3
|
+
export * from './Scatter';
|
package/ScatterChart/index.js
CHANGED
|
@@ -3,24 +3,36 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "ScatterPlot", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ScatterPlot.ScatterPlot;
|
|
22
|
-
}
|
|
6
|
+
var _ScatterChart = require("./ScatterChart");
|
|
7
|
+
Object.keys(_ScatterChart).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ScatterChart[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ScatterChart[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
23
16
|
});
|
|
24
17
|
var _ScatterPlot = require("./ScatterPlot");
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
Object.keys(_ScatterPlot).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ScatterPlot[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _ScatterPlot[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _Scatter = require("./Scatter");
|
|
29
|
+
Object.keys(_Scatter).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Scatter[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Scatter[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -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
|
-
|
|
43
|
+
function BarElement(props) {
|
|
43
44
|
var _slots$bar;
|
|
44
45
|
const {
|
|
45
46
|
id,
|
|
@@ -90,4 +91,27 @@ export function BarElement(props) {
|
|
|
90
91
|
ownerState
|
|
91
92
|
});
|
|
92
93
|
return /*#__PURE__*/_jsx(Bar, _extends({}, barProps));
|
|
93
|
-
}
|
|
94
|
+
}
|
|
95
|
+
process.env.NODE_ENV !== "production" ? BarElement.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
|
+
classes: PropTypes.object,
|
|
101
|
+
dataIndex: PropTypes.number.isRequired,
|
|
102
|
+
highlightScope: PropTypes.shape({
|
|
103
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
104
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
105
|
+
}),
|
|
106
|
+
/**
|
|
107
|
+
* The props used for each component slot.
|
|
108
|
+
* @default {}
|
|
109
|
+
*/
|
|
110
|
+
slotProps: PropTypes.object,
|
|
111
|
+
/**
|
|
112
|
+
* Overridable component slots.
|
|
113
|
+
* @default {}
|
|
114
|
+
*/
|
|
115
|
+
slots: PropTypes.object
|
|
116
|
+
} : void 0;
|
|
117
|
+
export { BarElement };
|
package/esm/BarChart/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './BarChart';
|
|
2
|
+
export * from './BarPlot';
|
|
3
|
+
export * from './BarElement';
|
|
@@ -1,82 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import Typography from '@mui/material/Typography';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
5
4
|
import { useSlotProps } from '@mui/base/utils';
|
|
6
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
7
6
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
8
|
-
import {
|
|
7
|
+
import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
|
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
export function DefaultChartsAxisContent(props) {
|
|
12
|
-
var _axis$valueFormatter;
|
|
13
|
-
const {
|
|
14
|
-
series,
|
|
15
|
-
axis,
|
|
16
|
-
dataIndex,
|
|
17
|
-
axisValue,
|
|
18
|
-
sx,
|
|
19
|
-
classes
|
|
20
|
-
} = props;
|
|
21
|
-
if (dataIndex == null) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
const axisFormatter = (_axis$valueFormatter = axis.valueFormatter) != null ? _axis$valueFormatter : v => v.toLocaleString();
|
|
25
|
-
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
26
|
-
sx: sx,
|
|
27
|
-
className: classes.root,
|
|
28
|
-
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
29
|
-
className: classes.table,
|
|
30
|
-
children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
|
|
31
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
|
|
32
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
33
|
-
colSpan: 3,
|
|
34
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
35
|
-
children: axisFormatter(axisValue)
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
40
|
-
children: series.map(({
|
|
41
|
-
color,
|
|
42
|
-
id,
|
|
43
|
-
label,
|
|
44
|
-
valueFormatter,
|
|
45
|
-
data
|
|
46
|
-
}) => {
|
|
47
|
-
const formattedValue = valueFormatter(data[dataIndex]);
|
|
48
|
-
if (formattedValue == null) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
52
|
-
className: classes.row,
|
|
53
|
-
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
54
|
-
className: clsx(classes.markCell, classes.cell),
|
|
55
|
-
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
56
|
-
ownerState: {
|
|
57
|
-
color
|
|
58
|
-
},
|
|
59
|
-
boxShadow: 1,
|
|
60
|
-
className: classes.mark
|
|
61
|
-
})
|
|
62
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
63
|
-
className: clsx(classes.labelCell, classes.cell),
|
|
64
|
-
children: label ? /*#__PURE__*/_jsx(Typography, {
|
|
65
|
-
children: label
|
|
66
|
-
}) : null
|
|
67
|
-
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
68
|
-
className: clsx(classes.valueCell, classes.cell),
|
|
69
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
70
|
-
children: formattedValue
|
|
71
|
-
})
|
|
72
|
-
})]
|
|
73
|
-
}, id);
|
|
74
|
-
})
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
export function ChartsAxisTooltipContent(props) {
|
|
9
|
+
function ChartsAxisTooltipContent(props) {
|
|
80
10
|
const {
|
|
81
11
|
content,
|
|
82
12
|
contentProps,
|
|
@@ -111,7 +41,7 @@ export function ChartsAxisTooltipContent(props) {
|
|
|
111
41
|
const relevantAxis = React.useMemo(() => {
|
|
112
42
|
return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
|
|
113
43
|
}, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
|
|
114
|
-
const Content = content != null ? content :
|
|
44
|
+
const Content = content != null ? content : DefaultChartsAxisTooltipContent;
|
|
115
45
|
const chartTooltipContentProps = useSlotProps({
|
|
116
46
|
elementType: Content,
|
|
117
47
|
externalSlotProps: contentProps,
|
|
@@ -127,4 +57,94 @@ export function ChartsAxisTooltipContent(props) {
|
|
|
127
57
|
ownerState: {}
|
|
128
58
|
});
|
|
129
59
|
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
130
|
-
}
|
|
60
|
+
}
|
|
61
|
+
process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
62
|
+
// ----------------------------- Warning --------------------------------
|
|
63
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
65
|
+
// ----------------------------------------------------------------------
|
|
66
|
+
axisData: PropTypes.shape({
|
|
67
|
+
x: PropTypes.shape({
|
|
68
|
+
index: PropTypes.number,
|
|
69
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
70
|
+
}),
|
|
71
|
+
y: PropTypes.shape({
|
|
72
|
+
index: PropTypes.number,
|
|
73
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
74
|
+
})
|
|
75
|
+
}).isRequired,
|
|
76
|
+
classes: PropTypes.object.isRequired,
|
|
77
|
+
content: PropTypes.elementType,
|
|
78
|
+
contentProps: PropTypes.shape({
|
|
79
|
+
axis: PropTypes.shape({
|
|
80
|
+
axisId: PropTypes.string,
|
|
81
|
+
classes: PropTypes.object,
|
|
82
|
+
data: PropTypes.array,
|
|
83
|
+
dataKey: PropTypes.string,
|
|
84
|
+
disableLine: PropTypes.bool,
|
|
85
|
+
disableTicks: PropTypes.bool,
|
|
86
|
+
fill: PropTypes.string,
|
|
87
|
+
hideTooltip: PropTypes.bool,
|
|
88
|
+
id: PropTypes.string.isRequired,
|
|
89
|
+
label: PropTypes.string,
|
|
90
|
+
labelFontSize: PropTypes.number,
|
|
91
|
+
labelStyle: PropTypes.object,
|
|
92
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
93
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
94
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
95
|
+
scale: PropTypes.func.isRequired,
|
|
96
|
+
scaleType: PropTypes.oneOf(['time']).isRequired,
|
|
97
|
+
slotProps: PropTypes.object,
|
|
98
|
+
slots: PropTypes.object,
|
|
99
|
+
stroke: PropTypes.string,
|
|
100
|
+
tickFontSize: PropTypes.number,
|
|
101
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
102
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
103
|
+
tickLabelStyle: PropTypes.object,
|
|
104
|
+
tickMaxStep: PropTypes.number,
|
|
105
|
+
tickMinStep: PropTypes.number,
|
|
106
|
+
tickNumber: PropTypes.number.isRequired,
|
|
107
|
+
tickSize: PropTypes.number,
|
|
108
|
+
valueFormatter: PropTypes.func
|
|
109
|
+
}),
|
|
110
|
+
axisData: PropTypes.shape({
|
|
111
|
+
x: PropTypes.shape({
|
|
112
|
+
index: PropTypes.number,
|
|
113
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
114
|
+
}),
|
|
115
|
+
y: PropTypes.shape({
|
|
116
|
+
index: PropTypes.number,
|
|
117
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
|
|
118
|
+
})
|
|
119
|
+
}),
|
|
120
|
+
axisValue: PropTypes.any,
|
|
121
|
+
classes: PropTypes.object,
|
|
122
|
+
dataIndex: PropTypes.number,
|
|
123
|
+
series: PropTypes.arrayOf(PropTypes.shape({
|
|
124
|
+
area: PropTypes.bool,
|
|
125
|
+
color: PropTypes.string.isRequired,
|
|
126
|
+
connectNulls: PropTypes.bool,
|
|
127
|
+
curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
128
|
+
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
129
|
+
dataKey: PropTypes.string,
|
|
130
|
+
disableHighlight: PropTypes.bool,
|
|
131
|
+
highlightScope: PropTypes.shape({
|
|
132
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
133
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
134
|
+
}),
|
|
135
|
+
id: PropTypes.string.isRequired,
|
|
136
|
+
label: PropTypes.string,
|
|
137
|
+
showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
138
|
+
stack: PropTypes.string,
|
|
139
|
+
stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
|
|
140
|
+
stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
|
|
141
|
+
type: PropTypes.oneOf(['line']).isRequired,
|
|
142
|
+
valueFormatter: PropTypes.func.isRequired,
|
|
143
|
+
xAxisKey: PropTypes.string,
|
|
144
|
+
yAxisKey: PropTypes.string
|
|
145
|
+
})),
|
|
146
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
147
|
+
}),
|
|
148
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
149
|
+
} : void 0;
|
|
150
|
+
export { ChartsAxisTooltipContent };
|