@mui/x-charts 6.18.0 → 6.18.2
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 +7 -0
- package/BarChart/BarChart.js +41 -4
- package/CHANGELOG.md +116 -5
- package/ChartsAxis/ChartsAxis.js +5 -5
- package/ChartsAxis/axisClasses.d.ts +2 -2
- package/ChartsLegend/ChartsLegend.d.ts +1 -0
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/chartsLegendClasses.js +2 -2
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
- package/ChartsReferenceLine/common.d.ts +41 -0
- package/ChartsReferenceLine/common.js +27 -0
- package/ChartsReferenceLine/index.d.ts +2 -0
- package/ChartsReferenceLine/index.js +27 -0
- package/ChartsReferenceLine/package.json +6 -0
- package/ChartsSurface.d.ts +11 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltip.js +13 -5
- package/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/ChartsTooltip/chartsTooltipClasses.d.ts +21 -0
- package/ChartsTooltip/chartsTooltipClasses.js +12 -0
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +11 -0
- package/ChartsTooltip/utils.d.ts +1 -1
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +9 -5
- package/ChartsYAxis/ChartsYAxis.js +9 -5
- package/LineChart/LineChart.d.ts +7 -0
- package/LineChart/LineChart.js +41 -4
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/MarkPlot.js +2 -1
- package/PieChart/PieArc.d.ts +5 -2
- package/PieChart/PieArc.js +17 -2
- package/PieChart/PieArcLabel.d.ts +1 -1
- package/PieChart/PieArcLabel.js +5 -10
- package/PieChart/PieArcLabelPlot.js +2 -2
- package/PieChart/PieArcPlot.js +2 -2
- package/PieChart/PieChart.js +34 -4
- package/PieChart/index.d.ts +4 -2
- package/PieChart/index.js +37 -27
- package/ResponsiveChartContainer/index.d.ts +13 -3
- package/ScatterChart/ScatterChart.js +34 -4
- package/SparkLineChart/SparkLineChart.js +22 -0
- package/context/CartesianContextProvider.d.ts +21 -1
- package/context/CartesianContextProvider.js +11 -0
- package/context/DrawingProvider.d.ts +18 -0
- package/context/DrawingProvider.js +6 -0
- package/context/HighlightProvider.d.ts +17 -0
- package/context/InteractionProvider.d.ts +6 -0
- package/context/SeriesContextProvider.d.ts +5 -0
- package/esm/BarChart/BarChart.js +41 -4
- package/esm/ChartsAxis/ChartsAxis.js +6 -5
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/esm/ChartsReferenceLine/common.js +20 -0
- package/esm/ChartsReferenceLine/index.js +2 -0
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/esm/ChartsTooltip/ChartsTooltip.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/esm/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/esm/ChartsTooltip/index.js +2 -1
- package/esm/ChartsTooltip/utils.js +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +10 -6
- package/esm/ChartsYAxis/ChartsYAxis.js +10 -6
- package/esm/LineChart/LineChart.js +41 -4
- package/esm/LineChart/LineHighlightPlot.js +1 -1
- package/esm/LineChart/MarkPlot.js +2 -1
- package/esm/PieChart/PieArc.js +18 -2
- package/esm/PieChart/PieArcLabel.js +7 -11
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +34 -4
- package/esm/PieChart/index.js +2 -2
- package/esm/ScatterChart/ScatterChart.js +34 -4
- package/esm/SparkLineChart/SparkLineChart.js +22 -0
- package/esm/context/CartesianContextProvider.js +11 -0
- package/esm/context/DrawingProvider.js +6 -0
- package/esm/index.js +1 -0
- package/esm/internals/geometry.js +2 -2
- package/hooks/useScale.d.ts +2 -2
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/components/ChartsText.d.ts +1 -1
- package/internals/geometry.d.ts +2 -2
- package/internals/geometry.js +2 -2
- package/internals/isBandScale.d.ts +3 -1
- package/internals/utils.d.ts +5 -0
- package/legacy/BarChart/BarChart.js +41 -4
- package/legacy/ChartsAxis/ChartsAxis.js +6 -5
- package/legacy/ChartsLegend/ChartsLegend.js +2 -2
- package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/legacy/ChartsReferenceLine/common.js +20 -0
- package/legacy/ChartsReferenceLine/index.js +2 -0
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/legacy/ChartsTooltip/ChartsTooltip.js +20 -12
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/legacy/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/legacy/ChartsTooltip/index.js +2 -1
- package/legacy/ChartsTooltip/utils.js +1 -1
- package/legacy/ChartsXAxis/ChartsXAxis.js +15 -12
- package/legacy/ChartsYAxis/ChartsYAxis.js +15 -12
- package/legacy/LineChart/LineChart.js +41 -4
- package/legacy/LineChart/LineHighlightPlot.js +1 -1
- package/legacy/LineChart/MarkPlot.js +2 -1
- package/legacy/PieChart/PieArc.js +18 -2
- package/legacy/PieChart/PieArcLabel.js +7 -11
- package/legacy/PieChart/PieArcLabelPlot.js +1 -1
- package/legacy/PieChart/PieArcPlot.js +1 -1
- package/legacy/PieChart/PieChart.js +34 -4
- package/legacy/PieChart/index.js +2 -2
- package/legacy/ScatterChart/ScatterChart.js +34 -4
- package/legacy/SparkLineChart/SparkLineChart.js +22 -0
- package/legacy/context/CartesianContextProvider.js +11 -0
- package/legacy/context/DrawingProvider.js +6 -0
- package/legacy/index.js +2 -1
- package/legacy/internals/geometry.js +2 -2
- package/models/axis.d.ts +33 -13
- package/models/layout.d.ts +6 -0
- package/models/seriesType/common.d.ts +16 -0
- package/modern/BarChart/BarChart.js +41 -4
- package/modern/ChartsAxis/ChartsAxis.js +5 -5
- package/modern/ChartsLegend/ChartsLegend.js +2 -2
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/modern/ChartsReferenceLine/common.js +20 -0
- package/modern/ChartsReferenceLine/index.js +2 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/modern/ChartsTooltip/ChartsTooltip.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/modern/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/modern/ChartsTooltip/index.js +2 -1
- package/modern/ChartsTooltip/utils.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +9 -5
- package/modern/ChartsYAxis/ChartsYAxis.js +9 -5
- package/modern/LineChart/LineChart.js +41 -4
- package/modern/LineChart/LineHighlightPlot.js +1 -1
- package/modern/LineChart/MarkPlot.js +2 -1
- package/modern/PieChart/PieArc.js +18 -2
- package/modern/PieChart/PieArcLabel.js +7 -11
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +34 -4
- package/modern/PieChart/index.js +2 -2
- package/modern/ScatterChart/ScatterChart.js +34 -4
- package/modern/SparkLineChart/SparkLineChart.js +22 -0
- package/modern/context/CartesianContextProvider.js +11 -0
- package/modern/context/DrawingProvider.js +6 -0
- package/modern/index.js +2 -1
- package/modern/internals/geometry.js +2 -2
- package/package.json +1 -1
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
- package/ChartsTooltip/tooltipClasses.d.ts +0 -13
- package/ChartsTooltip/tooltipClasses.js +0 -12
- package/esm/ChartsTooltip/tooltipClasses.js +0 -5
- package/legacy/ChartsTooltip/tooltipClasses.js +0 -5
- package/modern/ChartsTooltip/tooltipClasses.js +0 -5
|
@@ -123,7 +123,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
123
123
|
* @default xAxisIds[0] The id of the first provided axis
|
|
124
124
|
*/
|
|
125
125
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
126
|
-
axisId: PropTypes.string
|
|
126
|
+
axisId: PropTypes.string,
|
|
127
127
|
classes: PropTypes.object,
|
|
128
128
|
disableLine: PropTypes.bool,
|
|
129
129
|
disableTicks: PropTypes.bool,
|
|
@@ -150,9 +150,21 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
150
150
|
* Color palette used to colorize multiple series.
|
|
151
151
|
*/
|
|
152
152
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
153
|
+
/**
|
|
154
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
155
|
+
*/
|
|
153
156
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
154
157
|
desc: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
160
|
+
* It might break interactive features, but will improve performance.
|
|
161
|
+
* @default false
|
|
162
|
+
*/
|
|
155
163
|
disableAxisListener: PropTypes.bool,
|
|
164
|
+
/**
|
|
165
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
166
|
+
* @default undefined
|
|
167
|
+
*/
|
|
156
168
|
height: PropTypes.number,
|
|
157
169
|
/**
|
|
158
170
|
* Indicate which axis to display the left of the charts.
|
|
@@ -160,7 +172,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
160
172
|
* @default yAxisIds[0] The id of the first provided axis
|
|
161
173
|
*/
|
|
162
174
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
163
|
-
axisId: PropTypes.string
|
|
175
|
+
axisId: PropTypes.string,
|
|
164
176
|
classes: PropTypes.object,
|
|
165
177
|
disableLine: PropTypes.bool,
|
|
166
178
|
disableTicks: PropTypes.bool,
|
|
@@ -195,6 +207,12 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
195
207
|
slotProps: PropTypes.object,
|
|
196
208
|
slots: PropTypes.object
|
|
197
209
|
}),
|
|
210
|
+
/**
|
|
211
|
+
* The margin between the SVG and the drawing area.
|
|
212
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
213
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
214
|
+
* @default object Depends on the charts type.
|
|
215
|
+
*/
|
|
198
216
|
margin: PropTypes.shape({
|
|
199
217
|
bottom: PropTypes.number,
|
|
200
218
|
left: PropTypes.number,
|
|
@@ -208,7 +226,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
208
226
|
* @default null
|
|
209
227
|
*/
|
|
210
228
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
211
|
-
axisId: PropTypes.string
|
|
229
|
+
axisId: PropTypes.string,
|
|
212
230
|
classes: PropTypes.object,
|
|
213
231
|
disableLine: PropTypes.bool,
|
|
214
232
|
disableTicks: PropTypes.bool,
|
|
@@ -299,7 +317,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
299
317
|
* @default null
|
|
300
318
|
*/
|
|
301
319
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
302
|
-
axisId: PropTypes.string
|
|
320
|
+
axisId: PropTypes.string,
|
|
303
321
|
classes: PropTypes.object,
|
|
304
322
|
disableLine: PropTypes.bool,
|
|
305
323
|
disableTicks: PropTypes.bool,
|
|
@@ -326,7 +344,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
326
344
|
x: PropTypes.number,
|
|
327
345
|
y: PropTypes.number
|
|
328
346
|
}),
|
|
347
|
+
/**
|
|
348
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
349
|
+
* @default undefined
|
|
350
|
+
*/
|
|
329
351
|
width: PropTypes.number,
|
|
352
|
+
/**
|
|
353
|
+
* The configuration of the x-axes.
|
|
354
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
355
|
+
*/
|
|
330
356
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
331
357
|
axisId: PropTypes.string,
|
|
332
358
|
classes: PropTypes.object,
|
|
@@ -357,6 +383,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
357
383
|
tickSize: PropTypes.number,
|
|
358
384
|
valueFormatter: PropTypes.func
|
|
359
385
|
})),
|
|
386
|
+
/**
|
|
387
|
+
* The configuration of the y-axes.
|
|
388
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
389
|
+
*/
|
|
360
390
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
361
391
|
axisId: PropTypes.string,
|
|
362
392
|
classes: PropTypes.object,
|
package/legacy/PieChart/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { PiePlot } from './PiePlot';
|
|
2
2
|
export { PieChart } from './PieChart';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export { PieArcLabel, getPieArcLabelUtilityClass, pieArcLabelClasses } from './PieArcLabel';
|
|
4
|
+
export { PieArc, getPieArcUtilityClass, pieArcClasses } from './PieArc';
|
|
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
88
88
|
* @default xAxisIds[0] The id of the first provided axis
|
|
89
89
|
*/
|
|
90
90
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
91
|
-
axisId: PropTypes.string
|
|
91
|
+
axisId: PropTypes.string,
|
|
92
92
|
classes: PropTypes.object,
|
|
93
93
|
disableLine: PropTypes.bool,
|
|
94
94
|
disableTicks: PropTypes.bool,
|
|
@@ -115,9 +115,21 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
115
115
|
* Color palette used to colorize multiple series.
|
|
116
116
|
*/
|
|
117
117
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
118
|
+
/**
|
|
119
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
120
|
+
*/
|
|
118
121
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
119
122
|
desc: PropTypes.string,
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
125
|
+
* It might break interactive features, but will improve performance.
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
120
128
|
disableAxisListener: PropTypes.bool,
|
|
129
|
+
/**
|
|
130
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
131
|
+
* @default undefined
|
|
132
|
+
*/
|
|
121
133
|
height: PropTypes.number,
|
|
122
134
|
/**
|
|
123
135
|
* Indicate which axis to display the left of the charts.
|
|
@@ -125,7 +137,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
125
137
|
* @default yAxisIds[0] The id of the first provided axis
|
|
126
138
|
*/
|
|
127
139
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
128
|
-
axisId: PropTypes.string
|
|
140
|
+
axisId: PropTypes.string,
|
|
129
141
|
classes: PropTypes.object,
|
|
130
142
|
disableLine: PropTypes.bool,
|
|
131
143
|
disableTicks: PropTypes.bool,
|
|
@@ -160,6 +172,12 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
160
172
|
slotProps: PropTypes.object,
|
|
161
173
|
slots: PropTypes.object
|
|
162
174
|
}),
|
|
175
|
+
/**
|
|
176
|
+
* The margin between the SVG and the drawing area.
|
|
177
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
178
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
179
|
+
* @default object Depends on the charts type.
|
|
180
|
+
*/
|
|
163
181
|
margin: PropTypes.shape({
|
|
164
182
|
bottom: PropTypes.number,
|
|
165
183
|
left: PropTypes.number,
|
|
@@ -172,7 +190,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
172
190
|
* @default null
|
|
173
191
|
*/
|
|
174
192
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
175
|
-
axisId: PropTypes.string
|
|
193
|
+
axisId: PropTypes.string,
|
|
176
194
|
classes: PropTypes.object,
|
|
177
195
|
disableLine: PropTypes.bool,
|
|
178
196
|
disableTicks: PropTypes.bool,
|
|
@@ -238,7 +256,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
238
256
|
* @default null
|
|
239
257
|
*/
|
|
240
258
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
241
|
-
axisId: PropTypes.string
|
|
259
|
+
axisId: PropTypes.string,
|
|
242
260
|
classes: PropTypes.object,
|
|
243
261
|
disableLine: PropTypes.bool,
|
|
244
262
|
disableTicks: PropTypes.bool,
|
|
@@ -265,7 +283,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
265
283
|
x: PropTypes.number,
|
|
266
284
|
y: PropTypes.number
|
|
267
285
|
}),
|
|
286
|
+
/**
|
|
287
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
288
|
+
* @default undefined
|
|
289
|
+
*/
|
|
268
290
|
width: PropTypes.number,
|
|
291
|
+
/**
|
|
292
|
+
* The configuration of the x-axes.
|
|
293
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
294
|
+
*/
|
|
269
295
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
270
296
|
axisId: PropTypes.string,
|
|
271
297
|
classes: PropTypes.object,
|
|
@@ -296,6 +322,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
296
322
|
tickSize: PropTypes.number,
|
|
297
323
|
valueFormatter: PropTypes.func
|
|
298
324
|
})),
|
|
325
|
+
/**
|
|
326
|
+
* The configuration of the y-axes.
|
|
327
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
328
|
+
*/
|
|
299
329
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
300
330
|
axisId: PropTypes.string,
|
|
301
331
|
classes: PropTypes.object,
|
|
@@ -135,10 +135,28 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
135
135
|
* Data to plot.
|
|
136
136
|
*/
|
|
137
137
|
data: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
138
|
+
/**
|
|
139
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
140
|
+
*/
|
|
138
141
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
139
142
|
desc: PropTypes.string,
|
|
143
|
+
/**
|
|
144
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
145
|
+
* It might break interactive features, but will improve performance.
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
140
148
|
disableAxisListener: PropTypes.bool,
|
|
149
|
+
/**
|
|
150
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
151
|
+
* @default undefined
|
|
152
|
+
*/
|
|
141
153
|
height: PropTypes.number,
|
|
154
|
+
/**
|
|
155
|
+
* The margin between the SVG and the drawing area.
|
|
156
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
157
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
158
|
+
* @default object Depends on the charts type.
|
|
159
|
+
*/
|
|
142
160
|
margin: PropTypes.shape({
|
|
143
161
|
bottom: PropTypes.number,
|
|
144
162
|
left: PropTypes.number,
|
|
@@ -194,6 +212,10 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
194
212
|
x: PropTypes.number,
|
|
195
213
|
y: PropTypes.number
|
|
196
214
|
}),
|
|
215
|
+
/**
|
|
216
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
217
|
+
* @default undefined
|
|
218
|
+
*/
|
|
197
219
|
width: PropTypes.number,
|
|
198
220
|
/**
|
|
199
221
|
* The xAxis configuration.
|
|
@@ -249,7 +249,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
249
249
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
250
250
|
// ----------------------------------------------------------------------
|
|
251
251
|
children: PropTypes.node,
|
|
252
|
+
/**
|
|
253
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
254
|
+
*/
|
|
252
255
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
256
|
+
/**
|
|
257
|
+
* The configuration of the x-axes.
|
|
258
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
259
|
+
*/
|
|
253
260
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
254
261
|
axisId: PropTypes.string,
|
|
255
262
|
classes: PropTypes.object,
|
|
@@ -280,6 +287,10 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
|
|
|
280
287
|
tickSize: PropTypes.number,
|
|
281
288
|
valueFormatter: PropTypes.func
|
|
282
289
|
})),
|
|
290
|
+
/**
|
|
291
|
+
* The configuration of the y-axes.
|
|
292
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
293
|
+
*/
|
|
283
294
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
284
295
|
axisId: PropTypes.string,
|
|
285
296
|
classes: PropTypes.object,
|
|
@@ -45,6 +45,12 @@ process.env.NODE_ENV !== "production" ? DrawingProvider.propTypes = {
|
|
|
45
45
|
// ----------------------------------------------------------------------
|
|
46
46
|
children: PropTypes.node,
|
|
47
47
|
height: PropTypes.number.isRequired,
|
|
48
|
+
/**
|
|
49
|
+
* The margin between the SVG and the drawing area.
|
|
50
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
51
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
52
|
+
* @default object Depends on the charts type.
|
|
53
|
+
*/
|
|
48
54
|
margin: PropTypes.shape({
|
|
49
55
|
bottom: PropTypes.number,
|
|
50
56
|
left: PropTypes.number,
|
package/legacy/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts v6.18.
|
|
2
|
+
* @mui/x-charts v6.18.2
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -11,6 +11,7 @@ export * from './hooks';
|
|
|
11
11
|
export * from './colorPalettes';
|
|
12
12
|
export * from './models';
|
|
13
13
|
export * from './ChartsClipPath';
|
|
14
|
+
export * from './ChartsReferenceLine';
|
|
14
15
|
export * from './ChartsAxis';
|
|
15
16
|
export * from './ChartsXAxis';
|
|
16
17
|
export * from './ChartsYAxis';
|
|
@@ -6,8 +6,8 @@ var warnedOnce = false;
|
|
|
6
6
|
* Return the minimal translation along the x-axis to avoid overflow of a rectangle of a given width, height, and rotation.
|
|
7
7
|
* This assumes that all rectangles have the same height and angle between -90 and 90.
|
|
8
8
|
* Otherwise it would be problematic because you need the height/width of the next rectangle to do the correct computation.
|
|
9
|
-
* @param width the side along the x
|
|
10
|
-
* @param height the side along the y
|
|
9
|
+
* @param width the side along the x-axis.
|
|
10
|
+
* @param height the side along the y-axis.
|
|
11
11
|
* @param angle the rotation in degrees.
|
|
12
12
|
*/
|
|
13
13
|
export function getMinXTranslation(width, height) {
|
package/models/axis.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, S
|
|
|
3
3
|
import { ChartsAxisClasses } from '../ChartsAxis/axisClasses';
|
|
4
4
|
import type { TickParams } from '../hooks/useTicks';
|
|
5
5
|
import { ChartsTextProps } from '../internals/components/ChartsText';
|
|
6
|
-
export type D3Scale
|
|
7
|
-
|
|
6
|
+
export type D3Scale<Domain extends {
|
|
7
|
+
toString(): string;
|
|
8
|
+
} = number | Date | string, Range = number, Output = number> = ScaleBand<Domain> | ScaleLogarithmic<Range, Output> | ScalePoint<Domain> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
|
|
9
|
+
export type D3ContinuouseScale<Range = number, Output = number> = ScaleLogarithmic<Range, Output> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
|
|
8
10
|
export interface ChartsAxisSlotsComponent {
|
|
9
11
|
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement>>;
|
|
10
12
|
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement>>;
|
|
@@ -19,9 +21,10 @@ export interface ChartsAxisSlotComponentProps {
|
|
|
19
21
|
}
|
|
20
22
|
export interface ChartsAxisProps extends TickParams {
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* The id of the axis to render.
|
|
25
|
+
* If undefined, it will be the first defined axis.
|
|
23
26
|
*/
|
|
24
|
-
axisId
|
|
27
|
+
axisId?: string;
|
|
25
28
|
/**
|
|
26
29
|
* If true, the axis line is disabled.
|
|
27
30
|
* @default false
|
|
@@ -110,7 +113,7 @@ export type ContinuouseScaleName = 'linear' | 'log' | 'pow' | 'sqrt' | 'time' |
|
|
|
110
113
|
interface AxisScaleConfig {
|
|
111
114
|
band: {
|
|
112
115
|
scaleType: 'band';
|
|
113
|
-
scale: ScaleBand<
|
|
116
|
+
scale: ScaleBand<number | Date | string>;
|
|
114
117
|
/**
|
|
115
118
|
* The ratio between the space allocated for padding between two categories and the category width.
|
|
116
119
|
* 0 means no gap, and 1 no data.
|
|
@@ -126,40 +129,54 @@ interface AxisScaleConfig {
|
|
|
126
129
|
};
|
|
127
130
|
point: {
|
|
128
131
|
scaleType: 'point';
|
|
129
|
-
scale: ScalePoint<
|
|
132
|
+
scale: ScalePoint<number | Date | string>;
|
|
130
133
|
};
|
|
131
134
|
log: {
|
|
132
135
|
scaleType: 'log';
|
|
133
|
-
scale: ScaleLogarithmic<
|
|
136
|
+
scale: ScaleLogarithmic<number, number>;
|
|
134
137
|
};
|
|
135
138
|
pow: {
|
|
136
139
|
scaleType: 'pow';
|
|
137
|
-
scale: ScalePower<
|
|
140
|
+
scale: ScalePower<number, number>;
|
|
138
141
|
};
|
|
139
142
|
sqrt: {
|
|
140
143
|
scaleType: 'sqrt';
|
|
141
|
-
scale: ScalePower<
|
|
144
|
+
scale: ScalePower<number, number>;
|
|
142
145
|
};
|
|
143
146
|
time: {
|
|
144
147
|
scaleType: 'time';
|
|
145
|
-
scale: ScaleTime<
|
|
148
|
+
scale: ScaleTime<number, number>;
|
|
146
149
|
};
|
|
147
150
|
utc: {
|
|
148
151
|
scaleType: 'utc';
|
|
149
|
-
scale: ScaleTime<
|
|
152
|
+
scale: ScaleTime<number, number>;
|
|
150
153
|
};
|
|
151
154
|
linear: {
|
|
152
155
|
scaleType: 'linear';
|
|
153
|
-
scale: ScaleLinear<
|
|
156
|
+
scale: ScaleLinear<number, number>;
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
export type AxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
160
|
+
/**
|
|
161
|
+
* Id used to identify the axis.
|
|
162
|
+
*/
|
|
157
163
|
id: string;
|
|
164
|
+
/**
|
|
165
|
+
* The minimal value of the domain.
|
|
166
|
+
* If not provided, it gets computed to display the entire chart data.
|
|
167
|
+
*/
|
|
158
168
|
min?: number | Date;
|
|
169
|
+
/**
|
|
170
|
+
* The maximal value of the domain.
|
|
171
|
+
* If not provided, it gets computed to display the entire chart data.
|
|
172
|
+
*/
|
|
159
173
|
max?: number | Date;
|
|
174
|
+
/**
|
|
175
|
+
* The data used by `'band'` and `'point'` scales.
|
|
176
|
+
*/
|
|
160
177
|
data?: V[];
|
|
161
178
|
/**
|
|
162
|
-
* The key used to retrieve data from the dataset prop.
|
|
179
|
+
* The key used to retrieve `data` from the `dataset` prop.
|
|
163
180
|
*/
|
|
164
181
|
dataKey?: string;
|
|
165
182
|
valueFormatter?: (value: V) => string;
|
|
@@ -169,6 +186,9 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
|
169
186
|
hideTooltip?: boolean;
|
|
170
187
|
} & Partial<ChartsXAxisProps | ChartsYAxisProps> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams;
|
|
171
188
|
export type AxisDefaultized<S extends ScaleName = ScaleName, V = any> = Omit<AxisConfig<S, V>, 'scaleType'> & AxisScaleConfig[S] & {
|
|
189
|
+
/**
|
|
190
|
+
* An indication of the expected number of ticks.
|
|
191
|
+
*/
|
|
172
192
|
tickNumber: number;
|
|
173
193
|
};
|
|
174
194
|
export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'band'> & {
|
package/models/layout.d.ts
CHANGED
|
@@ -7,5 +7,11 @@ export interface CardinalDirections<T> {
|
|
|
7
7
|
export type LayoutConfig = {
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
|
+
/**
|
|
11
|
+
* The margin between the SVG and the drawing area.
|
|
12
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
13
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
14
|
+
* @default object Depends on the charts type.
|
|
15
|
+
*/
|
|
10
16
|
margin?: Partial<CardinalDirections<number>>;
|
|
11
17
|
};
|
|
@@ -13,12 +13,28 @@ export type CommonSeriesType<TValue> = {
|
|
|
13
13
|
};
|
|
14
14
|
export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
|
|
15
15
|
export type CartesianSeriesType = {
|
|
16
|
+
/**
|
|
17
|
+
* The id of the x-axis used to render the series.
|
|
18
|
+
*/
|
|
16
19
|
xAxisKey?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The id of the y-axis used to render the series.
|
|
22
|
+
*/
|
|
17
23
|
yAxisKey?: string;
|
|
18
24
|
};
|
|
19
25
|
export type StackableSeriesType = {
|
|
26
|
+
/**
|
|
27
|
+
* The key that identifies the stacking group.
|
|
28
|
+
* Series with the same `stack` property will be stacked together.
|
|
29
|
+
*/
|
|
20
30
|
stack?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Defines how stacked series handle negative values.
|
|
33
|
+
*/
|
|
21
34
|
stackOffset?: StackOffsetType;
|
|
35
|
+
/**
|
|
36
|
+
* The order in which series' of the same group are stacked together.
|
|
37
|
+
*/
|
|
22
38
|
stackOrder?: StackOrderType;
|
|
23
39
|
};
|
|
24
40
|
export type StackOrderType = keyof typeof StackOrder;
|
|
@@ -111,6 +111,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
111
111
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
112
112
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
113
113
|
// ----------------------------------------------------------------------
|
|
114
|
+
/**
|
|
115
|
+
* Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
|
|
116
|
+
* The two properties accept the following values:
|
|
117
|
+
* - 'none': display nothing.
|
|
118
|
+
* - 'line': display a line at the current mouse position.
|
|
119
|
+
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
120
|
+
*/
|
|
114
121
|
axisHighlight: PropTypes.shape({
|
|
115
122
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
116
123
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
@@ -121,7 +128,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
121
128
|
* @default xAxisIds[0] The id of the first provided axis
|
|
122
129
|
*/
|
|
123
130
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
124
|
-
axisId: PropTypes.string
|
|
131
|
+
axisId: PropTypes.string,
|
|
125
132
|
classes: PropTypes.object,
|
|
126
133
|
disableLine: PropTypes.bool,
|
|
127
134
|
disableTicks: PropTypes.bool,
|
|
@@ -148,9 +155,21 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
148
155
|
* Color palette used to colorize multiple series.
|
|
149
156
|
*/
|
|
150
157
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
158
|
+
/**
|
|
159
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
160
|
+
*/
|
|
151
161
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
152
162
|
desc: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
165
|
+
* It might break interactive features, but will improve performance.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
153
168
|
disableAxisListener: PropTypes.bool,
|
|
169
|
+
/**
|
|
170
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
171
|
+
* @default undefined
|
|
172
|
+
*/
|
|
154
173
|
height: PropTypes.number,
|
|
155
174
|
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
156
175
|
/**
|
|
@@ -159,7 +178,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
159
178
|
* @default yAxisIds[0] The id of the first provided axis
|
|
160
179
|
*/
|
|
161
180
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
162
|
-
axisId: PropTypes.string
|
|
181
|
+
axisId: PropTypes.string,
|
|
163
182
|
classes: PropTypes.object,
|
|
164
183
|
disableLine: PropTypes.bool,
|
|
165
184
|
disableTicks: PropTypes.bool,
|
|
@@ -194,6 +213,12 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
194
213
|
slotProps: PropTypes.object,
|
|
195
214
|
slots: PropTypes.object
|
|
196
215
|
}),
|
|
216
|
+
/**
|
|
217
|
+
* The margin between the SVG and the drawing area.
|
|
218
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
219
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
220
|
+
* @default object Depends on the charts type.
|
|
221
|
+
*/
|
|
197
222
|
margin: PropTypes.shape({
|
|
198
223
|
bottom: PropTypes.number,
|
|
199
224
|
left: PropTypes.number,
|
|
@@ -206,7 +231,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
206
231
|
* @default null
|
|
207
232
|
*/
|
|
208
233
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
209
|
-
axisId: PropTypes.string
|
|
234
|
+
axisId: PropTypes.string,
|
|
210
235
|
classes: PropTypes.object,
|
|
211
236
|
disableLine: PropTypes.bool,
|
|
212
237
|
disableTicks: PropTypes.bool,
|
|
@@ -277,7 +302,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
277
302
|
* @default null
|
|
278
303
|
*/
|
|
279
304
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
280
|
-
axisId: PropTypes.string
|
|
305
|
+
axisId: PropTypes.string,
|
|
281
306
|
classes: PropTypes.object,
|
|
282
307
|
disableLine: PropTypes.bool,
|
|
283
308
|
disableTicks: PropTypes.bool,
|
|
@@ -304,7 +329,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
304
329
|
x: PropTypes.number,
|
|
305
330
|
y: PropTypes.number
|
|
306
331
|
}),
|
|
332
|
+
/**
|
|
333
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
334
|
+
* @default undefined
|
|
335
|
+
*/
|
|
307
336
|
width: PropTypes.number,
|
|
337
|
+
/**
|
|
338
|
+
* The configuration of the x-axes.
|
|
339
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
340
|
+
*/
|
|
308
341
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
309
342
|
axisId: PropTypes.string,
|
|
310
343
|
classes: PropTypes.object,
|
|
@@ -335,6 +368,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
335
368
|
tickSize: PropTypes.number,
|
|
336
369
|
valueFormatter: PropTypes.func
|
|
337
370
|
})),
|
|
371
|
+
/**
|
|
372
|
+
* The configuration of the y-axes.
|
|
373
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
374
|
+
*/
|
|
338
375
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
339
376
|
axisId: PropTypes.string,
|
|
340
377
|
classes: PropTypes.object,
|
|
@@ -11,7 +11,7 @@ const getAxisId = propsValue => {
|
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
if (typeof propsValue === 'object') {
|
|
14
|
-
return propsValue.axisId;
|
|
14
|
+
return propsValue.axisId ?? null;
|
|
15
15
|
}
|
|
16
16
|
return propsValue;
|
|
17
17
|
};
|
|
@@ -100,7 +100,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
100
100
|
* @default xAxisIds[0] The id of the first provided axis
|
|
101
101
|
*/
|
|
102
102
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
103
|
-
axisId: PropTypes.string
|
|
103
|
+
axisId: PropTypes.string,
|
|
104
104
|
classes: PropTypes.object,
|
|
105
105
|
disableLine: PropTypes.bool,
|
|
106
106
|
disableTicks: PropTypes.bool,
|
|
@@ -127,7 +127,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
127
127
|
* @default yAxisIds[0] The id of the first provided axis
|
|
128
128
|
*/
|
|
129
129
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
130
|
-
axisId: PropTypes.string
|
|
130
|
+
axisId: PropTypes.string,
|
|
131
131
|
classes: PropTypes.object,
|
|
132
132
|
disableLine: PropTypes.bool,
|
|
133
133
|
disableTicks: PropTypes.bool,
|
|
@@ -154,7 +154,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
154
154
|
* @default null
|
|
155
155
|
*/
|
|
156
156
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
157
|
-
axisId: PropTypes.string
|
|
157
|
+
axisId: PropTypes.string,
|
|
158
158
|
classes: PropTypes.object,
|
|
159
159
|
disableLine: PropTypes.bool,
|
|
160
160
|
disableTicks: PropTypes.bool,
|
|
@@ -191,7 +191,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
191
191
|
* @default null
|
|
192
192
|
*/
|
|
193
193
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
194
|
-
axisId: PropTypes.string
|
|
194
|
+
axisId: PropTypes.string,
|
|
195
195
|
classes: PropTypes.object,
|
|
196
196
|
disableLine: PropTypes.bool,
|
|
197
197
|
disableTicks: PropTypes.bool,
|
|
@@ -10,7 +10,7 @@ import { useThemeProps, useTheme, styled } from '@mui/material/styles';
|
|
|
10
10
|
import { DrawingContext } from '../context/DrawingProvider';
|
|
11
11
|
import { getSeriesToDisplay } from './utils';
|
|
12
12
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
13
|
-
import {
|
|
13
|
+
import { getLegendUtilityClass } from './chartsLegendClasses';
|
|
14
14
|
import { ChartsText, getWordsByLines } from '../internals/components/ChartsText';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -25,7 +25,7 @@ const useUtilityClasses = ownerState => {
|
|
|
25
25
|
label: ['label'],
|
|
26
26
|
series: ['series']
|
|
27
27
|
};
|
|
28
|
-
return composeClasses(slots,
|
|
28
|
+
return composeClasses(slots, getLegendUtilityClass, classes);
|
|
29
29
|
};
|
|
30
30
|
export const ChartsLegendRoot = styled('g', {
|
|
31
31
|
name: 'MuiChartsLegend',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
2
|
-
export function
|
|
2
|
+
export function getLegendUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiChartsLegend', slot);
|
|
4
4
|
}
|
|
5
5
|
export const legendClasses = generateUtilityClasses('MuiChartsLegend', ['root', 'series', 'mark', 'label', 'column', 'row']);
|