@mui/x-charts 6.0.0-alpha.6 → 6.0.0-alpha.7
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/BarChart.d.ts +18 -2
- package/BarChart/BarChart.js +60 -11
- package/BarChart/BarElement.d.ts +22 -0
- package/BarChart/BarElement.js +21 -10
- package/BarChart/BarPlot.d.ts +14 -1
- package/BarChart/BarPlot.js +23 -4
- package/CHANGELOG.md +62 -0
- package/ChartsAxis/ChartsAxis.d.ts +11 -1
- package/ChartsAxis/ChartsAxis.js +51 -6
- package/ChartsLegend/ChartsLegend.d.ts +25 -2
- package/ChartsLegend/ChartsLegend.js +49 -17
- package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
- package/ChartsXAxis/ChartsXAxis.js +44 -9
- package/ChartsYAxis/ChartsYAxis.js +44 -9
- package/LineChart/AreaElement.d.ts +22 -0
- package/LineChart/AreaElement.js +31 -11
- package/LineChart/AreaPlot.d.ts +14 -1
- package/LineChart/AreaPlot.js +29 -3
- package/LineChart/LineChart.d.ts +20 -2
- package/LineChart/LineChart.js +62 -10
- package/LineChart/LineElement.d.ts +22 -0
- package/LineChart/LineElement.js +31 -10
- package/LineChart/LinePlot.d.ts +14 -1
- package/LineChart/LinePlot.js +35 -4
- package/LineChart/MarkPlot.d.ts +24 -1
- package/LineChart/MarkPlot.js +25 -3
- package/PieChart/PieArcLabel.js +0 -1
- package/PieChart/PieChart.d.ts +14 -2
- package/PieChart/PieChart.js +51 -9
- package/PieChart/PiePlot.d.ts +27 -1
- package/PieChart/PiePlot.js +29 -6
- package/ScatterChart/ScatterChart.d.ts +18 -2
- package/ScatterChart/ScatterChart.js +55 -9
- package/ScatterChart/ScatterPlot.d.ts +24 -1
- package/ScatterChart/ScatterPlot.js +28 -4
- package/SparkLineChart/SparkLineChart.d.ts +18 -0
- package/SparkLineChart/SparkLineChart.js +28 -5
- package/colorPalettes/colorPalettes.js +2 -2
- package/context/CartesianContextProvider.js +14 -8
- package/esm/BarChart/BarChart.js +60 -11
- package/esm/BarChart/BarElement.js +21 -11
- package/esm/BarChart/BarPlot.js +23 -4
- package/esm/ChartsAxis/ChartsAxis.js +51 -6
- package/esm/ChartsLegend/ChartsLegend.js +47 -14
- package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
- package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
- package/esm/LineChart/AreaElement.js +31 -11
- package/esm/LineChart/AreaPlot.js +31 -4
- package/esm/LineChart/LineChart.js +62 -10
- package/esm/LineChart/LineElement.js +31 -11
- package/esm/LineChart/LinePlot.js +43 -8
- package/esm/LineChart/MarkPlot.js +28 -4
- package/esm/PieChart/PieArcLabel.js +0 -1
- package/esm/PieChart/PieChart.js +51 -9
- package/esm/PieChart/PiePlot.js +31 -6
- package/esm/ScatterChart/ScatterChart.js +55 -9
- package/esm/ScatterChart/ScatterPlot.js +29 -4
- package/esm/SparkLineChart/SparkLineChart.js +28 -5
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/context/CartesianContextProvider.js +14 -8
- package/esm/hooks/useTicks.js +9 -6
- package/esm/internals/components/AxisSharedComponents.js +10 -10
- package/hooks/useTicks.d.ts +20 -5
- package/hooks/useTicks.js +9 -6
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +4 -4
- package/internals/components/AxisSharedComponents.js +15 -15
- package/legacy/BarChart/BarChart.js +60 -11
- package/legacy/BarChart/BarElement.js +20 -10
- package/legacy/BarChart/BarPlot.js +23 -4
- package/legacy/ChartsAxis/ChartsAxis.js +51 -6
- package/legacy/ChartsLegend/ChartsLegend.js +46 -15
- package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
- package/legacy/LineChart/AreaElement.js +30 -10
- package/legacy/LineChart/AreaPlot.js +29 -4
- package/legacy/LineChart/LineChart.js +62 -10
- package/legacy/LineChart/LineElement.js +30 -10
- package/legacy/LineChart/LinePlot.js +36 -5
- package/legacy/LineChart/MarkPlot.js +26 -4
- package/legacy/PieChart/PieArcLabel.js +0 -1
- package/legacy/PieChart/PieChart.js +51 -9
- package/legacy/PieChart/PiePlot.js +29 -6
- package/legacy/ScatterChart/ScatterChart.js +55 -9
- package/legacy/ScatterChart/ScatterPlot.js +27 -4
- package/legacy/SparkLineChart/SparkLineChart.js +28 -5
- package/legacy/colorPalettes/colorPalettes.js +2 -2
- package/legacy/context/CartesianContextProvider.js +14 -8
- package/legacy/hooks/useTicks.js +9 -9
- package/legacy/index.js +1 -1
- package/legacy/internals/components/AxisSharedComponents.js +10 -10
- package/models/axis.d.ts +24 -1
- package/modern/BarChart/BarChart.js +60 -11
- package/modern/BarChart/BarElement.js +20 -11
- package/modern/BarChart/BarPlot.js +23 -4
- package/modern/ChartsAxis/ChartsAxis.js +51 -6
- package/modern/ChartsLegend/ChartsLegend.js +46 -14
- package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
- package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
- package/modern/LineChart/AreaElement.js +30 -11
- package/modern/LineChart/AreaPlot.js +31 -4
- package/modern/LineChart/LineChart.js +62 -10
- package/modern/LineChart/LineElement.js +30 -11
- package/modern/LineChart/LinePlot.js +37 -5
- package/modern/LineChart/MarkPlot.js +27 -4
- package/modern/PieChart/PieArcLabel.js +0 -1
- package/modern/PieChart/PieChart.js +51 -9
- package/modern/PieChart/PiePlot.js +30 -6
- package/modern/ScatterChart/ScatterChart.js +55 -9
- package/modern/ScatterChart/ScatterPlot.js +28 -4
- package/modern/SparkLineChart/SparkLineChart.js +28 -5
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/context/CartesianContextProvider.js +14 -8
- package/modern/hooks/useTicks.js +9 -6
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +10 -10
- package/package.json +2 -2
- package/themeAugmentation/components.d.ts +0 -10
- package/themeAugmentation/overrides.d.ts +0 -2
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -44,7 +44,9 @@ function PieChart(props) {
|
|
|
44
44
|
leftAxis = null,
|
|
45
45
|
rightAxis = null,
|
|
46
46
|
bottomAxis = null,
|
|
47
|
-
children
|
|
47
|
+
children,
|
|
48
|
+
slots,
|
|
49
|
+
slotProps
|
|
48
50
|
} = props;
|
|
49
51
|
const margin = _extends({}, defaultMargin, marginProps);
|
|
50
52
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
@@ -67,8 +69,16 @@ function PieChart(props) {
|
|
|
67
69
|
topAxis: topAxis,
|
|
68
70
|
leftAxis: leftAxis,
|
|
69
71
|
rightAxis: rightAxis,
|
|
70
|
-
bottomAxis: bottomAxis
|
|
71
|
-
|
|
72
|
+
bottomAxis: bottomAxis,
|
|
73
|
+
slots: slots,
|
|
74
|
+
slotProps: slotProps
|
|
75
|
+
}), /*#__PURE__*/_jsx(PiePlot, {
|
|
76
|
+
slots: slots,
|
|
77
|
+
slotProps: slotProps
|
|
78
|
+
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
79
|
+
slots: slots,
|
|
80
|
+
slotProps: slotProps
|
|
81
|
+
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), children]
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
84
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -94,8 +104,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
94
104
|
label: PropTypes.string,
|
|
95
105
|
labelFontSize: PropTypes.number,
|
|
96
106
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
107
|
+
slotProps: PropTypes.object,
|
|
108
|
+
slots: PropTypes.object,
|
|
97
109
|
stroke: PropTypes.string,
|
|
98
110
|
tickFontSize: PropTypes.number,
|
|
111
|
+
tickMaxStep: PropTypes.number,
|
|
112
|
+
tickMinStep: PropTypes.number,
|
|
113
|
+
tickNumber: PropTypes.number,
|
|
99
114
|
tickSize: PropTypes.number
|
|
100
115
|
}), PropTypes.string]),
|
|
101
116
|
children: PropTypes.node,
|
|
@@ -122,8 +137,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
122
137
|
label: PropTypes.string,
|
|
123
138
|
labelFontSize: PropTypes.number,
|
|
124
139
|
position: PropTypes.oneOf(['left', 'right']),
|
|
140
|
+
slotProps: PropTypes.object,
|
|
141
|
+
slots: PropTypes.object,
|
|
125
142
|
stroke: PropTypes.string,
|
|
126
143
|
tickFontSize: PropTypes.number,
|
|
144
|
+
tickMaxStep: PropTypes.number,
|
|
145
|
+
tickMinStep: PropTypes.number,
|
|
146
|
+
tickNumber: PropTypes.number,
|
|
127
147
|
tickSize: PropTypes.number
|
|
128
148
|
}), PropTypes.string]),
|
|
129
149
|
legend: PropTypes.shape({
|
|
@@ -140,6 +160,8 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
140
160
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
141
161
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
142
162
|
}),
|
|
163
|
+
slotProps: PropTypes.object,
|
|
164
|
+
slots: PropTypes.object,
|
|
143
165
|
spacing: PropTypes.number
|
|
144
166
|
}),
|
|
145
167
|
margin: PropTypes.shape({
|
|
@@ -162,8 +184,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
162
184
|
label: PropTypes.string,
|
|
163
185
|
labelFontSize: PropTypes.number,
|
|
164
186
|
position: PropTypes.oneOf(['left', 'right']),
|
|
187
|
+
slotProps: PropTypes.object,
|
|
188
|
+
slots: PropTypes.object,
|
|
165
189
|
stroke: PropTypes.string,
|
|
166
190
|
tickFontSize: PropTypes.number,
|
|
191
|
+
tickMaxStep: PropTypes.number,
|
|
192
|
+
tickMinStep: PropTypes.number,
|
|
193
|
+
tickNumber: PropTypes.number,
|
|
167
194
|
tickSize: PropTypes.number
|
|
168
195
|
}), PropTypes.string]),
|
|
169
196
|
series: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -205,6 +232,12 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
205
232
|
type: PropTypes.oneOf(['pie']),
|
|
206
233
|
valueFormatter: PropTypes.func
|
|
207
234
|
})).isRequired,
|
|
235
|
+
/**
|
|
236
|
+
* The props used for each component slot.
|
|
237
|
+
* @default {}
|
|
238
|
+
*/
|
|
239
|
+
slotProps: PropTypes.object,
|
|
240
|
+
slots: PropTypes.object,
|
|
208
241
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
209
242
|
title: PropTypes.string,
|
|
210
243
|
tooltip: PropTypes.shape({
|
|
@@ -227,8 +260,13 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
227
260
|
label: PropTypes.string,
|
|
228
261
|
labelFontSize: PropTypes.number,
|
|
229
262
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
263
|
+
slotProps: PropTypes.object,
|
|
264
|
+
slots: PropTypes.object,
|
|
230
265
|
stroke: PropTypes.string,
|
|
231
266
|
tickFontSize: PropTypes.number,
|
|
267
|
+
tickMaxStep: PropTypes.number,
|
|
268
|
+
tickMinStep: PropTypes.number,
|
|
269
|
+
tickNumber: PropTypes.number,
|
|
232
270
|
tickSize: PropTypes.number
|
|
233
271
|
}), PropTypes.string]),
|
|
234
272
|
viewBox: PropTypes.shape({
|
|
@@ -251,15 +289,17 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
251
289
|
label: PropTypes.string,
|
|
252
290
|
labelFontSize: PropTypes.number,
|
|
253
291
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
254
|
-
maxTicks: PropTypes.number,
|
|
255
292
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
256
|
-
minTicks: PropTypes.number,
|
|
257
293
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
258
294
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
295
|
+
slotProps: PropTypes.object,
|
|
296
|
+
slots: PropTypes.object,
|
|
259
297
|
stroke: PropTypes.string,
|
|
260
298
|
tickFontSize: PropTypes.number,
|
|
299
|
+
tickMaxStep: PropTypes.number,
|
|
300
|
+
tickMinStep: PropTypes.number,
|
|
301
|
+
tickNumber: PropTypes.number,
|
|
261
302
|
tickSize: PropTypes.number,
|
|
262
|
-
tickSpacing: PropTypes.number,
|
|
263
303
|
valueFormatter: PropTypes.func
|
|
264
304
|
})),
|
|
265
305
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -275,15 +315,17 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
275
315
|
label: PropTypes.string,
|
|
276
316
|
labelFontSize: PropTypes.number,
|
|
277
317
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
278
|
-
maxTicks: PropTypes.number,
|
|
279
318
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
280
|
-
minTicks: PropTypes.number,
|
|
281
319
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
282
320
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
321
|
+
slotProps: PropTypes.object,
|
|
322
|
+
slots: PropTypes.object,
|
|
283
323
|
stroke: PropTypes.string,
|
|
284
324
|
tickFontSize: PropTypes.number,
|
|
325
|
+
tickMaxStep: PropTypes.number,
|
|
326
|
+
tickMinStep: PropTypes.number,
|
|
327
|
+
tickNumber: PropTypes.number,
|
|
285
328
|
tickSize: PropTypes.number,
|
|
286
|
-
tickSpacing: PropTypes.number,
|
|
287
329
|
valueFormatter: PropTypes.func
|
|
288
330
|
}))
|
|
289
331
|
} : void 0;
|
package/esm/PieChart/PiePlot.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
4
5
|
import PieArc from './PieArc';
|
|
5
6
|
import PieArcLabel from './PieArcLabel';
|
|
@@ -22,7 +23,12 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
|
22
23
|
}
|
|
23
24
|
return arcLabel(item);
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
function PiePlot(props) {
|
|
27
|
+
var _slots$pieArc, _slots$pieArcLabel;
|
|
28
|
+
const {
|
|
29
|
+
slots,
|
|
30
|
+
slotProps
|
|
31
|
+
} = props;
|
|
26
32
|
const seriesData = React.useContext(SeriesContext).pie;
|
|
27
33
|
const {
|
|
28
34
|
left,
|
|
@@ -42,6 +48,8 @@ export function PiePlot() {
|
|
|
42
48
|
series,
|
|
43
49
|
seriesOrder
|
|
44
50
|
} = seriesData;
|
|
51
|
+
const Arc = (_slots$pieArc = slots == null ? void 0 : slots.pieArc) != null ? _slots$pieArc : PieArc;
|
|
52
|
+
const ArcLabel = (_slots$pieArcLabel = slots == null ? void 0 : slots.pieArcLabel) != null ? _slots$pieArcLabel : PieArcLabel;
|
|
45
53
|
return /*#__PURE__*/_jsx("g", {
|
|
46
54
|
children: seriesOrder.map(seriesId => {
|
|
47
55
|
const {
|
|
@@ -60,7 +68,7 @@ export function PiePlot() {
|
|
|
60
68
|
transform: `translate(${cx === undefined ? center.x : left + cx}, ${cy === undefined ? center.y : top + cy})`,
|
|
61
69
|
children: /*#__PURE__*/_jsxs("g", {
|
|
62
70
|
children: [data.map((item, index) => {
|
|
63
|
-
return /*#__PURE__*/_createElement(
|
|
71
|
+
return /*#__PURE__*/_createElement(Arc, _extends({}, item, {
|
|
64
72
|
key: item.id,
|
|
65
73
|
innerRadius: innerRadius,
|
|
66
74
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -71,9 +79,9 @@ export function PiePlot() {
|
|
|
71
79
|
highlightScope: series[seriesId].highlightScope,
|
|
72
80
|
highlighted: highlighted,
|
|
73
81
|
faded: faded
|
|
74
|
-
}));
|
|
82
|
+
}, slotProps == null ? void 0 : slotProps.pieArc));
|
|
75
83
|
}), data.map((item, index) => {
|
|
76
|
-
return /*#__PURE__*/_createElement(
|
|
84
|
+
return /*#__PURE__*/_createElement(ArcLabel, _extends({}, item, {
|
|
77
85
|
key: item.id,
|
|
78
86
|
innerRadius: innerRadius,
|
|
79
87
|
outerRadius: outerRadius != null ? outerRadius : availableRadius,
|
|
@@ -83,10 +91,27 @@ export function PiePlot() {
|
|
|
83
91
|
dataIndex: index,
|
|
84
92
|
highlightScope: series[seriesId].highlightScope,
|
|
85
93
|
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
86
|
-
}));
|
|
94
|
+
}, slotProps == null ? void 0 : slotProps.pieArcLabel));
|
|
87
95
|
})]
|
|
88
96
|
})
|
|
89
97
|
}, seriesId);
|
|
90
98
|
})
|
|
91
99
|
});
|
|
92
|
-
}
|
|
100
|
+
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? PiePlot.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 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 { PiePlot };
|
|
@@ -26,7 +26,9 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
26
26
|
leftAxis,
|
|
27
27
|
rightAxis,
|
|
28
28
|
bottomAxis,
|
|
29
|
-
children
|
|
29
|
+
children,
|
|
30
|
+
slots,
|
|
31
|
+
slotProps
|
|
30
32
|
} = props;
|
|
31
33
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
32
34
|
ref: ref,
|
|
@@ -44,8 +46,16 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
44
46
|
topAxis: topAxis,
|
|
45
47
|
leftAxis: leftAxis,
|
|
46
48
|
rightAxis: rightAxis,
|
|
47
|
-
bottomAxis: bottomAxis
|
|
48
|
-
|
|
49
|
+
bottomAxis: bottomAxis,
|
|
50
|
+
slots: slots,
|
|
51
|
+
slotProps: slotProps
|
|
52
|
+
}), /*#__PURE__*/_jsx(ScatterPlot, {
|
|
53
|
+
slots: slots,
|
|
54
|
+
slotProps: slotProps
|
|
55
|
+
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
56
|
+
slots: slots,
|
|
57
|
+
slotProps: slotProps
|
|
58
|
+
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({
|
|
49
59
|
x: "none",
|
|
50
60
|
y: "none"
|
|
51
61
|
}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({
|
|
@@ -76,8 +86,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
76
86
|
label: PropTypes.string,
|
|
77
87
|
labelFontSize: PropTypes.number,
|
|
78
88
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
89
|
+
slotProps: PropTypes.object,
|
|
90
|
+
slots: PropTypes.object,
|
|
79
91
|
stroke: PropTypes.string,
|
|
80
92
|
tickFontSize: PropTypes.number,
|
|
93
|
+
tickMaxStep: PropTypes.number,
|
|
94
|
+
tickMinStep: PropTypes.number,
|
|
95
|
+
tickNumber: PropTypes.number,
|
|
81
96
|
tickSize: PropTypes.number
|
|
82
97
|
}), PropTypes.string]),
|
|
83
98
|
children: PropTypes.node,
|
|
@@ -104,8 +119,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
104
119
|
label: PropTypes.string,
|
|
105
120
|
labelFontSize: PropTypes.number,
|
|
106
121
|
position: PropTypes.oneOf(['left', 'right']),
|
|
122
|
+
slotProps: PropTypes.object,
|
|
123
|
+
slots: PropTypes.object,
|
|
107
124
|
stroke: PropTypes.string,
|
|
108
125
|
tickFontSize: PropTypes.number,
|
|
126
|
+
tickMaxStep: PropTypes.number,
|
|
127
|
+
tickMinStep: PropTypes.number,
|
|
128
|
+
tickNumber: PropTypes.number,
|
|
109
129
|
tickSize: PropTypes.number
|
|
110
130
|
}), PropTypes.string]),
|
|
111
131
|
legend: PropTypes.shape({
|
|
@@ -122,6 +142,8 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
122
142
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
123
143
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
124
144
|
}),
|
|
145
|
+
slotProps: PropTypes.object,
|
|
146
|
+
slots: PropTypes.object,
|
|
125
147
|
spacing: PropTypes.number
|
|
126
148
|
}),
|
|
127
149
|
margin: PropTypes.shape({
|
|
@@ -144,8 +166,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
144
166
|
label: PropTypes.string,
|
|
145
167
|
labelFontSize: PropTypes.number,
|
|
146
168
|
position: PropTypes.oneOf(['left', 'right']),
|
|
169
|
+
slotProps: PropTypes.object,
|
|
170
|
+
slots: PropTypes.object,
|
|
147
171
|
stroke: PropTypes.string,
|
|
148
172
|
tickFontSize: PropTypes.number,
|
|
173
|
+
tickMaxStep: PropTypes.number,
|
|
174
|
+
tickMinStep: PropTypes.number,
|
|
175
|
+
tickNumber: PropTypes.number,
|
|
149
176
|
tickSize: PropTypes.number
|
|
150
177
|
}), PropTypes.string]),
|
|
151
178
|
series: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -167,6 +194,16 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
167
194
|
xAxisKey: PropTypes.string,
|
|
168
195
|
yAxisKey: PropTypes.string
|
|
169
196
|
})).isRequired,
|
|
197
|
+
/**
|
|
198
|
+
* The props used for each component slot.
|
|
199
|
+
* @default {}
|
|
200
|
+
*/
|
|
201
|
+
slotProps: PropTypes.object,
|
|
202
|
+
/**
|
|
203
|
+
* Overridable component slots.
|
|
204
|
+
* @default {}
|
|
205
|
+
*/
|
|
206
|
+
slots: PropTypes.object,
|
|
170
207
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
171
208
|
title: PropTypes.string,
|
|
172
209
|
tooltip: PropTypes.shape({
|
|
@@ -189,8 +226,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
189
226
|
label: PropTypes.string,
|
|
190
227
|
labelFontSize: PropTypes.number,
|
|
191
228
|
position: PropTypes.oneOf(['bottom', 'top']),
|
|
229
|
+
slotProps: PropTypes.object,
|
|
230
|
+
slots: PropTypes.object,
|
|
192
231
|
stroke: PropTypes.string,
|
|
193
232
|
tickFontSize: PropTypes.number,
|
|
233
|
+
tickMaxStep: PropTypes.number,
|
|
234
|
+
tickMinStep: PropTypes.number,
|
|
235
|
+
tickNumber: PropTypes.number,
|
|
194
236
|
tickSize: PropTypes.number
|
|
195
237
|
}), PropTypes.string]),
|
|
196
238
|
viewBox: PropTypes.shape({
|
|
@@ -213,15 +255,17 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
213
255
|
label: PropTypes.string,
|
|
214
256
|
labelFontSize: PropTypes.number,
|
|
215
257
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
216
|
-
maxTicks: PropTypes.number,
|
|
217
258
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
218
|
-
minTicks: PropTypes.number,
|
|
219
259
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
220
260
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
261
|
+
slotProps: PropTypes.object,
|
|
262
|
+
slots: PropTypes.object,
|
|
221
263
|
stroke: PropTypes.string,
|
|
222
264
|
tickFontSize: PropTypes.number,
|
|
265
|
+
tickMaxStep: PropTypes.number,
|
|
266
|
+
tickMinStep: PropTypes.number,
|
|
267
|
+
tickNumber: PropTypes.number,
|
|
223
268
|
tickSize: PropTypes.number,
|
|
224
|
-
tickSpacing: PropTypes.number,
|
|
225
269
|
valueFormatter: PropTypes.func
|
|
226
270
|
})),
|
|
227
271
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -237,15 +281,17 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
237
281
|
label: PropTypes.string,
|
|
238
282
|
labelFontSize: PropTypes.number,
|
|
239
283
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
240
|
-
maxTicks: PropTypes.number,
|
|
241
284
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
242
|
-
minTicks: PropTypes.number,
|
|
243
285
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
244
286
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
287
|
+
slotProps: PropTypes.object,
|
|
288
|
+
slots: PropTypes.object,
|
|
245
289
|
stroke: PropTypes.string,
|
|
246
290
|
tickFontSize: PropTypes.number,
|
|
291
|
+
tickMaxStep: PropTypes.number,
|
|
292
|
+
tickMinStep: PropTypes.number,
|
|
293
|
+
tickNumber: PropTypes.number,
|
|
247
294
|
tickSize: PropTypes.number,
|
|
248
|
-
tickSpacing: PropTypes.number,
|
|
249
295
|
valueFormatter: PropTypes.func
|
|
250
296
|
}))
|
|
251
297
|
} : void 0;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
2
4
|
import { Scatter } from './Scatter';
|
|
3
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
4
6
|
import { CartesianContext } from '../context/CartesianContextProvider';
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
8
|
+
function ScatterPlot(props) {
|
|
9
|
+
var _slots$scatter;
|
|
10
|
+
const {
|
|
11
|
+
slots,
|
|
12
|
+
slotProps
|
|
13
|
+
} = props;
|
|
7
14
|
const seriesData = React.useContext(SeriesContext).scatter;
|
|
8
15
|
const axisData = React.useContext(CartesianContext);
|
|
9
16
|
if (seriesData === undefined) {
|
|
@@ -21,6 +28,7 @@ export function ScatterPlot() {
|
|
|
21
28
|
} = axisData;
|
|
22
29
|
const defaultXAxisId = xAxisIds[0];
|
|
23
30
|
const defaultYAxisId = yAxisIds[0];
|
|
31
|
+
const ScatterItems = (_slots$scatter = slots == null ? void 0 : slots.scatter) != null ? _slots$scatter : Scatter;
|
|
24
32
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
25
33
|
children: seriesOrder.map(seriesId => {
|
|
26
34
|
const {
|
|
@@ -32,13 +40,30 @@ export function ScatterPlot() {
|
|
|
32
40
|
} = series[seriesId];
|
|
33
41
|
const xScale = xAxis[xAxisKey != null ? xAxisKey : defaultXAxisId].scale;
|
|
34
42
|
const yScale = yAxis[yAxisKey != null ? yAxisKey : defaultYAxisId].scale;
|
|
35
|
-
return /*#__PURE__*/_jsx(
|
|
43
|
+
return /*#__PURE__*/_jsx(ScatterItems, _extends({
|
|
36
44
|
xScale: xScale,
|
|
37
45
|
yScale: yScale,
|
|
38
46
|
color: color,
|
|
39
47
|
markerSize: markerSize != null ? markerSize : 4,
|
|
40
48
|
series: series[seriesId]
|
|
41
|
-
}, id);
|
|
49
|
+
}, slotProps == null ? void 0 : slotProps.scatter), id);
|
|
42
50
|
})
|
|
43
51
|
});
|
|
44
|
-
}
|
|
52
|
+
}
|
|
53
|
+
process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
54
|
+
// ----------------------------- Warning --------------------------------
|
|
55
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
57
|
+
// ----------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* The props used for each component slot.
|
|
60
|
+
* @default {}
|
|
61
|
+
*/
|
|
62
|
+
slotProps: PropTypes.object,
|
|
63
|
+
/**
|
|
64
|
+
* Overridable component slots.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
67
|
+
slots: PropTypes.object
|
|
68
|
+
} : void 0;
|
|
69
|
+
export { ScatterPlot };
|
|
@@ -37,6 +37,8 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
37
37
|
showHighlight,
|
|
38
38
|
axisHighlight: inAxisHighlight,
|
|
39
39
|
children,
|
|
40
|
+
slots,
|
|
41
|
+
slotProps,
|
|
40
42
|
data,
|
|
41
43
|
plotType = 'line',
|
|
42
44
|
valueFormatter = v => v.toString(),
|
|
@@ -73,8 +75,17 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
73
75
|
colors: colors,
|
|
74
76
|
sx: sx,
|
|
75
77
|
disableAxisListener: (!showTooltip || (tooltip == null ? void 0 : tooltip.trigger) !== 'axis') && (axisHighlight == null ? void 0 : axisHighlight.x) === 'none' && (axisHighlight == null ? void 0 : axisHighlight.y) === 'none',
|
|
76
|
-
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
77
|
-
|
|
78
|
+
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
79
|
+
slots: slots,
|
|
80
|
+
slotProps: slotProps
|
|
81
|
+
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
82
|
+
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
83
|
+
slots: slots,
|
|
84
|
+
slotProps: slotProps
|
|
85
|
+
}), /*#__PURE__*/_jsx(LinePlot, {
|
|
86
|
+
slots: slots,
|
|
87
|
+
slotProps: slotProps
|
|
88
|
+
}), showHighlight && /*#__PURE__*/_jsx(SparkLineMarkPlot, {})]
|
|
78
89
|
}), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), showTooltip && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), children]
|
|
79
90
|
});
|
|
80
91
|
});
|
|
@@ -134,6 +145,16 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
134
145
|
* @default false
|
|
135
146
|
*/
|
|
136
147
|
showTooltip: PropTypes.bool,
|
|
148
|
+
/**
|
|
149
|
+
* The props used for each component slot.
|
|
150
|
+
* @default {}
|
|
151
|
+
*/
|
|
152
|
+
slotProps: PropTypes.object,
|
|
153
|
+
/**
|
|
154
|
+
* Overridable component slots.
|
|
155
|
+
* @default {}
|
|
156
|
+
*/
|
|
157
|
+
slots: PropTypes.object,
|
|
137
158
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
138
159
|
title: PropTypes.string,
|
|
139
160
|
tooltip: PropTypes.shape({
|
|
@@ -172,15 +193,17 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
172
193
|
label: PropTypes.string,
|
|
173
194
|
labelFontSize: PropTypes.number,
|
|
174
195
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
175
|
-
maxTicks: PropTypes.number,
|
|
176
196
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
177
|
-
minTicks: PropTypes.number,
|
|
178
197
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
179
198
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
199
|
+
slotProps: PropTypes.object,
|
|
200
|
+
slots: PropTypes.object,
|
|
180
201
|
stroke: PropTypes.string,
|
|
181
202
|
tickFontSize: PropTypes.number,
|
|
203
|
+
tickMaxStep: PropTypes.number,
|
|
204
|
+
tickMinStep: PropTypes.number,
|
|
205
|
+
tickNumber: PropTypes.number,
|
|
182
206
|
tickSize: PropTypes.number,
|
|
183
|
-
tickSpacing: PropTypes.number,
|
|
184
207
|
valueFormatter: PropTypes.func
|
|
185
208
|
})
|
|
186
209
|
} : void 0;
|
|
@@ -4,6 +4,6 @@ export const blueberryTwilightPalette = mode => mode === 'dark' ? blueberryTwili
|
|
|
4
4
|
export const mangoFusionPaletteLight = ['#173A5E', '#00A3A0', '#C91B63', '#EF5350', '#FFA726', '#B800D8', '#60009B', '#2E96FF', '#2731C8', '#03008D'];
|
|
5
5
|
export const mangoFusionPaletteDark = ['#41698F', '#19D0CD', '#DE196B', '#FC5F5C', '#FFD771', '#DA00FF', '#9001CB', '#72CCFF', '#2E96FF', '#3B48E0'];
|
|
6
6
|
export const mangoFusionPalette = mode => mode === 'dark' ? mangoFusionPaletteDark : mangoFusionPaletteLight;
|
|
7
|
-
export const cheerfulFiestaPaletteDark = ['#
|
|
8
|
-
export const cheerfulFiestaPaletteLight = ['#
|
|
7
|
+
export const cheerfulFiestaPaletteDark = ['#0059B2', '#2E96FF', '#FFC24C', '#FF9F0E', '#F38200', '#2ABFDE', '#1F94AD', '#BD2C38', '#FF3143', '#FF8282'];
|
|
8
|
+
export const cheerfulFiestaPaletteLight = ['#003A75', '#007FFF', '#FFC24C', '#FF9D09', '#CA6C00', '#127D94', '#1F94AD', '#C82634', '#FF3143', '#FF7E7E'];
|
|
9
9
|
export const cheerfulFiestaPalette = mode => mode === 'dark' ? cheerfulFiestaPaletteDark : cheerfulFiestaPaletteLight;
|
|
@@ -127,7 +127,8 @@ function CartesianContextProvider({
|
|
|
127
127
|
const scaleType = (_axis$scaleType = axis.scaleType) != null ? _axis$scaleType : 'linear';
|
|
128
128
|
const extremums = [(_axis$min = axis.min) != null ? _axis$min : minData, (_axis$max = axis.max) != null ? _axis$max : maxData];
|
|
129
129
|
const ticksNumber = getTicksNumber(_extends({}, axis, {
|
|
130
|
-
range
|
|
130
|
+
range,
|
|
131
|
+
domain: extremums
|
|
131
132
|
}));
|
|
132
133
|
const niceScale = getScale(scaleType, extremums, range).nice(ticksNumber);
|
|
133
134
|
const niceDomain = niceScale.domain();
|
|
@@ -176,7 +177,8 @@ function CartesianContextProvider({
|
|
|
176
177
|
const scaleType = (_axis$scaleType2 = axis.scaleType) != null ? _axis$scaleType2 : 'linear';
|
|
177
178
|
const extremums = [(_axis$min3 = axis.min) != null ? _axis$min3 : minData, (_axis$max3 = axis.max) != null ? _axis$max3 : maxData];
|
|
178
179
|
const ticksNumber = getTicksNumber(_extends({}, axis, {
|
|
179
|
-
range
|
|
180
|
+
range,
|
|
181
|
+
domain: extremums
|
|
180
182
|
}));
|
|
181
183
|
const niceScale = getScale(scaleType, extremums, range).nice(ticksNumber);
|
|
182
184
|
const niceDomain = niceScale.domain();
|
|
@@ -225,15 +227,17 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
225
227
|
label: PropTypes.string,
|
|
226
228
|
labelFontSize: PropTypes.number,
|
|
227
229
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
228
|
-
maxTicks: PropTypes.number,
|
|
229
230
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
230
|
-
minTicks: PropTypes.number,
|
|
231
231
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
232
232
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
233
|
+
slotProps: PropTypes.object,
|
|
234
|
+
slots: PropTypes.object,
|
|
233
235
|
stroke: PropTypes.string,
|
|
234
236
|
tickFontSize: PropTypes.number,
|
|
237
|
+
tickMaxStep: PropTypes.number,
|
|
238
|
+
tickMinStep: PropTypes.number,
|
|
239
|
+
tickNumber: PropTypes.number,
|
|
235
240
|
tickSize: PropTypes.number,
|
|
236
|
-
tickSpacing: PropTypes.number,
|
|
237
241
|
valueFormatter: PropTypes.func
|
|
238
242
|
})),
|
|
239
243
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -249,15 +253,17 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
249
253
|
label: PropTypes.string,
|
|
250
254
|
labelFontSize: PropTypes.number,
|
|
251
255
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
252
|
-
maxTicks: PropTypes.number,
|
|
253
256
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
254
|
-
minTicks: PropTypes.number,
|
|
255
257
|
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
256
258
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
259
|
+
slotProps: PropTypes.object,
|
|
260
|
+
slots: PropTypes.object,
|
|
257
261
|
stroke: PropTypes.string,
|
|
258
262
|
tickFontSize: PropTypes.number,
|
|
263
|
+
tickMaxStep: PropTypes.number,
|
|
264
|
+
tickMinStep: PropTypes.number,
|
|
265
|
+
tickNumber: PropTypes.number,
|
|
259
266
|
tickSize: PropTypes.number,
|
|
260
|
-
tickSpacing: PropTypes.number,
|
|
261
267
|
valueFormatter: PropTypes.func
|
|
262
268
|
}))
|
|
263
269
|
} : void 0;
|
package/esm/hooks/useTicks.js
CHANGED
|
@@ -2,13 +2,16 @@ import * as React from 'react';
|
|
|
2
2
|
import { isBandScale } from '../internals/isBandScale';
|
|
3
3
|
export function getTicksNumber(params) {
|
|
4
4
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
range
|
|
5
|
+
tickMaxStep,
|
|
6
|
+
tickMinStep,
|
|
7
|
+
tickNumber,
|
|
8
|
+
range,
|
|
9
|
+
domain
|
|
9
10
|
} = params;
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const maxTicks = tickMinStep === undefined ? 999 : Math.floor(Math.abs(domain[1] - domain[0]) / tickMinStep);
|
|
12
|
+
const minTicks = tickMaxStep === undefined ? 2 : Math.ceil(Math.abs(domain[1] - domain[0]) / tickMaxStep);
|
|
13
|
+
const defaultizedTickNumber = tickNumber != null ? tickNumber : Math.floor(Math.abs(range[1] - range[0]) / 50);
|
|
14
|
+
return Math.min(maxTicks, Math.max(minTicks, defaultizedTickNumber));
|
|
12
15
|
}
|
|
13
16
|
function useTicks(options) {
|
|
14
17
|
const {
|
|
@@ -8,39 +8,39 @@ export const AxisRoot = styled('g', {
|
|
|
8
8
|
})({
|
|
9
9
|
[`&.${axisClasses.directionY}`]: {
|
|
10
10
|
[`.${axisClasses.tickLabel}`]: {
|
|
11
|
-
|
|
11
|
+
dominantBaseline: 'middle'
|
|
12
12
|
},
|
|
13
13
|
[`.${axisClasses.label}`]: {
|
|
14
|
-
|
|
14
|
+
dominantBaseline: 'auto',
|
|
15
15
|
textAnchor: 'middle'
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
[`&.${axisClasses.left}`]: {
|
|
19
19
|
[`.${axisClasses.tickLabel}`]: {
|
|
20
|
-
|
|
20
|
+
dominantBaseline: 'central',
|
|
21
21
|
textAnchor: 'end'
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
[`&.${axisClasses.right}`]: {
|
|
25
25
|
[`.${axisClasses.tickLabel}`]: {
|
|
26
|
-
|
|
26
|
+
dominantBaseline: 'central',
|
|
27
27
|
textAnchor: 'start'
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
[`&.${axisClasses.bottom}`]: {
|
|
31
31
|
[`.${axisClasses.tickLabel}, .${axisClasses.label}`]: {
|
|
32
|
-
|
|
32
|
+
dominantBaseline: 'hanging',
|
|
33
33
|
textAnchor: 'middle'
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
[`&.${axisClasses.top}`]: {
|
|
37
37
|
[`.${axisClasses.tickLabel}, .${axisClasses.label}`]: {
|
|
38
|
-
|
|
38
|
+
dominantBaseline: 'baseline',
|
|
39
39
|
textAnchor: 'middle'
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
export const
|
|
43
|
+
export const ChartsLine = styled('line', {
|
|
44
44
|
name: 'MuiChartsAxis',
|
|
45
45
|
slot: 'Line',
|
|
46
46
|
overridesResolver: (props, styles) => styles.line
|
|
@@ -51,7 +51,7 @@ export const Line = styled('line', {
|
|
|
51
51
|
shapeRendering: 'crispEdges',
|
|
52
52
|
strokeWidth: 1
|
|
53
53
|
}));
|
|
54
|
-
export const
|
|
54
|
+
export const ChartsTick = styled('line', {
|
|
55
55
|
name: 'MuiChartsAxis',
|
|
56
56
|
slot: 'Tick',
|
|
57
57
|
overridesResolver: (props, styles) => styles.tick
|
|
@@ -61,7 +61,7 @@ export const Tick = styled('line', {
|
|
|
61
61
|
stroke: theme.palette.text.primary,
|
|
62
62
|
shapeRendering: 'crispEdges'
|
|
63
63
|
}));
|
|
64
|
-
export const
|
|
64
|
+
export const ChartsTickLabel = styled('text', {
|
|
65
65
|
name: 'MuiChartsAxis',
|
|
66
66
|
slot: 'TickLabel',
|
|
67
67
|
overridesResolver: (props, styles) => styles.tickLabel
|
|
@@ -70,7 +70,7 @@ export const TickLabel = styled('text', {
|
|
|
70
70
|
}) => _extends({}, theme.typography.caption, {
|
|
71
71
|
fill: theme.palette.text.primary
|
|
72
72
|
}));
|
|
73
|
-
export const
|
|
73
|
+
export const ChartsLabel = styled('text', {
|
|
74
74
|
name: 'MuiChartsAxis',
|
|
75
75
|
slot: 'Label',
|
|
76
76
|
overridesResolver: (props, styles) => styles.label
|