@mui/x-charts 8.5.3 → 8.6.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 (104) hide show
  1. package/BarChart/AnimatedBarElement.js +3 -1
  2. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
  3. package/BarChart/BarLabel/BarLabelPlot.js +33 -25
  4. package/BarChart/BarPlot.js +55 -40
  5. package/BarChart/barClasses.d.ts +12 -0
  6. package/BarChart/barClasses.js +25 -0
  7. package/BarChart/index.d.ts +3 -1
  8. package/BarChart/index.js +23 -1
  9. package/BarChart/types.d.ts +5 -1
  10. package/CHANGELOG.md +107 -0
  11. package/ChartsLegend/ChartsLegend.js +1 -0
  12. package/ChartsXAxis/ChartsXAxis.js +4 -108
  13. package/ChartsXAxis/getVisibleLabels.d.ts +14 -0
  14. package/ChartsXAxis/getVisibleLabels.js +71 -0
  15. package/ChartsXAxis/shortenLabels.d.ts +4 -0
  16. package/ChartsXAxis/shortenLabels.js +48 -0
  17. package/ChartsYAxis/ChartsYAxis.js +2 -39
  18. package/ChartsYAxis/shortenLabels.d.ts +4 -0
  19. package/ChartsYAxis/shortenLabels.js +46 -0
  20. package/LineChart/AnimatedArea.js +4 -1
  21. package/LineChart/AnimatedLine.js +4 -1
  22. package/LineChart/CircleMarkElement.js +4 -1
  23. package/LineChart/MarkElement.js +4 -1
  24. package/LineChart/MarkPlot.js +1 -0
  25. package/PieChart/PieArc.js +3 -1
  26. package/PieChart/PiePlot.js +6 -0
  27. package/PieChart/index.d.ts +3 -1
  28. package/PieChart/index.js +18 -1
  29. package/PieChart/pieClasses.d.ts +12 -0
  30. package/PieChart/pieClasses.js +24 -0
  31. package/Toolbar/ToolbarButton.js +2 -0
  32. package/esm/BarChart/AnimatedBarElement.js +3 -1
  33. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
  34. package/esm/BarChart/BarLabel/BarLabelPlot.js +33 -25
  35. package/esm/BarChart/BarPlot.js +55 -40
  36. package/esm/BarChart/barClasses.d.ts +12 -0
  37. package/esm/BarChart/barClasses.js +15 -0
  38. package/esm/BarChart/index.d.ts +3 -1
  39. package/esm/BarChart/index.js +2 -1
  40. package/esm/BarChart/types.d.ts +5 -1
  41. package/esm/ChartsLegend/ChartsLegend.js +1 -0
  42. package/esm/ChartsXAxis/ChartsXAxis.js +2 -106
  43. package/esm/ChartsXAxis/getVisibleLabels.d.ts +14 -0
  44. package/esm/ChartsXAxis/getVisibleLabels.js +67 -0
  45. package/esm/ChartsXAxis/shortenLabels.d.ts +4 -0
  46. package/esm/ChartsXAxis/shortenLabels.js +42 -0
  47. package/esm/ChartsYAxis/ChartsYAxis.js +1 -38
  48. package/esm/ChartsYAxis/shortenLabels.d.ts +4 -0
  49. package/esm/ChartsYAxis/shortenLabels.js +41 -0
  50. package/esm/LineChart/AnimatedArea.js +4 -1
  51. package/esm/LineChart/AnimatedLine.js +4 -1
  52. package/esm/LineChart/CircleMarkElement.js +4 -1
  53. package/esm/LineChart/MarkElement.js +4 -1
  54. package/esm/LineChart/MarkPlot.js +1 -0
  55. package/esm/PieChart/PieArc.js +3 -1
  56. package/esm/PieChart/PiePlot.js +6 -0
  57. package/esm/PieChart/index.d.ts +3 -1
  58. package/esm/PieChart/index.js +2 -1
  59. package/esm/PieChart/pieClasses.d.ts +12 -0
  60. package/esm/PieChart/pieClasses.js +15 -0
  61. package/esm/Toolbar/ToolbarButton.js +2 -0
  62. package/esm/index.js +1 -1
  63. package/esm/internals/components/NotRendered.d.ts +9 -0
  64. package/esm/internals/components/NotRendered.js +10 -0
  65. package/esm/internals/index.d.ts +1 -0
  66. package/esm/internals/index.js +1 -0
  67. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +30 -2
  68. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +8 -2
  69. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +20 -4
  70. package/esm/locales/enUS.d.ts +3 -0
  71. package/esm/locales/enUS.js +8 -2
  72. package/esm/locales/frFR.d.ts +3 -0
  73. package/esm/locales/frFR.js +7 -0
  74. package/esm/locales/ptBR.d.ts +3 -0
  75. package/esm/locales/ptBR.js +7 -1
  76. package/esm/locales/ptPT.d.ts +3 -0
  77. package/esm/locales/ptPT.js +7 -1
  78. package/esm/locales/utils/chartsLocaleTextApi.d.ts +17 -0
  79. package/esm/locales/utils/getChartsLocalization.d.ts +3 -0
  80. package/esm/locales/utils/imageMimeTypes.d.ts +2 -0
  81. package/esm/locales/utils/imageMimeTypes.js +5 -0
  82. package/esm/models/slots/chartsBaseSlotProps.d.ts +4 -0
  83. package/index.js +1 -1
  84. package/internals/components/NotRendered.d.ts +9 -0
  85. package/internals/components/NotRendered.js +16 -0
  86. package/internals/index.d.ts +1 -0
  87. package/internals/index.js +12 -0
  88. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +30 -2
  89. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +8 -2
  90. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +20 -4
  91. package/locales/enUS.d.ts +3 -0
  92. package/locales/enUS.js +8 -2
  93. package/locales/frFR.d.ts +3 -0
  94. package/locales/frFR.js +7 -0
  95. package/locales/ptBR.d.ts +3 -0
  96. package/locales/ptBR.js +7 -1
  97. package/locales/ptPT.d.ts +3 -0
  98. package/locales/ptPT.js +7 -1
  99. package/locales/utils/chartsLocaleTextApi.d.ts +17 -0
  100. package/locales/utils/getChartsLocalization.d.ts +3 -0
  101. package/locales/utils/imageMimeTypes.d.ts +2 -0
  102. package/locales/utils/imageMimeTypes.js +11 -0
  103. package/models/slots/chartsBaseSlotProps.d.ts +4 -0
  104. package/package.json +2 -2
package/locales/enUS.js CHANGED
@@ -4,15 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.enUSLocaleText = exports.enUS = exports.DEFAULT_LOCALE = void 0;
7
+ var _imageMimeTypes = require("./utils/imageMimeTypes");
7
8
  var _getChartsLocalization = require("./utils/getChartsLocalization");
8
9
  // This object is not Partial<ChartsLocaleText> because it is the default values
9
10
 
10
11
  const enUSLocaleText = exports.enUSLocaleText = {
11
- // Overlay
12
+ /* Overlay */
12
13
  loading: 'Loading data…',
13
14
  noData: 'No data to display',
15
+ /* Toolbar */
14
16
  zoomIn: 'Zoom in',
15
- zoomOut: 'Zoom out'
17
+ zoomOut: 'Zoom out',
18
+ toolbarExport: 'Export',
19
+ /* Toolbar Export Menu */
20
+ toolbarExportPrint: 'Print',
21
+ toolbarExportImage: mimeType => `Export as ${_imageMimeTypes.imageMimeTypes[mimeType] ?? mimeType}`
16
22
  };
17
23
  const DEFAULT_LOCALE = exports.DEFAULT_LOCALE = enUSLocaleText;
18
24
  const enUS = exports.enUS = (0, _getChartsLocalization.getChartsLocalization)(enUSLocaleText);
package/locales/frFR.d.ts CHANGED
@@ -9,6 +9,9 @@ export declare const frFR: {
9
9
  noData?: string | undefined;
10
10
  zoomIn?: string | undefined;
11
11
  zoomOut?: string | undefined;
12
+ toolbarExport?: string | undefined;
13
+ toolbarExportPrint?: string | undefined;
14
+ toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
12
15
  };
13
16
  };
14
17
  };
package/locales/frFR.js CHANGED
@@ -9,7 +9,14 @@ const frFRLocalText = exports.frFRLocalText = {
9
9
  // Overlay
10
10
  loading: 'Chargement…',
11
11
  noData: 'Pas de données'
12
+
13
+ // Toolbar
12
14
  // zoomIn: 'Zoom in',
13
15
  // zoomOut: 'Zoom out',
16
+ // toolbarExport: 'Export',
17
+
18
+ // Toolbar Export Menu
19
+ // toolbarExportPrint: 'Print',
20
+ // toolbarExportImage: mimeType => `Export as ${imageMimeTypes[mimeType] ?? mimeType}`,
14
21
  };
15
22
  const frFR = exports.frFR = (0, _getChartsLocalization.getChartsLocalization)(frFRLocalText);
package/locales/ptBR.d.ts CHANGED
@@ -9,6 +9,9 @@ export declare const ptBR: {
9
9
  noData?: string | undefined;
10
10
  zoomIn?: string | undefined;
11
11
  zoomOut?: string | undefined;
12
+ toolbarExport?: string | undefined;
13
+ toolbarExportPrint?: string | undefined;
14
+ toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
12
15
  };
13
16
  };
14
17
  };
package/locales/ptBR.js CHANGED
@@ -4,12 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ptBRLocaleText = exports.ptBR = void 0;
7
+ var _imageMimeTypes = require("./utils/imageMimeTypes");
7
8
  var _getChartsLocalization = require("./utils/getChartsLocalization");
8
9
  const ptBRLocaleText = exports.ptBRLocaleText = {
9
10
  // Overlay
10
11
  loading: 'Carregando dados…',
11
12
  noData: 'Sem dados para exibir',
13
+ // Toolbar
12
14
  zoomIn: 'Aumentar zoom',
13
- zoomOut: 'Diminuir zoom'
15
+ zoomOut: 'Diminuir zoom',
16
+ toolbarExport: 'Exportar',
17
+ // Toolbar Export Menu
18
+ toolbarExportPrint: 'Imprimir',
19
+ toolbarExportImage: mimeType => `Exportar como ${_imageMimeTypes.imageMimeTypes[mimeType] ?? mimeType}`
14
20
  };
15
21
  const ptBR = exports.ptBR = (0, _getChartsLocalization.getChartsLocalization)(ptBRLocaleText);
package/locales/ptPT.d.ts CHANGED
@@ -9,6 +9,9 @@ export declare const ptPT: {
9
9
  noData?: string | undefined;
10
10
  zoomIn?: string | undefined;
11
11
  zoomOut?: string | undefined;
12
+ toolbarExport?: string | undefined;
13
+ toolbarExportPrint?: string | undefined;
14
+ toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
12
15
  };
13
16
  };
14
17
  };
package/locales/ptPT.js CHANGED
@@ -4,12 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ptPTLocaleText = exports.ptPT = void 0;
7
+ var _imageMimeTypes = require("./utils/imageMimeTypes");
7
8
  var _getChartsLocalization = require("./utils/getChartsLocalization");
8
9
  const ptPTLocaleText = exports.ptPTLocaleText = {
9
10
  // Overlay
10
11
  loading: 'Carregando dados…',
11
12
  noData: 'Sem dados para mostrar',
13
+ // Toolbar
12
14
  zoomIn: 'Aumentar zoom',
13
- zoomOut: 'Diminuir zoom'
15
+ zoomOut: 'Diminuir zoom',
16
+ toolbarExport: 'Exportar',
17
+ // Toolbar Export Menu
18
+ toolbarExportPrint: 'Imprimir',
19
+ toolbarExportImage: mimeType => `Exportar como ${_imageMimeTypes.imageMimeTypes[mimeType] ?? mimeType}`
14
20
  };
15
21
  const ptPT = exports.ptPT = (0, _getChartsLocalization.getChartsLocalization)(ptPTLocaleText);
@@ -1,3 +1,4 @@
1
+ import { ChartImageExportMimeType } from "./imageMimeTypes.js";
1
2
  export interface ChartsLocaleText {
2
3
  /**
3
4
  * Title displayed in the overlay if `loading` is `true`.
@@ -15,5 +16,21 @@ export interface ChartsLocaleText {
15
16
  * Tooltip text shown when hovering over the zoom out button.
16
17
  */
17
18
  zoomOut: string;
19
+ /**
20
+ * Text for the export button tooltip in the toolbar.
21
+ */
22
+ toolbarExport: string;
23
+ /**
24
+ * Text for the print button in the toolbar's export menu.
25
+ */
26
+ toolbarExportPrint: string;
27
+ /**
28
+ * Text for an "Export as {image type}" button in the toolbar's export menu.
29
+ * The only format supported in all browsers is 'image/png'.
30
+ *
31
+ * @param {string} mimeType The MIME type of the image to export, e.g., 'image/png'.
32
+ * @returns {string} The localized string for an export image button.
33
+ */
34
+ toolbarExportImage: (mimeType: ChartImageExportMimeType | (string & {})) => string;
18
35
  }
19
36
  export type ChartsTranslationKeys = keyof ChartsLocaleText;
@@ -13,6 +13,9 @@ export declare const getChartsLocalization: (chartsTranslations: Partial<ChartsL
13
13
  noData?: string | undefined;
14
14
  zoomIn?: string | undefined;
15
15
  zoomOut?: string | undefined;
16
+ toolbarExport?: string | undefined;
17
+ toolbarExportPrint?: string | undefined;
18
+ toolbarExportImage?: ((mimeType: import("./imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
16
19
  };
17
20
  };
18
21
  };
@@ -0,0 +1,2 @@
1
+ export declare const imageMimeTypes: Record<string, string | undefined>;
2
+ export type ChartImageExportMimeType = 'image/png' | 'image/jpeg' | 'image/webp';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.imageMimeTypes = void 0;
7
+ const imageMimeTypes = exports.imageMimeTypes = {
8
+ 'image/png': 'PNG',
9
+ 'image/jpeg': 'JPEG',
10
+ 'image/webp': 'WebP'
11
+ };
@@ -7,14 +7,18 @@ export type ChartBaseCommonProps<T = HTMLElement> = React.DOMAttributes<T> & {
7
7
  };
8
8
  export type ChartBaseIconProps = ChartBaseCommonProps<SVGSVGElement> & {
9
9
  titleAccess?: string;
10
+ fontSize?: 'small' | 'medium' | 'large' | 'inherit';
10
11
  };
11
12
  export type ChartBaseButtonProps = ChartBaseCommonProps & {
12
13
  ref?: React.Ref<HTMLButtonElement>;
14
+ id?: string;
13
15
  disabled?: boolean;
14
16
  tabIndex?: number;
15
17
  };
16
18
  export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
17
19
  ref?: React.Ref<HTMLButtonElement>;
20
+ id?: string;
18
21
  disabled?: boolean;
19
22
  tabIndex?: number;
23
+ size?: 'small' | 'medium' | 'large';
20
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "8.5.3",
3
+ "version": "8.6.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
6
  "main": "./index.js",
@@ -37,7 +37,7 @@
37
37
  "reselect": "^5.1.1",
38
38
  "use-sync-external-store": "^1.5.0",
39
39
  "@mui/x-charts-vendor": "8.5.3",
40
- "@mui/x-internals": "8.5.3"
40
+ "@mui/x-internals": "8.6.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@emotion/react": "^11.9.0",