@mui/x-charts 7.18.0 → 7.19.0

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 (74) hide show
  1. package/BarChart/BarElement.d.ts +1 -1
  2. package/BarChart/BarLabel/BarLabel.d.ts +1 -1
  3. package/BarChart/formatter.js +5 -4
  4. package/CHANGELOG.md +110 -0
  5. package/ChartContainer/useDefaultizeAxis.d.ts +4 -4
  6. package/ChartContainer/useDefaultizeAxis.js +1 -1
  7. package/ChartsAxis/ChartsAxis.js +4 -4
  8. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -1
  9. package/ChartsGrid/styledCommonents.d.ts +2 -2
  10. package/ChartsLegend/DefaultChartsLegend.js +1 -1
  11. package/ChartsLegend/LegendPerItem.d.ts +1 -1
  12. package/ChartsLegend/LegendPerItem.js +1 -1
  13. package/ChartsLegend/PiecewiseColorLegend.js +1 -1
  14. package/ChartsReferenceLine/common.d.ts +1 -1
  15. package/ChartsTooltip/ChartsTooltipTable.d.ts +5 -5
  16. package/LineChart/AnimatedArea.d.ts +1 -1
  17. package/LineChart/AnimatedArea.js +9 -45
  18. package/LineChart/AnimatedLine.d.ts +1 -1
  19. package/LineChart/AnimatedLine.js +9 -36
  20. package/LineChart/AppearingMask.d.ts +12 -0
  21. package/LineChart/AppearingMask.js +42 -0
  22. package/LineChart/formatter.js +5 -5
  23. package/ResponsiveChartContainer/ResizableContainer.d.ts +1 -1
  24. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +1 -1
  25. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  26. package/context/CartesianProvider/defaultizeAxis.d.ts +4 -4
  27. package/context/PluginProvider/mergePlugins.d.ts +6 -6
  28. package/context/ZAxisContextProvider.js +1 -1
  29. package/hooks/useReducedMotion.js +2 -2
  30. package/hooks/useSeries.d.ts +4 -4
  31. package/hooks/useSeries.js +4 -4
  32. package/index.js +1 -1
  33. package/internals/components/AxisSharedComponents.d.ts +1 -1
  34. package/internals/configInit.d.ts +1 -1
  35. package/internals/defaultizeColor.d.ts +8 -8
  36. package/internals/domUtils.js +1 -1
  37. package/internals/geometry.js +3 -5
  38. package/internals/getPercentageValue.js +1 -1
  39. package/models/seriesType/line.d.ts +5 -0
  40. package/modern/BarChart/formatter.js +5 -4
  41. package/modern/ChartContainer/useDefaultizeAxis.js +1 -1
  42. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  43. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -1
  44. package/modern/ChartsLegend/LegendPerItem.js +1 -1
  45. package/modern/ChartsLegend/PiecewiseColorLegend.js +1 -1
  46. package/modern/LineChart/AnimatedArea.js +9 -45
  47. package/modern/LineChart/AnimatedLine.js +9 -36
  48. package/modern/LineChart/AppearingMask.js +42 -0
  49. package/modern/LineChart/formatter.js +5 -5
  50. package/modern/context/ZAxisContextProvider.js +1 -1
  51. package/modern/hooks/useReducedMotion.js +2 -2
  52. package/modern/hooks/useSeries.js +4 -4
  53. package/modern/index.js +1 -1
  54. package/modern/internals/domUtils.js +1 -1
  55. package/modern/internals/geometry.js +3 -5
  56. package/modern/internals/getPercentageValue.js +1 -1
  57. package/node/BarChart/formatter.js +5 -4
  58. package/node/ChartContainer/useDefaultizeAxis.js +1 -1
  59. package/node/ChartsAxis/ChartsAxis.js +4 -4
  60. package/node/ChartsLegend/DefaultChartsLegend.js +1 -1
  61. package/node/ChartsLegend/LegendPerItem.js +1 -1
  62. package/node/ChartsLegend/PiecewiseColorLegend.js +1 -1
  63. package/node/LineChart/AnimatedArea.js +8 -44
  64. package/node/LineChart/AnimatedLine.js +8 -35
  65. package/node/LineChart/AppearingMask.js +48 -0
  66. package/node/LineChart/formatter.js +5 -5
  67. package/node/context/ZAxisContextProvider.js +1 -1
  68. package/node/hooks/useReducedMotion.js +2 -2
  69. package/node/hooks/useSeries.js +4 -4
  70. package/node/index.js +1 -1
  71. package/node/internals/domUtils.js +1 -1
  72. package/node/internals/geometry.js +3 -5
  73. package/node/internals/getPercentageValue.js +1 -1
  74. package/package.json +2 -2
@@ -34,7 +34,7 @@ function useSeries() {
34
34
  * The returned object contains:
35
35
  * - series: a mapping from ids to series attributes.
36
36
  * - seriesOrder: the array of series ids.
37
- * @returns { series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined pieSeries
37
+ * @returns {{ series: Record<SeriesId, DefaultizedPieSeriesType>; seriesOrder: SeriesId[]; } | undefined} pieSeries
38
38
  */
39
39
  function usePieSeries() {
40
40
  const series = useSeries();
@@ -46,7 +46,7 @@ function usePieSeries() {
46
46
  * The returned object contains:
47
47
  * - series: a mapping from ids to series attributes.
48
48
  * - seriesOrder: the array of series ids.
49
- * @returns { series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined lineSeries
49
+ * @returns {{ series: Record<SeriesId, DefaultizedLineSeriesType>; seriesOrder: SeriesId[]; } | undefined} lineSeries
50
50
  */
51
51
  function useLineSeries() {
52
52
  const series = useSeries();
@@ -58,7 +58,7 @@ function useLineSeries() {
58
58
  * The returned object contains:
59
59
  * - series: a mapping from ids to series attributes.
60
60
  * - seriesOrder: the array of series ids.
61
- * @returns { series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined barSeries
61
+ * @returns {{ series: Record<SeriesId, DefaultizedBarSeriesType>; seriesOrder: SeriesId[]; } | undefined} barSeries
62
62
  */
63
63
  function useBarSeries() {
64
64
  const series = useSeries();
@@ -70,7 +70,7 @@ function useBarSeries() {
70
70
  * The returned object contains:
71
71
  * - series: a mapping from ids to series attributes.
72
72
  * - seriesOrder: the array of series ids.
73
- * @returns { series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined scatterSeries
73
+ * @returns {{ series: Record<SeriesId, DefaultizedScatterSeriesType>; seriesOrder: SeriesId[]; } | undefined} scatterSeries
74
74
  */
75
75
  function useScatterSeries() {
76
76
  const series = useSeries();
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.18.0
2
+ * @mui/x-charts v7.19.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -122,7 +122,7 @@ const getStringSize = (text, style = {}) => {
122
122
  measurementSpan.textContent = '';
123
123
  }, 0);
124
124
  return result;
125
- } catch (e) {
125
+ } catch {
126
126
  return {
127
127
  width: 0,
128
128
  height: 0
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getMinXTranslation = getMinXTranslation;
7
+ var _warning = require("@mui/x-internals/warning");
7
8
  const ANGLE_APPROX = 5; // Angle (in deg) for which we approximate the rectangle as perfectly horizontal/vertical
8
9
 
9
- let warnedOnce = false;
10
-
11
10
  /**
12
11
  * Return the minimal translation along the x-axis to avoid overflow of a rectangle of a given width, height, and rotation.
13
12
  * This assumes that all rectangles have the same height and angle between -90 and 90.
@@ -18,9 +17,8 @@ let warnedOnce = false;
18
17
  */
19
18
  function getMinXTranslation(width, height, angle = 0) {
20
19
  if (process.env.NODE_ENV !== 'production') {
21
- if (!warnedOnce && angle > 90 && angle < -90) {
22
- warnedOnce = true;
23
- console.warn([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`].join('\n'));
20
+ if (angle > 90 && angle < -90) {
21
+ (0, _warning.warnOnce)([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`]);
24
22
  }
25
23
  }
26
24
  const standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
@@ -30,5 +30,5 @@ function getPercentageValue(value, refValue) {
30
30
  return val;
31
31
  }
32
32
  }
33
- throw Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
33
+ throw new Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.18.0",
3
+ "version": "7.19.0",
4
4
  "description": "The community edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -35,7 +35,7 @@
35
35
  "@react-spring/web": "^9.7.4",
36
36
  "clsx": "^2.1.1",
37
37
  "prop-types": "^15.8.1",
38
- "@mui/x-charts-vendor": "7.18.0",
38
+ "@mui/x-charts-vendor": "7.19.0",
39
39
  "@mui/x-internals": "7.18.0"
40
40
  },
41
41
  "peerDependencies": {