@mui/x-charts 7.0.0-beta.2 → 7.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/BarChart/BarChart.d.ts +21 -5
  2. package/BarChart/BarChart.js +27 -5
  3. package/CHANGELOG.md +73 -9
  4. package/ChartsGrid/ChartsGrid.d.ts +30 -0
  5. package/ChartsGrid/ChartsGrid.js +128 -0
  6. package/ChartsGrid/chartsGridClasses.d.ts +13 -0
  7. package/ChartsGrid/chartsGridClasses.js +14 -0
  8. package/ChartsGrid/index.d.ts +2 -0
  9. package/ChartsGrid/index.js +27 -0
  10. package/ChartsGrid/package.json +6 -0
  11. package/ChartsSurface.js +6 -4
  12. package/ChartsXAxis/ChartsXAxis.js +2 -2
  13. package/ChartsYAxis/ChartsYAxis.js +2 -2
  14. package/Gauge/Gauge.d.ts +13 -0
  15. package/Gauge/Gauge.js +156 -0
  16. package/Gauge/GaugeContainer.d.ts +19 -0
  17. package/Gauge/GaugeContainer.js +216 -0
  18. package/Gauge/GaugeProvider.d.ts +117 -0
  19. package/Gauge/GaugeProvider.js +96 -0
  20. package/Gauge/GaugeReferenceArc.d.ts +2 -0
  21. package/Gauge/GaugeReferenceArc.js +44 -0
  22. package/Gauge/GaugeValueArc.d.ts +2 -0
  23. package/Gauge/GaugeValueArc.js +51 -0
  24. package/Gauge/GaugeValueText.d.ts +15 -0
  25. package/Gauge/GaugeValueText.js +77 -0
  26. package/Gauge/gaugeClasses.d.ts +14 -0
  27. package/Gauge/gaugeClasses.js +15 -0
  28. package/Gauge/index.d.ts +7 -0
  29. package/Gauge/index.js +87 -0
  30. package/Gauge/package.json +6 -0
  31. package/Gauge/utils.d.ts +19 -0
  32. package/Gauge/utils.js +75 -0
  33. package/LineChart/LineChart.d.ts +24 -5
  34. package/LineChart/LineChart.js +31 -5
  35. package/PieChart/PieArc.d.ts +4 -4
  36. package/PieChart/PieArc.js +9 -9
  37. package/PieChart/PieArcLabelPlot.js +13 -13
  38. package/PieChart/PieChart.d.ts +22 -0
  39. package/PieChart/PieChart.js +22 -0
  40. package/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -66
  41. package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +2 -0
  42. package/ResponsiveChartContainer/useChartContainerDimensions.js +76 -0
  43. package/ScatterChart/ScatterChart.d.ts +18 -0
  44. package/ScatterChart/ScatterChart.js +25 -0
  45. package/esm/BarChart/BarChart.js +27 -5
  46. package/esm/ChartsGrid/ChartsGrid.js +121 -0
  47. package/esm/ChartsGrid/chartsGridClasses.js +6 -0
  48. package/esm/ChartsGrid/index.js +2 -0
  49. package/esm/ChartsSurface.js +6 -4
  50. package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
  51. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  52. package/esm/Gauge/Gauge.js +149 -0
  53. package/esm/Gauge/GaugeContainer.js +211 -0
  54. package/esm/Gauge/GaugeProvider.js +85 -0
  55. package/esm/Gauge/GaugeReferenceArc.js +35 -0
  56. package/esm/Gauge/GaugeValueArc.js +42 -0
  57. package/esm/Gauge/GaugeValueText.js +69 -0
  58. package/esm/Gauge/gaugeClasses.js +7 -0
  59. package/esm/Gauge/index.js +7 -0
  60. package/esm/Gauge/utils.js +68 -0
  61. package/esm/LineChart/LineChart.js +31 -5
  62. package/esm/PieChart/PieArc.js +9 -9
  63. package/esm/PieChart/PieArcLabelPlot.js +13 -13
  64. package/esm/PieChart/PieChart.js +22 -0
  65. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -66
  66. package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
  67. package/esm/ScatterChart/ScatterChart.js +25 -0
  68. package/esm/hooks/useTicks.js +2 -3
  69. package/esm/index.js +2 -0
  70. package/hooks/useTicks.d.ts +1 -2
  71. package/hooks/useTicks.js +2 -3
  72. package/index.d.ts +2 -0
  73. package/index.js +23 -1
  74. package/legacy/BarChart/BarChart.js +27 -5
  75. package/legacy/ChartsGrid/ChartsGrid.js +119 -0
  76. package/legacy/ChartsGrid/chartsGridClasses.js +6 -0
  77. package/legacy/ChartsGrid/index.js +2 -0
  78. package/legacy/ChartsSurface.js +5 -3
  79. package/legacy/ChartsXAxis/ChartsXAxis.js +1 -1
  80. package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
  81. package/legacy/Gauge/Gauge.js +146 -0
  82. package/legacy/Gauge/GaugeContainer.js +215 -0
  83. package/legacy/Gauge/GaugeProvider.js +87 -0
  84. package/legacy/Gauge/GaugeReferenceArc.js +37 -0
  85. package/legacy/Gauge/GaugeValueArc.js +44 -0
  86. package/legacy/Gauge/GaugeValueText.js +66 -0
  87. package/legacy/Gauge/gaugeClasses.js +7 -0
  88. package/legacy/Gauge/index.js +7 -0
  89. package/legacy/Gauge/utils.js +84 -0
  90. package/legacy/LineChart/LineChart.js +31 -5
  91. package/legacy/PieChart/PieArc.js +10 -10
  92. package/legacy/PieChart/PieArcLabelPlot.js +14 -14
  93. package/legacy/PieChart/PieChart.js +22 -0
  94. package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +7 -77
  95. package/legacy/ResponsiveChartContainer/useChartContainerDimensions.js +73 -0
  96. package/legacy/ScatterChart/ScatterChart.js +25 -0
  97. package/legacy/hooks/useTicks.js +2 -3
  98. package/legacy/index.js +3 -1
  99. package/modern/BarChart/BarChart.js +27 -5
  100. package/modern/ChartsGrid/ChartsGrid.js +121 -0
  101. package/modern/ChartsGrid/chartsGridClasses.js +6 -0
  102. package/modern/ChartsGrid/index.js +2 -0
  103. package/modern/ChartsSurface.js +6 -4
  104. package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
  105. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  106. package/modern/Gauge/Gauge.js +149 -0
  107. package/modern/Gauge/GaugeContainer.js +208 -0
  108. package/modern/Gauge/GaugeProvider.js +85 -0
  109. package/modern/Gauge/GaugeReferenceArc.js +35 -0
  110. package/modern/Gauge/GaugeValueArc.js +42 -0
  111. package/modern/Gauge/GaugeValueText.js +69 -0
  112. package/modern/Gauge/gaugeClasses.js +7 -0
  113. package/modern/Gauge/index.js +7 -0
  114. package/modern/Gauge/utils.js +68 -0
  115. package/modern/LineChart/LineChart.js +31 -5
  116. package/modern/PieChart/PieArc.js +9 -9
  117. package/modern/PieChart/PieArcLabelPlot.js +13 -13
  118. package/modern/PieChart/PieChart.js +22 -0
  119. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -66
  120. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
  121. package/modern/ScatterChart/ScatterChart.js +25 -0
  122. package/modern/hooks/useTicks.js +2 -3
  123. package/modern/index.js +3 -1
  124. package/package.json +4 -4
@@ -8,20 +8,32 @@ import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '
8
8
  import { ChartsLegendProps, ChartsLegendSlots, ChartsLegendSlotProps } from '../ChartsLegend';
9
9
  import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
10
10
  import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
11
+ import { ChartsGridProps } from '../ChartsGrid';
11
12
  import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
12
13
  export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
13
14
  }
14
15
  export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
15
16
  }
16
17
  export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
18
+ /**
19
+ * The series to display in the bar chart.
20
+ */
17
21
  series: MakeOptional<BarSeriesType, 'type'>[];
22
+ /**
23
+ * The configuration of the tooltip.
24
+ * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
25
+ */
18
26
  tooltip?: ChartsTooltipProps;
19
27
  /**
20
- * Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
21
- * The two properties accept the following values:
22
- * - 'none': display nothing.
23
- * - 'line': display a line at the current mouse position.
24
- * - 'band': display a band at the current mouse position. Only available with band scale.
28
+ * Option to display a cartesian grid in the background.
29
+ */
30
+ grid?: Pick<ChartsGridProps, 'vertical' | 'horizontal'>;
31
+ /**
32
+ * The configuration of axes highlight.
33
+ * Default is set to 'band' in the bar direction.
34
+ * Depends on `layout` prop.
35
+ * @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
36
+ *
25
37
  */
26
38
  axisHighlight?: ChartsAxisHighlightProps;
27
39
  /**
@@ -38,6 +50,10 @@ export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'seri
38
50
  * @default {}
39
51
  */
40
52
  slotProps?: BarChartSlotProps;
53
+ /**
54
+ * The direction of the bar elements.
55
+ * @default 'vertical'
56
+ */
41
57
  layout?: BarSeriesType['layout'];
42
58
  }
43
59
  /**
@@ -17,6 +17,7 @@ var _ChartsTooltip = require("../ChartsTooltip");
17
17
  var _ChartsLegend = require("../ChartsLegend");
18
18
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
19
19
  var _ChartsClipPath = require("../ChartsClipPath");
20
+ var _ChartsGrid = require("../ChartsGrid");
20
21
  var _ChartsOnAxisClickHandler = require("../ChartsOnAxisClickHandler");
21
22
  var _jsxRuntime = require("react/jsx-runtime");
22
23
  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); }
@@ -47,6 +48,7 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
47
48
  tooltip,
48
49
  axisHighlight,
49
50
  legend,
51
+ grid,
50
52
  topAxis,
51
53
  leftAxis,
52
54
  rightAxis,
@@ -94,6 +96,9 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
94
96
  disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
95
97
  children: [onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, {
96
98
  onAxisClick: onAxisClick
99
+ }), grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, {
100
+ vertical: grid.vertical,
101
+ horizontal: grid.horizontal
97
102
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
98
103
  clipPath: `url(#${clipPathId})`,
99
104
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, {
@@ -126,11 +131,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
126
131
  // | To update them edit the TypeScript types and run "yarn proptypes" |
127
132
  // ----------------------------------------------------------------------
128
133
  /**
129
- * Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
130
- * The two properties accept the following values:
131
- * - 'none': display nothing.
132
- * - 'line': display a line at the current mouse position.
133
- * - 'band': display a band at the current mouse position. Only available with band scale.
134
+ * The configuration of axes highlight.
135
+ * Default is set to 'band' in the bar direction.
136
+ * Depends on `layout` prop.
137
+ * @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
134
138
  */
135
139
  axisHighlight: _propTypes.default.shape({
136
140
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
@@ -181,11 +185,22 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
181
185
  * @default false
182
186
  */
183
187
  disableAxisListener: _propTypes.default.bool,
188
+ /**
189
+ * Option to display a cartesian grid in the background.
190
+ */
191
+ grid: _propTypes.default.shape({
192
+ horizontal: _propTypes.default.bool,
193
+ vertical: _propTypes.default.bool
194
+ }),
184
195
  /**
185
196
  * The height of the chart in px. If not defined, it takes the height of the parent element.
186
197
  * @default undefined
187
198
  */
188
199
  height: _propTypes.default.number,
200
+ /**
201
+ * The direction of the bar elements.
202
+ * @default 'vertical'
203
+ */
189
204
  layout: _propTypes.default.oneOf(['horizontal', 'vertical']),
190
205
  /**
191
206
  * Indicate which axis to display the left of the charts.
@@ -280,6 +295,9 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
280
295
  tickNumber: _propTypes.default.number,
281
296
  tickSize: _propTypes.default.number
282
297
  }), _propTypes.default.string]),
298
+ /**
299
+ * The series to display in the bar chart.
300
+ */
283
301
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
284
302
  /**
285
303
  * If `true`, animations are skipped.
@@ -298,6 +316,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
298
316
  slots: _propTypes.default.object,
299
317
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
300
318
  title: _propTypes.default.string,
319
+ /**
320
+ * The configuration of the tooltip.
321
+ * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
322
+ */
301
323
  tooltip: _propTypes.default.shape({
302
324
  axisContent: _propTypes.default.elementType,
303
325
  classes: _propTypes.default.object,
package/CHANGELOG.md CHANGED
@@ -3,6 +3,70 @@
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
+ ## v7.0.0-beta.3
7
+
8
+ _Feb 16, 2024_
9
+
10
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Charts get a [built in grid](https://next.mui.com/x/react-charts/axis/#grid)
13
+
14
+ <img src="https://github.com/mui/mui-x/assets/45398769/74299f54-f020-4135-b38c-dc88a230db30" width="510" alt="Charts Grid" />
15
+
16
+ - 🎛️ Charts get a [Gauge component](https://next.mui.com/x/react-charts/gauge/).
17
+
18
+ <img src="https://github.com/mui/mui-x/assets/45398769/fb7a94b5-bef6-4fc2-a0cd-d6ff5b60fa8b" width="510" alt="Guage Chart" />
19
+
20
+ - 🐞 Bugfixes
21
+
22
+ - 📚 Documentation improvements
23
+
24
+ ### Data Grid
25
+
26
+ #### Breaking changes
27
+
28
+ - The `rowEditCommit` event and the related prop `onRowEditCommit` was removed. The [`processRowUpdate`](https://next.mui.com/x/react-data-grid/editing/#the-processrowupdate-callback) prop can be used in place.
29
+
30
+ #### `@mui/x-data-grid@7.0.0-beta.3`
31
+
32
+ - [DataGrid] Performance: avoid style invalidation (#12019) @romgrk
33
+ - [DataGrid] Remove legacy editing API event: `rowEditCommit` (#12073) @MBilalShafi
34
+ - [DataGrid] Fix styling grid filter input single select (#11520) @FreakDroid
35
+
36
+ #### `@mui/x-data-grid-pro@7.0.0-beta.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
37
+
38
+ Same changes as in `@mui/x-data-grid@7.0.0-beta.3`.
39
+
40
+ #### `@mui/x-data-grid-premium@7.0.0-beta.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
41
+
42
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.3`.
43
+
44
+ ### Charts / `@mui/x-charts@7.0.0-beta.3`
45
+
46
+ - [charts] Add Gauge component (#11996) @alexfauquette
47
+ - [charts] Add a `ChartsGrid` component (#11034) @alexfauquette
48
+
49
+ ### Tree View / `@mui/x-tree-view@7.0.0-beta.3`
50
+
51
+ - [TreeView] Remove instance existence checks (#12066) @flaviendelangle
52
+
53
+ ### Docs
54
+
55
+ - [docs] Complete charts API pages (#12038) @alexfauquette
56
+ - [docs] Add more illustrations to the charts overview page (#12041) @danilo-leal
57
+ - [docs] Fix 301 redirection to StackBlitz @oliviertassinari
58
+ - [docs] Fix Tree space to match the reset of the docs @oliviertassinari
59
+ - [docs] Fix `dayOfWeekFormatter` typo in the pickers v6 to v7 migration document (#12043) @StylesTrip
60
+ - [docs] Fix redirection @oliviertassinari
61
+ - [docs] Fix typo for `AdapterDateFnsV3` (#12036) @flaviendelangle
62
+ - [docs] Removed `focused` prop from demo (#12092) @michelengelen
63
+
64
+ ### Core
65
+
66
+ - [core] Fix CodeSandbox CI template @oliviertassinari
67
+ - [core] Sort prop asc (#12033) @oliviertassinari
68
+ - [core] Bump monorepo (#12055) @alexfauquette
69
+
6
70
  ## v7.0.0-beta.2
7
71
 
8
72
  _Feb 9, 2024_
@@ -17,7 +81,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
17
81
 
18
82
  ### Data Grid
19
83
 
20
- #### `@mui/x-data-grid@v7.0.0-beta.2`
84
+ #### `@mui/x-data-grid@7.0.0-beta.2`
21
85
 
22
86
  - [DataGrid] Add `removeAllFilterItems` as a reason of `onFilterModelChange` callback (#11911) @shaharyar-shamshi
23
87
  - [DataGrid] Add slot typings (#11795) @romgrk
@@ -27,35 +91,35 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
27
91
  - [DataGrid] Improve vertical scrolling performance (#11924) @romgrk
28
92
  - [l10n] Improve Danish (da-DK) locale (#11877) @ShahrazH
29
93
 
30
- #### `@mui/x-data-grid-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
94
+ #### `@mui/x-data-grid-pro@7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
95
 
32
96
  Same changes as in `@mui/x-data-grid@v7.0.0-beta.2`.
33
97
 
34
98
  #### `@mui/x-data-grid-premium@v7.0.0-beta.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
35
99
 
36
- Same changes as in `@mui/x-data-grid-pro@v7.0.0-beta.2`, plus:
100
+ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.2`, plus:
37
101
 
38
102
  - [DataGridPremium] Fix autosize grouping cell (#11870) @romgrk
39
103
  - [DataGridPremium] Fix clipboard paste not working with Caps Lock enabled (#11965) @shaharyar-shamshi
40
104
 
41
105
  ### Date Pickers
42
106
 
43
- #### `@mui/x-date-pickers@v7.0.0-beta.2`
107
+ #### `@mui/x-date-pickers@7.0.0-beta.2`
44
108
 
45
109
  - [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11936) @LukasTy
46
110
  - [pickers] Limit the valid values of `TDate` (#11791) @flaviendelangle
47
111
 
48
- #### `@mui/x-date-pickers-pro@v7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
112
+ #### `@mui/x-date-pickers-pro@7.0.0-beta.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
113
 
50
- Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
114
+ Same changes as in `@mui/x-date-pickers@7.0.0-beta.2`.
51
115
 
52
- ### Charts / `@mui/x-charts@v7.0.0-beta.2`
116
+ ### Charts / `@mui/x-charts@7.0.0-beta.2`
53
117
 
54
118
  - [charts] Add `reverse` property to axes (#11899) @alexfauquette
55
119
  - [charts] Allow series ids to be numbers (#11941) @alexfauquette
56
120
  - [charts] Support UTC date formatting in tooltip (#11943) @shaharyar-shamshi
57
121
 
58
- ### Tree View / `@mui/x-tree-view@v7.0.0-beta.2`
122
+ ### Tree View / `@mui/x-tree-view@7.0.0-beta.2`
59
123
 
60
124
  - [TreeView] Correctly detect if an item is expandable (#11963) @swalker326
61
125
  - [TreeView] Polish the default design & revise the simple version pages (#11529) @danilo-leal
@@ -71,7 +135,7 @@ Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
71
135
  +import { LicenseInfo } from '@mui/x-license';
72
136
  ```
73
137
 
74
- `@mui/x-license@v7.0.0-beta.2`
138
+ `@mui/x-license@7.0.0-beta.2`
75
139
 
76
140
  - [license] Rename `@mui/x-license-pro` to `@mui/x-license` (#11938) @cherniavskii
77
141
 
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { ChartsGridClasses } from './chartsGridClasses';
3
+ export interface ChartsGridProps {
4
+ /**
5
+ * Displays vertical grid.
6
+ */
7
+ vertical?: boolean;
8
+ /**
9
+ * Displays horizontal grid.
10
+ */
11
+ horizontal?: boolean;
12
+ /**
13
+ * Override or extend the styles applied to the component.
14
+ */
15
+ classes?: Partial<ChartsGridClasses>;
16
+ }
17
+ /**
18
+ * Demos:
19
+ *
20
+ * - [Axis](https://mui.com/x/react-charts/axis/)
21
+ *
22
+ * API:
23
+ *
24
+ * - [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/)
25
+ */
26
+ declare function ChartsGrid(props: ChartsGridProps): React.JSX.Element;
27
+ declare namespace ChartsGrid {
28
+ var propTypes: any;
29
+ }
30
+ export { ChartsGrid };
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ChartsGrid = ChartsGrid;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
13
+ var _styles = require("@mui/material/styles");
14
+ var _CartesianContextProvider = require("../context/CartesianContextProvider");
15
+ var _useTicks = require("../hooks/useTicks");
16
+ var _chartsGridClasses = require("./chartsGridClasses");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ const _excluded = ["vertical", "horizontal"];
19
+ 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); }
20
+ 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; }
21
+ const GridRoot = (0, _styles.styled)('g', {
22
+ name: 'MuiChartsGrid',
23
+ slot: 'Root',
24
+ overridesResolver: (props, styles) => styles.root
25
+ })(({
26
+ theme
27
+ }) => ({
28
+ [`& .${_chartsGridClasses.chartsGridClasses.line}`]: {
29
+ stroke: (theme.vars || theme).palette.divider,
30
+ shapeRendering: 'crispEdges',
31
+ strokeWidth: 1
32
+ }
33
+ }));
34
+ const useUtilityClasses = ({
35
+ classes
36
+ }) => {
37
+ const slots = {
38
+ root: ['root'],
39
+ verticalLine: ['line', 'verticalLine'],
40
+ horizontalLine: ['line', 'horizontalLine']
41
+ };
42
+ return (0, _composeClasses.default)(slots, _chartsGridClasses.getChartsGridUtilityClass, classes);
43
+ };
44
+ /**
45
+ * Demos:
46
+ *
47
+ * - [Axis](https://mui.com/x/react-charts/axis/)
48
+ *
49
+ * API:
50
+ *
51
+ * - [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/)
52
+ */
53
+ function ChartsGrid(props) {
54
+ const {
55
+ vertical,
56
+ horizontal
57
+ } = props,
58
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
59
+ const {
60
+ xAxis,
61
+ xAxisIds,
62
+ yAxis,
63
+ yAxisIds
64
+ } = React.useContext(_CartesianContextProvider.CartesianContext);
65
+ const classes = useUtilityClasses(props);
66
+ const horizontalAxisId = yAxisIds[0];
67
+ const verticalAxisId = xAxisIds[0];
68
+ const {
69
+ scale: xScale,
70
+ tickNumber: xTickNumber,
71
+ tickInterval: xTickInterval
72
+ } = xAxis[verticalAxisId];
73
+ const {
74
+ scale: yScale,
75
+ tickNumber: yTickNumber,
76
+ tickInterval: yTickInterval
77
+ } = yAxis[horizontalAxisId];
78
+ const xTicks = (0, _useTicks.useTicks)({
79
+ scale: xScale,
80
+ tickNumber: xTickNumber,
81
+ tickInterval: xTickInterval
82
+ });
83
+ const yTicks = (0, _useTicks.useTicks)({
84
+ scale: yScale,
85
+ tickNumber: yTickNumber,
86
+ tickInterval: yTickInterval
87
+ });
88
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridRoot, (0, _extends2.default)({}, other, {
89
+ className: classes.root,
90
+ children: [vertical && xTicks.map(({
91
+ formattedValue,
92
+ offset
93
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
94
+ y1: yScale.range()[0],
95
+ y2: yScale.range()[1],
96
+ x1: offset,
97
+ x2: offset,
98
+ className: classes.verticalLine
99
+ }, formattedValue)), horizontal && yTicks.map(({
100
+ formattedValue,
101
+ offset
102
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
103
+ y1: offset,
104
+ y2: offset,
105
+ x1: xScale.range()[0],
106
+ x2: xScale.range()[1],
107
+ className: classes.horizontalLine
108
+ }, formattedValue))]
109
+ }));
110
+ }
111
+ process.env.NODE_ENV !== "production" ? ChartsGrid.propTypes = {
112
+ // ----------------------------- Warning --------------------------------
113
+ // | These PropTypes are generated from the TypeScript type definitions |
114
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
115
+ // ----------------------------------------------------------------------
116
+ /**
117
+ * Override or extend the styles applied to the component.
118
+ */
119
+ classes: _propTypes.default.object,
120
+ /**
121
+ * Displays horizontal grid.
122
+ */
123
+ horizontal: _propTypes.default.bool,
124
+ /**
125
+ * Displays vertical grid.
126
+ */
127
+ vertical: _propTypes.default.bool
128
+ } : void 0;
@@ -0,0 +1,13 @@
1
+ export interface ChartsGridClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to every line element. */
5
+ line: string;
6
+ /** Styles applied to x-axes. */
7
+ horizontalLine: string;
8
+ /** Styles applied to y-axes. */
9
+ verticalLine: string;
10
+ }
11
+ export type ChartsGridClassKey = keyof ChartsGridClasses;
12
+ export declare function getChartsGridUtilityClass(slot: string): string;
13
+ export declare const chartsGridClasses: ChartsGridClasses;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.chartsGridClasses = void 0;
8
+ exports.getChartsGridUtilityClass = getChartsGridUtilityClass;
9
+ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
10
+ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
11
+ function getChartsGridUtilityClass(slot) {
12
+ return (0, _generateUtilityClass.default)('MuiChartsGrid', slot);
13
+ }
14
+ const chartsGridClasses = exports.chartsGridClasses = (0, _generateUtilityClasses.default)('MuiChartsGrid', ['root', 'line', 'horizontalLine', 'verticalLine']);
@@ -0,0 +1,2 @@
1
+ export * from './ChartsGrid';
2
+ export * from './chartsGridClasses';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ChartsGrid = require("./ChartsGrid");
7
+ Object.keys(_ChartsGrid).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ChartsGrid[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ChartsGrid[key];
14
+ }
15
+ });
16
+ });
17
+ var _chartsGridClasses = require("./chartsGridClasses");
18
+ Object.keys(_chartsGridClasses).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _chartsGridClasses[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _chartsGridClasses[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../esm/ChartsGrid/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
package/ChartsSurface.js CHANGED
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _useAxisEvents = require("./hooks/useAxisEvents");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className"];
15
+ const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className", "title", "desc"];
16
16
  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); }
17
17
  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; }
18
18
  const ChartChartsSurfaceStyles = (0, _styles.styled)('svg', {
@@ -25,7 +25,9 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
25
25
  width,
26
26
  height,
27
27
  viewBox,
28
- disableAxisListener = false
28
+ disableAxisListener = false,
29
+ title,
30
+ desc
29
31
  } = props,
30
32
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
31
33
  const svgView = (0, _extends2.default)({
@@ -42,9 +44,9 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
42
44
  ref: ref
43
45
  }, other, {
44
46
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
45
- children: props.title
47
+ children: title
46
48
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("desc", {
47
- children: props.desc
49
+ children: desc
48
50
  }), children]
49
51
  }));
50
52
  });
@@ -14,7 +14,7 @@ var _utils2 = require("@mui/utils");
14
14
  var _styles = require("@mui/material/styles");
15
15
  var _CartesianContextProvider = require("../context/CartesianContextProvider");
16
16
  var _DrawingProvider = require("../context/DrawingProvider");
17
- var _useTicks = _interopRequireDefault(require("../hooks/useTicks"));
17
+ var _useTicks = require("../hooks/useTicks");
18
18
  var _axisClasses = require("../ChartsAxis/axisClasses");
19
19
  var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
20
20
  var _ChartsText = require("../ChartsText");
@@ -180,7 +180,7 @@ function ChartsXAxis(inProps) {
180
180
  className: classes.tickLabel,
181
181
  ownerState: {}
182
182
  });
183
- const xTicks = (0, _useTicks.default)({
183
+ const xTicks = (0, _useTicks.useTicks)({
184
184
  scale: xScale,
185
185
  tickNumber,
186
186
  valueFormatter,
@@ -14,7 +14,7 @@ var _utils2 = require("@mui/utils");
14
14
  var _styles = require("@mui/material/styles");
15
15
  var _CartesianContextProvider = require("../context/CartesianContextProvider");
16
16
  var _DrawingProvider = require("../context/DrawingProvider");
17
- var _useTicks = _interopRequireDefault(require("../hooks/useTicks"));
17
+ var _useTicks = require("../hooks/useTicks");
18
18
  var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
19
19
  var _ChartsText = require("../ChartsText");
20
20
  var _axisClasses = require("../ChartsAxis/axisClasses");
@@ -100,7 +100,7 @@ function ChartsYAxis(inProps) {
100
100
  height
101
101
  } = React.useContext(_DrawingProvider.DrawingContext);
102
102
  const tickSize = disableTicks ? 4 : tickSizeProp;
103
- const yTicks = (0, _useTicks.default)({
103
+ const yTicks = (0, _useTicks.useTicks)({
104
104
  scale: yScale,
105
105
  tickNumber,
106
106
  valueFormatter
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { GaugeContainerProps } from './GaugeContainer';
3
+ import { GaugeClasses } from './gaugeClasses';
4
+ import { GaugeValueTextProps } from './GaugeValueText';
5
+ export interface GaugeProps extends GaugeContainerProps, Pick<GaugeValueTextProps, 'text'> {
6
+ classes?: Partial<GaugeClasses>;
7
+ children?: React.ReactNode;
8
+ }
9
+ declare function Gauge(props: GaugeProps): React.JSX.Element;
10
+ declare namespace Gauge {
11
+ var propTypes: any;
12
+ }
13
+ export { Gauge };