@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
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export interface BarChartSlotComponentProps extends ChartsAxisSlotComponentProps
|
|
|
15
15
|
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<BarPlotProps, 'skipAnimation'> {
|
|
16
16
|
series: MakeOptional<BarSeriesType, 'type'>[];
|
|
17
17
|
tooltip?: ChartsTooltipProps;
|
|
18
|
+
/**
|
|
19
|
+
* Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
|
|
20
|
+
* The two properties accept the following values:
|
|
21
|
+
* - 'none': display nothing.
|
|
22
|
+
* - 'line': display a line at the current mouse position.
|
|
23
|
+
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
24
|
+
*/
|
|
18
25
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
19
26
|
/**
|
|
20
27
|
* @deprecated Consider using `slotProps.legend` instead.
|
package/BarChart/BarChart.js
CHANGED
|
@@ -119,6 +119,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
119
119
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
120
120
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
121
121
|
// ----------------------------------------------------------------------
|
|
122
|
+
/**
|
|
123
|
+
* Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
|
|
124
|
+
* The two properties accept the following values:
|
|
125
|
+
* - 'none': display nothing.
|
|
126
|
+
* - 'line': display a line at the current mouse position.
|
|
127
|
+
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
128
|
+
*/
|
|
122
129
|
axisHighlight: _propTypes.default.shape({
|
|
123
130
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
124
131
|
y: _propTypes.default.oneOf(['band', 'line', 'none'])
|
|
@@ -129,7 +136,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
129
136
|
* @default xAxisIds[0] The id of the first provided axis
|
|
130
137
|
*/
|
|
131
138
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
132
|
-
axisId: _propTypes.default.string
|
|
139
|
+
axisId: _propTypes.default.string,
|
|
133
140
|
classes: _propTypes.default.object,
|
|
134
141
|
disableLine: _propTypes.default.bool,
|
|
135
142
|
disableTicks: _propTypes.default.bool,
|
|
@@ -156,9 +163,21 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
156
163
|
* Color palette used to colorize multiple series.
|
|
157
164
|
*/
|
|
158
165
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
166
|
+
/**
|
|
167
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
168
|
+
*/
|
|
159
169
|
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
160
170
|
desc: _propTypes.default.string,
|
|
171
|
+
/**
|
|
172
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
173
|
+
* It might break interactive features, but will improve performance.
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
161
176
|
disableAxisListener: _propTypes.default.bool,
|
|
177
|
+
/**
|
|
178
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
179
|
+
* @default undefined
|
|
180
|
+
*/
|
|
162
181
|
height: _propTypes.default.number,
|
|
163
182
|
layout: _propTypes.default.oneOf(['horizontal', 'vertical']),
|
|
164
183
|
/**
|
|
@@ -167,7 +186,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
167
186
|
* @default yAxisIds[0] The id of the first provided axis
|
|
168
187
|
*/
|
|
169
188
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
170
|
-
axisId: _propTypes.default.string
|
|
189
|
+
axisId: _propTypes.default.string,
|
|
171
190
|
classes: _propTypes.default.object,
|
|
172
191
|
disableLine: _propTypes.default.bool,
|
|
173
192
|
disableTicks: _propTypes.default.bool,
|
|
@@ -202,6 +221,12 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
202
221
|
slotProps: _propTypes.default.object,
|
|
203
222
|
slots: _propTypes.default.object
|
|
204
223
|
}),
|
|
224
|
+
/**
|
|
225
|
+
* The margin between the SVG and the drawing area.
|
|
226
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
227
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
228
|
+
* @default object Depends on the charts type.
|
|
229
|
+
*/
|
|
205
230
|
margin: _propTypes.default.shape({
|
|
206
231
|
bottom: _propTypes.default.number,
|
|
207
232
|
left: _propTypes.default.number,
|
|
@@ -214,7 +239,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
214
239
|
* @default null
|
|
215
240
|
*/
|
|
216
241
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
217
|
-
axisId: _propTypes.default.string
|
|
242
|
+
axisId: _propTypes.default.string,
|
|
218
243
|
classes: _propTypes.default.object,
|
|
219
244
|
disableLine: _propTypes.default.bool,
|
|
220
245
|
disableTicks: _propTypes.default.bool,
|
|
@@ -285,7 +310,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
285
310
|
* @default null
|
|
286
311
|
*/
|
|
287
312
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
288
|
-
axisId: _propTypes.default.string
|
|
313
|
+
axisId: _propTypes.default.string,
|
|
289
314
|
classes: _propTypes.default.object,
|
|
290
315
|
disableLine: _propTypes.default.bool,
|
|
291
316
|
disableTicks: _propTypes.default.bool,
|
|
@@ -312,7 +337,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
312
337
|
x: _propTypes.default.number,
|
|
313
338
|
y: _propTypes.default.number
|
|
314
339
|
}),
|
|
340
|
+
/**
|
|
341
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
342
|
+
* @default undefined
|
|
343
|
+
*/
|
|
315
344
|
width: _propTypes.default.number,
|
|
345
|
+
/**
|
|
346
|
+
* The configuration of the x-axes.
|
|
347
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
348
|
+
*/
|
|
316
349
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
317
350
|
axisId: _propTypes.default.string,
|
|
318
351
|
classes: _propTypes.default.object,
|
|
@@ -343,6 +376,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
343
376
|
tickSize: _propTypes.default.number,
|
|
344
377
|
valueFormatter: _propTypes.default.func
|
|
345
378
|
})),
|
|
379
|
+
/**
|
|
380
|
+
* The configuration of the y-axes.
|
|
381
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
382
|
+
*/
|
|
346
383
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
347
384
|
axisId: _propTypes.default.string,
|
|
348
385
|
classes: _propTypes.default.object,
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,117 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.18.2
|
|
7
|
+
|
|
8
|
+
_Nov 23, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Arabic (ar-SD), Czech (cs-CZ), and Hebrew (he-IL) locales on Data Grid
|
|
13
|
+
- 🌍 Add Basque (eu) and Macedonian (mk) locales on Pickers
|
|
14
|
+
- 🌍 Improve German (de-DE) and Spanish (es-ES) locales on Pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@6.18.2`
|
|
21
|
+
|
|
22
|
+
- [l10n] Improve Arabic (ar-SD) locale (#11096) @OmarWebDev
|
|
23
|
+
- [l10n] Improve Czech (cs-CZ) locale (#10968) @luborepka
|
|
24
|
+
- [l10n] Improve Hebrew (he-IL) locale (#11056) @LironKiloma
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@6.18.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@6.18.2`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@6.18.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.2`.
|
|
33
|
+
|
|
34
|
+
### Date Pickers
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers@6.18.2`
|
|
37
|
+
|
|
38
|
+
- [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10985) @lajtomekadimon
|
|
39
|
+
- [l10n] Add Macedonian (mk) locale (#11155) @brsnik
|
|
40
|
+
- [l10n] Improve German (de-DE) locale (#11104) @jho-vema
|
|
41
|
+
- [pickers] Deprecate `defaultCalendarMonth` prop (#11138) @flaviendelangle
|
|
42
|
+
- [pickers] Fix `DateCalendar` crashing when given an invalid value (#11101) @flaviendelangle
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers-pro@6.18.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-date-pickers@6.18.2`.
|
|
47
|
+
|
|
48
|
+
### Charts / `@mui/x-charts@6.18.2`
|
|
49
|
+
|
|
50
|
+
- [charts] Fix `ChartsTooltip` component setup (#11157) @LukasTy
|
|
51
|
+
- [charts] Remove outdated prop-types (#10998) @alexfauquette
|
|
52
|
+
|
|
53
|
+
### Docs
|
|
54
|
+
|
|
55
|
+
- [docs] Fix incoherent naming of a component in `Custom slots and subcomponents` page (#11003) @lhilgert9
|
|
56
|
+
- [test] Skip flaky e2e test in webkit (#11115) @cherniavskii
|
|
57
|
+
- [test] Wait for images to load (#11109) @cherniavskii
|
|
58
|
+
|
|
59
|
+
## 6.18.1
|
|
60
|
+
|
|
61
|
+
_Nov 9, 2023_
|
|
62
|
+
|
|
63
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
64
|
+
|
|
65
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
66
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/) published
|
|
67
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
68
|
+
- 🐞 Bugfixes
|
|
69
|
+
- 📚 Documentation improvements
|
|
70
|
+
|
|
71
|
+
### Data Grid
|
|
72
|
+
|
|
73
|
+
#### `@mui/x-data-grid@6.18.1`
|
|
74
|
+
|
|
75
|
+
- [DataGrid] Fix cell value type in quick filtering v7 (#10884) @cherniavskii
|
|
76
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10947) @michelengelen
|
|
77
|
+
- [DataGrid] Fix `undefined` slot values (#10934) @romgrk
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-data-grid-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
80
|
+
|
|
81
|
+
Same changes as in `@mui/x-data-grid@6.18.1`, plus:
|
|
82
|
+
|
|
83
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-data-grid-premium@6.18.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
86
|
+
|
|
87
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.1`, plus:
|
|
88
|
+
|
|
89
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10961) @cherniavskii
|
|
90
|
+
|
|
91
|
+
### Date Pickers
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-date-pickers@6.18.1`
|
|
94
|
+
|
|
95
|
+
- [fields] Fix multi input date time field section selection (#10915) @noraleonte
|
|
96
|
+
- [pickers] Always use up-to-date `defaultView` (#10889) @LukasTy
|
|
97
|
+
|
|
98
|
+
#### `@mui/x-date-pickers-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
99
|
+
|
|
100
|
+
Same changes as in `@mui/x-date-pickers@6.18.1`.
|
|
101
|
+
|
|
102
|
+
### Charts / `@mui/x-charts@6.18.1`
|
|
103
|
+
|
|
104
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) @wascou
|
|
105
|
+
- [charts] Improve properties JSDoc (#10931) @alexfauquette
|
|
106
|
+
|
|
107
|
+
### Docs
|
|
108
|
+
|
|
109
|
+
- [docs] Fix charts docs as stable (#10888) @alexfauquette
|
|
110
|
+
- [docs] Document how to hide the legend (#10954) @alexfauquette
|
|
111
|
+
|
|
112
|
+
### Core
|
|
113
|
+
|
|
114
|
+
- [core] Adds new alpha version to version select on the docs (#10944) @michelengelen
|
|
115
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
116
|
+
|
|
6
117
|
## 6.18.0
|
|
7
118
|
|
|
8
119
|
_Nov 3, 2023_
|
|
@@ -357,7 +468,7 @@ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
|
357
468
|
|
|
358
469
|
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
359
470
|
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
360
|
-
- [
|
|
471
|
+
- [changelog] Polish image @oliviertassinari
|
|
361
472
|
|
|
362
473
|
## 6.16.0
|
|
363
474
|
|
|
@@ -1149,7 +1260,7 @@ Same changes as in `@mui/x-date-pickers@6.10.1`.
|
|
|
1149
1260
|
### Core
|
|
1150
1261
|
|
|
1151
1262
|
- [core] Add `validate` command (#9714) @romgrk
|
|
1152
|
-
- [
|
|
1263
|
+
- [changelog] Update generator to new format @oliviertassinari
|
|
1153
1264
|
|
|
1154
1265
|
## 6.10.0
|
|
1155
1266
|
|
|
@@ -1207,7 +1318,7 @@ Same changes as in `@mui/x-date-pickers@6.10.0`.
|
|
|
1207
1318
|
|
|
1208
1319
|
- [core] Disambiguate eslint plugin name @oliviertassinari
|
|
1209
1320
|
- [core] Update priority support issue template and prompt (#9574) @DanailH
|
|
1210
|
-
- [
|
|
1321
|
+
- [changelog] Clarify each plan (#9446) @oliviertassinari
|
|
1211
1322
|
- [license] Fix error terminology (#9614) @oliviertassinari
|
|
1212
1323
|
|
|
1213
1324
|
## 6.9.2
|
|
@@ -1356,8 +1467,8 @@ Same changes as in `@mui/x-date-pickers@6.9.1`.
|
|
|
1356
1467
|
- [core] Fix priority support prompt action (#9472) @DanailH
|
|
1357
1468
|
- [core] Update `uses` for priority support action (#9480) @DanailH
|
|
1358
1469
|
- [core] Bumb update monorepo (#9476) @alexfauquette
|
|
1359
|
-
- [
|
|
1360
|
-
- [
|
|
1470
|
+
- [changelog] Fix media quality (#9439) @oliviertassinari
|
|
1471
|
+
- [changelog] Remove height img attribute @oliviertassinari
|
|
1361
1472
|
- [test] Skip flaky row pinning tests in JSDOM (#9511) @cherniavskii
|
|
1362
1473
|
|
|
1363
1474
|
## 6.9.0
|
package/ChartsAxis/ChartsAxis.js
CHANGED
|
@@ -19,7 +19,7 @@ const getAxisId = propsValue => {
|
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
if (typeof propsValue === 'object') {
|
|
22
|
-
return propsValue.axisId;
|
|
22
|
+
return propsValue.axisId ?? null;
|
|
23
23
|
}
|
|
24
24
|
return propsValue;
|
|
25
25
|
};
|
|
@@ -108,7 +108,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
108
108
|
* @default xAxisIds[0] The id of the first provided axis
|
|
109
109
|
*/
|
|
110
110
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
111
|
-
axisId: _propTypes.default.string
|
|
111
|
+
axisId: _propTypes.default.string,
|
|
112
112
|
classes: _propTypes.default.object,
|
|
113
113
|
disableLine: _propTypes.default.bool,
|
|
114
114
|
disableTicks: _propTypes.default.bool,
|
|
@@ -135,7 +135,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
135
135
|
* @default yAxisIds[0] The id of the first provided axis
|
|
136
136
|
*/
|
|
137
137
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
138
|
-
axisId: _propTypes.default.string
|
|
138
|
+
axisId: _propTypes.default.string,
|
|
139
139
|
classes: _propTypes.default.object,
|
|
140
140
|
disableLine: _propTypes.default.bool,
|
|
141
141
|
disableTicks: _propTypes.default.bool,
|
|
@@ -162,7 +162,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
162
162
|
* @default null
|
|
163
163
|
*/
|
|
164
164
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
165
|
-
axisId: _propTypes.default.string
|
|
165
|
+
axisId: _propTypes.default.string,
|
|
166
166
|
classes: _propTypes.default.object,
|
|
167
167
|
disableLine: _propTypes.default.bool,
|
|
168
168
|
disableTicks: _propTypes.default.bool,
|
|
@@ -199,7 +199,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
199
199
|
* @default null
|
|
200
200
|
*/
|
|
201
201
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
202
|
-
axisId: _propTypes.default.string
|
|
202
|
+
axisId: _propTypes.default.string,
|
|
203
203
|
classes: _propTypes.default.object,
|
|
204
204
|
disableLine: _propTypes.default.bool,
|
|
205
205
|
disableTicks: _propTypes.default.bool,
|
|
@@ -11,9 +11,9 @@ export interface ChartsAxisClasses {
|
|
|
11
11
|
tickLabel: string;
|
|
12
12
|
/** Styles applied to the group containing the axis label. */
|
|
13
13
|
label: string;
|
|
14
|
-
/** Styles applied to x
|
|
14
|
+
/** Styles applied to x-axes. */
|
|
15
15
|
directionX: string;
|
|
16
|
-
/** Styles applied to y
|
|
16
|
+
/** Styles applied to y-axes. */
|
|
17
17
|
directionY: string;
|
|
18
18
|
/** Styles applied to the top axis. */
|
|
19
19
|
top: string;
|
|
@@ -34,7 +34,7 @@ const useUtilityClasses = ownerState => {
|
|
|
34
34
|
label: ['label'],
|
|
35
35
|
series: ['series']
|
|
36
36
|
};
|
|
37
|
-
return (0, _utils2.unstable_composeClasses)(slots, _chartsLegendClasses.
|
|
37
|
+
return (0, _utils2.unstable_composeClasses)(slots, _chartsLegendClasses.getLegendUtilityClass, classes);
|
|
38
38
|
};
|
|
39
39
|
const ChartsLegendRoot = exports.ChartsLegendRoot = (0, _styles.styled)('g', {
|
|
40
40
|
name: 'MuiChartsLegend',
|
|
@@ -13,5 +13,5 @@ export interface ChartsLegendClasses {
|
|
|
13
13
|
row: string;
|
|
14
14
|
}
|
|
15
15
|
export type ChartsLegendClassKey = keyof ChartsLegendClasses;
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function getLegendUtilityClass(slot: string): string;
|
|
17
17
|
export declare const legendClasses: ChartsLegendClasses;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getLegendUtilityClass = getLegendUtilityClass;
|
|
7
7
|
exports.legendClasses = void 0;
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
|
-
function
|
|
9
|
+
function getLegendUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiChartsLegend', slot);
|
|
11
11
|
}
|
|
12
12
|
const legendClasses = exports.legendClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsLegend', ['root', 'series', 'mark', 'label', 'column', 'row']);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsXReferenceLineProps } from './ChartsXReferenceLine';
|
|
3
|
+
import { ChartsYReferenceLineProps } from './ChartsYReferenceLine';
|
|
4
|
+
import { XOR } from '../internals/utils';
|
|
5
|
+
type ChartsReferenceLineProps<TValue extends string | number | Date = string | number | Date> = XOR<ChartsXReferenceLineProps<TValue>, ChartsYReferenceLineProps<TValue>>;
|
|
6
|
+
declare function ChartsReferenceLine(props: ChartsReferenceLineProps): React.JSX.Element;
|
|
7
|
+
declare namespace ChartsReferenceLine {
|
|
8
|
+
var propTypes: any;
|
|
9
|
+
}
|
|
10
|
+
export { ChartsReferenceLine };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ChartsReferenceLine = ChartsReferenceLine;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _ChartsXReferenceLine = require("./ChartsXReferenceLine");
|
|
12
|
+
var _ChartsYReferenceLine = require("./ChartsYReferenceLine");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function ChartsReferenceLine(props) {
|
|
17
|
+
if (props.x !== undefined && props.y !== undefined) {
|
|
18
|
+
throw new Error('MUI-X: The ChartsReferenceLine can not have both `x` and `y` props set.');
|
|
19
|
+
}
|
|
20
|
+
if (props.x === undefined && props.y === undefined) {
|
|
21
|
+
throw new Error('MUI-X: The ChartsReferenceLine should have a value in `x` or `y` prop.');
|
|
22
|
+
}
|
|
23
|
+
if (props.x !== undefined) {
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXReferenceLine.ChartsXReferenceLine, (0, _extends2.default)({}, props));
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYReferenceLine.ChartsYReferenceLine, (0, _extends2.default)({}, props));
|
|
27
|
+
}
|
|
28
|
+
process.env.NODE_ENV !== "production" ? ChartsReferenceLine.propTypes = {
|
|
29
|
+
// ----------------------------- Warning --------------------------------
|
|
30
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
32
|
+
// ----------------------------------------------------------------------
|
|
33
|
+
/**
|
|
34
|
+
* The id of the axis used for the reference value.
|
|
35
|
+
* @default The `id` of the first defined axis.
|
|
36
|
+
*/
|
|
37
|
+
axisId: _propTypes.default.string,
|
|
38
|
+
/**
|
|
39
|
+
* Override or extend the styles applied to the component.
|
|
40
|
+
*/
|
|
41
|
+
classes: _propTypes.default.object,
|
|
42
|
+
/**
|
|
43
|
+
* The label to display along the reference line.
|
|
44
|
+
*/
|
|
45
|
+
label: _propTypes.default.string,
|
|
46
|
+
/**
|
|
47
|
+
* The alignment if the label is in the chart drawing area.
|
|
48
|
+
* @default 'middle'
|
|
49
|
+
*/
|
|
50
|
+
labelAlign: _propTypes.default.oneOf(['end', 'middle', 'start']),
|
|
51
|
+
/**
|
|
52
|
+
* The style applied to the label.
|
|
53
|
+
*/
|
|
54
|
+
labelStyle: _propTypes.default.object,
|
|
55
|
+
/**
|
|
56
|
+
* The style applied to the line.
|
|
57
|
+
*/
|
|
58
|
+
lineStyle: _propTypes.default.object,
|
|
59
|
+
/**
|
|
60
|
+
* Additional space arround the label in px.
|
|
61
|
+
* Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
|
|
62
|
+
* @default 5
|
|
63
|
+
*/
|
|
64
|
+
spacing: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
65
|
+
x: _propTypes.default.number,
|
|
66
|
+
y: _propTypes.default.number
|
|
67
|
+
})]),
|
|
68
|
+
/**
|
|
69
|
+
* The x value associated with the reference line.
|
|
70
|
+
* If defined the reference line will be vertical.
|
|
71
|
+
*/
|
|
72
|
+
x: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]),
|
|
73
|
+
/**
|
|
74
|
+
* The y value associated with the reference line.
|
|
75
|
+
* If defined the reference line will be horizontal.
|
|
76
|
+
*/
|
|
77
|
+
y: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string])
|
|
78
|
+
} : void 0;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CommonChartsReferenceLineProps } from './common';
|
|
3
|
+
import { ChartsReferenceLineClasses } from './chartsReferenceLineClasses';
|
|
4
|
+
export type ChartsXReferenceLineProps<TValue extends string | number | Date = string | number | Date> = CommonChartsReferenceLineProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The x value associated with the reference line.
|
|
7
|
+
* If defined the reference line will be vertical.
|
|
8
|
+
*/
|
|
9
|
+
x: TValue;
|
|
10
|
+
};
|
|
11
|
+
export declare function getXReferenceLineClasses(classes?: Partial<ChartsReferenceLineClasses>): Record<"label" | "line" | "root", string>;
|
|
12
|
+
declare function ChartsXReferenceLine(props: ChartsXReferenceLineProps): React.JSX.Element | null;
|
|
13
|
+
export { ChartsXReferenceLine };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ChartsXReferenceLine = ChartsXReferenceLine;
|
|
8
|
+
exports.getXReferenceLineClasses = getXReferenceLineClasses;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
|
+
var _hooks = require("../hooks");
|
|
13
|
+
var _common = require("./common");
|
|
14
|
+
var _ChartsText = require("../internals/components/ChartsText");
|
|
15
|
+
var _chartsReferenceLineClasses = require("./chartsReferenceLineClasses");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const getTextParams = ({
|
|
20
|
+
top,
|
|
21
|
+
height,
|
|
22
|
+
spacingY,
|
|
23
|
+
labelAlign = 'middle'
|
|
24
|
+
}) => {
|
|
25
|
+
switch (labelAlign) {
|
|
26
|
+
case 'start':
|
|
27
|
+
return {
|
|
28
|
+
y: top + spacingY,
|
|
29
|
+
style: {
|
|
30
|
+
dominantBaseline: 'hanging',
|
|
31
|
+
textAnchor: 'start'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
case 'end':
|
|
35
|
+
return {
|
|
36
|
+
y: top + height - spacingY,
|
|
37
|
+
style: {
|
|
38
|
+
dominantBaseline: 'auto',
|
|
39
|
+
textAnchor: 'start'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
default:
|
|
43
|
+
return {
|
|
44
|
+
y: top + height / 2,
|
|
45
|
+
style: {
|
|
46
|
+
dominantBaseline: 'central',
|
|
47
|
+
textAnchor: 'start'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function getXReferenceLineClasses(classes) {
|
|
53
|
+
return (0, _composeClasses.default)({
|
|
54
|
+
root: ['root', 'vertical'],
|
|
55
|
+
line: ['line'],
|
|
56
|
+
label: ['label']
|
|
57
|
+
}, _chartsReferenceLineClasses.getReferenceLineUtilityClass, classes);
|
|
58
|
+
}
|
|
59
|
+
let warnedOnce = false;
|
|
60
|
+
function ChartsXReferenceLine(props) {
|
|
61
|
+
const {
|
|
62
|
+
x,
|
|
63
|
+
label = '',
|
|
64
|
+
spacing = 5,
|
|
65
|
+
classes: inClasses,
|
|
66
|
+
labelAlign,
|
|
67
|
+
lineStyle,
|
|
68
|
+
labelStyle,
|
|
69
|
+
axisId
|
|
70
|
+
} = props;
|
|
71
|
+
const {
|
|
72
|
+
top,
|
|
73
|
+
height
|
|
74
|
+
} = (0, _hooks.useDrawingArea)();
|
|
75
|
+
const xAxisScale = (0, _hooks.useXScale)(axisId);
|
|
76
|
+
const xPosition = xAxisScale(x);
|
|
77
|
+
if (xPosition === undefined) {
|
|
78
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
79
|
+
if (!warnedOnce) {
|
|
80
|
+
warnedOnce = true;
|
|
81
|
+
console.error(`MUI X: the value ${x} does not exist in the data of x axis with id ${axisId}.`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const d = `M ${xPosition} ${top} l 0 ${height}`;
|
|
87
|
+
const classes = getXReferenceLineClasses(inClasses);
|
|
88
|
+
const spacingX = typeof spacing === 'object' ? spacing.x ?? 0 : spacing;
|
|
89
|
+
const spacingY = typeof spacing === 'object' ? spacing.y ?? 0 : spacing;
|
|
90
|
+
const textParams = (0, _extends2.default)({
|
|
91
|
+
x: xPosition + spacingX,
|
|
92
|
+
text: label,
|
|
93
|
+
fontSize: 12
|
|
94
|
+
}, getTextParams({
|
|
95
|
+
top,
|
|
96
|
+
height,
|
|
97
|
+
spacingY,
|
|
98
|
+
labelAlign
|
|
99
|
+
}), {
|
|
100
|
+
className: classes.label
|
|
101
|
+
});
|
|
102
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_common.ReferenceLineRoot, {
|
|
103
|
+
className: classes.root,
|
|
104
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
105
|
+
d: d,
|
|
106
|
+
className: classes.line,
|
|
107
|
+
style: lineStyle
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsText.ChartsText, (0, _extends2.default)({}, textParams, {
|
|
109
|
+
style: (0, _extends2.default)({}, textParams.style, labelStyle)
|
|
110
|
+
}))]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CommonChartsReferenceLineProps } from './common';
|
|
3
|
+
import { ChartsReferenceLineClasses } from './chartsReferenceLineClasses';
|
|
4
|
+
export type ChartsYReferenceLineProps<TValue extends string | number | Date = string | number | Date> = CommonChartsReferenceLineProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The y value associated with the reference line.
|
|
7
|
+
* If defined the reference line will be horizontal.
|
|
8
|
+
*/
|
|
9
|
+
y: TValue;
|
|
10
|
+
};
|
|
11
|
+
export declare function getYReferenceLineClasses(classes?: Partial<ChartsReferenceLineClasses>): Record<"label" | "line" | "root", string>;
|
|
12
|
+
declare function ChartsYReferenceLine(props: ChartsYReferenceLineProps): React.JSX.Element | null;
|
|
13
|
+
export { ChartsYReferenceLine };
|