@mui/x-charts-pro 8.27.5 → 8.28.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 (86) hide show
  1. package/BarChartPro/BarChartPro.js +2 -2
  2. package/CHANGELOG.md +78 -0
  3. package/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
  4. package/FunnelChart/FunnelPlot.js +8 -3
  5. package/FunnelChart/FunnelSection.js +7 -3
  6. package/FunnelChart/FunnelSectionLabel.d.ts +6 -0
  7. package/FunnelChart/FunnelSectionLabel.js +18 -5
  8. package/FunnelChart/funnelClasses.d.ts +29 -0
  9. package/FunnelChart/funnelClasses.js +29 -0
  10. package/FunnelChart/funnelSectionClasses.d.ts +13 -0
  11. package/FunnelChart/funnelSectionClasses.js +19 -0
  12. package/FunnelChart/index.d.ts +2 -0
  13. package/FunnelChart/index.js +8 -0
  14. package/Heatmap/Heatmap.js +2 -2
  15. package/Heatmap/HeatmapCell.d.ts +34 -0
  16. package/Heatmap/HeatmapCell.js +64 -0
  17. package/Heatmap/HeatmapItem.d.ts +1 -8
  18. package/Heatmap/HeatmapItem.js +4 -19
  19. package/Heatmap/heatmapClasses.d.ts +6 -1
  20. package/Heatmap/heatmapClasses.js +18 -3
  21. package/Heatmap/index.d.ts +4 -2
  22. package/Heatmap/index.js +17 -13
  23. package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
  24. package/LineChartPro/LineChartPro.js +2 -2
  25. package/SankeyChart/SankeyLinkElement.js +4 -2
  26. package/SankeyChart/SankeyLinkLabel.js +3 -0
  27. package/SankeyChart/SankeyNodeElement.d.ts +1 -1
  28. package/SankeyChart/SankeyNodeElement.js +5 -3
  29. package/SankeyChart/SankeyNodeLabel.js +3 -0
  30. package/SankeyChart/SankeyPlot.js +2 -2
  31. package/SankeyChart/index.d.ts +2 -1
  32. package/SankeyChart/index.js +7 -0
  33. package/SankeyChart/sankeyClasses.d.ts +27 -6
  34. package/SankeyChart/sankeyClasses.js +27 -8
  35. package/ScatterChartPro/ScatterChartPro.js +2 -2
  36. package/esm/BarChartPro/BarChartPro.js +2 -2
  37. package/esm/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
  38. package/esm/FunnelChart/FunnelPlot.js +8 -3
  39. package/esm/FunnelChart/FunnelSection.js +9 -5
  40. package/esm/FunnelChart/FunnelSectionLabel.d.ts +6 -0
  41. package/esm/FunnelChart/FunnelSectionLabel.js +20 -7
  42. package/esm/FunnelChart/funnelClasses.d.ts +29 -0
  43. package/esm/FunnelChart/funnelClasses.js +19 -0
  44. package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
  45. package/esm/FunnelChart/funnelSectionClasses.js +20 -0
  46. package/esm/FunnelChart/index.d.ts +2 -0
  47. package/esm/FunnelChart/index.js +1 -0
  48. package/esm/Heatmap/Heatmap.js +2 -2
  49. package/esm/Heatmap/HeatmapCell.d.ts +34 -0
  50. package/esm/Heatmap/HeatmapCell.js +58 -0
  51. package/esm/Heatmap/HeatmapItem.d.ts +1 -8
  52. package/esm/Heatmap/HeatmapItem.js +4 -19
  53. package/esm/Heatmap/heatmapClasses.d.ts +6 -1
  54. package/esm/Heatmap/heatmapClasses.js +16 -2
  55. package/esm/Heatmap/index.d.ts +4 -2
  56. package/esm/Heatmap/index.js +2 -1
  57. package/esm/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
  58. package/esm/LineChartPro/LineChartPro.js +2 -2
  59. package/esm/SankeyChart/SankeyLinkElement.js +4 -2
  60. package/esm/SankeyChart/SankeyLinkLabel.js +3 -0
  61. package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
  62. package/esm/SankeyChart/SankeyNodeElement.js +5 -3
  63. package/esm/SankeyChart/SankeyNodeLabel.js +3 -0
  64. package/esm/SankeyChart/SankeyPlot.js +2 -2
  65. package/esm/SankeyChart/index.d.ts +2 -1
  66. package/esm/SankeyChart/index.js +1 -1
  67. package/esm/SankeyChart/sankeyClasses.d.ts +27 -6
  68. package/esm/SankeyChart/sankeyClasses.js +25 -6
  69. package/esm/ScatterChartPro/ScatterChartPro.js +2 -2
  70. package/esm/index.js +1 -1
  71. package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
  72. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
  73. package/esm/themeAugmentation/components.d.ts +19 -1
  74. package/esm/themeAugmentation/overrides.d.ts +5 -2
  75. package/esm/themeAugmentation/props.d.ts +8 -0
  76. package/index.js +1 -1
  77. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
  78. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
  79. package/package.json +3 -3
  80. package/themeAugmentation/components.d.ts +19 -1
  81. package/themeAugmentation/overrides.d.ts +5 -2
  82. package/themeAugmentation/props.d.ts +8 -0
  83. package/Heatmap/internals/HeatmapCell.d.ts +0 -21
  84. package/Heatmap/internals/HeatmapCell.js +0 -18
  85. package/esm/Heatmap/internals/HeatmapCell.d.ts +0 -21
  86. package/esm/Heatmap/internals/HeatmapCell.js +0 -12
@@ -1,6 +1,9 @@
1
- import { type HeatmapClassKey } from "../Heatmap/index.js";
1
+ import { type FunnelClasses } from "../FunnelChart/index.js";
2
+ type ExtractSafe<T, U extends T> = T extends U ? T : never;
2
3
  export interface ChartsProComponentNameToClassKey {
3
- MuiHeatmap: HeatmapClassKey;
4
+ MuiFunnelChart: ExtractSafe<keyof FunnelClasses, 'section' | 'sectionLabel'>;
5
+ MuiHeatmapPlot: 'root';
6
+ MuiSankeyPlot: 'root';
4
7
  }
5
8
  declare module '@mui/material/styles' {
6
9
  interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {}
@@ -2,11 +2,19 @@ import { type ScatterChartProProps } from "../ScatterChartPro/index.js";
2
2
  import { type BarChartProProps } from "../BarChartPro/index.js";
3
3
  import { type HeatmapProps } from "../Heatmap/Heatmap.js";
4
4
  import { type LineChartProProps } from "../LineChartPro/index.js";
5
+ import { type FunnelChartProps } from "../FunnelChart/index.js";
6
+ import { type FunnelSectionProps } from "../FunnelChart/FunnelSection.js";
7
+ import { type FunnelSectionLabelProps } from "../FunnelChart/FunnelSectionLabel.js";
8
+ import { type SankeyChartProps } from "../SankeyChart/SankeyChart.js";
5
9
  export interface ChartsProComponentsPropsList {
6
10
  MuiBarChartPro: BarChartProProps;
7
11
  MuiLineChartPro: LineChartProProps;
8
12
  MuiHeatmap: HeatmapProps;
9
13
  MuiScatterChartPro: ScatterChartProProps;
14
+ MuiFunnelChart: FunnelChartProps;
15
+ MuiFunnelSection: FunnelSectionProps;
16
+ MuiFunnelSectionLabel: FunnelSectionLabelProps;
17
+ MuiSankeyChart: SankeyChartProps;
10
18
  }
11
19
  declare module '@mui/material/styles' {
12
20
  interface ComponentsPropsList extends ChartsProComponentsPropsList {}
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v8.27.5
2
+ * @mui/x-charts-pro v8.28.0
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -99,7 +99,7 @@ export type DoubleTapResetInteraction = Unpack<{
99
99
  } & AllModeProp & AllKeysProp>;
100
100
  export type BrushInteraction = Unpack<{
101
101
  type: 'brush';
102
- } & NoModeProp & NoKeysProp>;
102
+ } & AllModeProp & AllKeysProp>;
103
103
  export type AnyInteraction = {
104
104
  type: string;
105
105
  pointerMode?: InteractionMode;
@@ -22,6 +22,19 @@ const useZoomOnBrush = ({
22
22
  React.useEffect(() => {
23
23
  instance.setZoomBrushEnabled(isZoomOnBrushEnabled);
24
24
  }, [isZoomOnBrushEnabled, instance]);
25
+ React.useEffect(() => {
26
+ if (!isZoomOnBrushEnabled) {
27
+ return;
28
+ }
29
+ instance.updateZoomInteractionListeners('brush', {
30
+ requiredKeys: config.requiredKeys,
31
+ pointerMode: config.pointerMode,
32
+ pointerOptions: {
33
+ mouse: config.mouse,
34
+ touch: config.touch
35
+ }
36
+ });
37
+ }, [isZoomOnBrushEnabled, config, instance]);
25
38
 
26
39
  // Zoom on brush
27
40
  React.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-pro",
3
- "version": "8.27.5",
3
+ "version": "8.28.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Charts components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -31,10 +31,10 @@
31
31
  "@mui/utils": "^7.3.5",
32
32
  "clsx": "^2.1.1",
33
33
  "prop-types": "^15.8.1",
34
- "@mui/x-charts": "8.27.5",
34
+ "@mui/x-charts": "8.28.0",
35
35
  "@mui/x-charts-vendor": "8.26.0",
36
- "@mui/x-internal-gestures": "0.4.0",
37
36
  "@mui/x-internals": "8.26.0",
37
+ "@mui/x-internal-gestures": "0.4.0",
38
38
  "@mui/x-license": "8.26.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,5 +1,15 @@
1
1
  import { type ComponentsProps, type ComponentsOverrides } from '@mui/material/styles';
2
2
  export interface ChartsProComponents<Theme = unknown> {
3
+ MuiFunnelChart?: {
4
+ defaultProps?: ComponentsProps['MuiFunnelChart'];
5
+ styleOverrides?: ComponentsOverrides<Theme>['MuiFunnelChart'];
6
+ };
7
+ MuiFunnelSection?: {
8
+ defaultProps?: ComponentsProps['MuiFunnelSection'];
9
+ };
10
+ MuiFunnelSectionLabel?: {
11
+ defaultProps?: ComponentsProps['MuiFunnelSection'];
12
+ };
3
13
  MuiBarChartPro?: {
4
14
  defaultProps?: ComponentsProps['MuiBarChartPro'];
5
15
  };
@@ -8,11 +18,19 @@ export interface ChartsProComponents<Theme = unknown> {
8
18
  };
9
19
  MuiHeatmap?: {
10
20
  defaultProps?: ComponentsProps['MuiHeatmap'];
11
- styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmap'];
21
+ };
22
+ MuiHeatmapPlot?: {
23
+ styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmapPlot'];
12
24
  };
13
25
  MuiScatterChartPro?: {
14
26
  defaultProps?: ComponentsProps['MuiScatterChartPro'];
15
27
  };
28
+ MuiSankeyChart?: {
29
+ defaultProps?: ComponentsProps['MuiSankeyChart'];
30
+ };
31
+ MuiSankeyPlot?: {
32
+ styleOverrides?: ComponentsOverrides<Theme>['MuiSankeyPlot'];
33
+ };
16
34
  }
17
35
  declare module '@mui/material/styles' {
18
36
  interface Components<Theme = unknown> extends ChartsProComponents<Theme> {}
@@ -1,6 +1,9 @@
1
- import { type HeatmapClassKey } from "../Heatmap/index.js";
1
+ import { type FunnelClasses } from "../FunnelChart/index.js";
2
+ type ExtractSafe<T, U extends T> = T extends U ? T : never;
2
3
  export interface ChartsProComponentNameToClassKey {
3
- MuiHeatmap: HeatmapClassKey;
4
+ MuiFunnelChart: ExtractSafe<keyof FunnelClasses, 'section' | 'sectionLabel'>;
5
+ MuiHeatmapPlot: 'root';
6
+ MuiSankeyPlot: 'root';
4
7
  }
5
8
  declare module '@mui/material/styles' {
6
9
  interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {}
@@ -2,11 +2,19 @@ import { type ScatterChartProProps } from "../ScatterChartPro/index.js";
2
2
  import { type BarChartProProps } from "../BarChartPro/index.js";
3
3
  import { type HeatmapProps } from "../Heatmap/Heatmap.js";
4
4
  import { type LineChartProProps } from "../LineChartPro/index.js";
5
+ import { type FunnelChartProps } from "../FunnelChart/index.js";
6
+ import { type FunnelSectionProps } from "../FunnelChart/FunnelSection.js";
7
+ import { type FunnelSectionLabelProps } from "../FunnelChart/FunnelSectionLabel.js";
8
+ import { type SankeyChartProps } from "../SankeyChart/SankeyChart.js";
5
9
  export interface ChartsProComponentsPropsList {
6
10
  MuiBarChartPro: BarChartProProps;
7
11
  MuiLineChartPro: LineChartProProps;
8
12
  MuiHeatmap: HeatmapProps;
9
13
  MuiScatterChartPro: ScatterChartProProps;
14
+ MuiFunnelChart: FunnelChartProps;
15
+ MuiFunnelSection: FunnelSectionProps;
16
+ MuiFunnelSectionLabel: FunnelSectionLabelProps;
17
+ MuiSankeyChart: SankeyChartProps;
10
18
  }
11
19
  declare module '@mui/material/styles' {
12
20
  interface ComponentsPropsList extends ChartsProComponentsPropsList {}
@@ -1,21 +0,0 @@
1
- import type * as React from 'react';
2
- import type { SeriesId } from '@mui/x-charts/models';
3
- import type { HeatmapClasses } from "../heatmapClasses.js";
4
- export interface HeatmapItemOwnerState {
5
- seriesId: SeriesId;
6
- dataIndex: number;
7
- color: string;
8
- isFaded: boolean;
9
- isHighlighted: boolean;
10
- classes?: Partial<HeatmapClasses>;
11
- }
12
- export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
13
- x: number;
14
- y: number;
15
- width: number;
16
- height: number;
17
- ownerState: HeatmapItemOwnerState;
18
- }
19
- export declare const HeatmapCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
20
- ownerState: HeatmapItemOwnerState;
21
- }, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.HeatmapCell = void 0;
7
- var _styles = require("@mui/material/styles");
8
- const HeatmapCell = exports.HeatmapCell = (0, _styles.styled)('rect', {
9
- name: 'MuiHeatmap',
10
- slot: 'Cell',
11
- overridesResolver: (_, styles) => styles.arc // FIXME: Inconsistent naming with slot
12
- })(({
13
- ownerState
14
- }) => ({
15
- filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
16
- fill: ownerState.color,
17
- shapeRendering: 'crispEdges'
18
- }));
@@ -1,21 +0,0 @@
1
- import type * as React from 'react';
2
- import type { SeriesId } from '@mui/x-charts/models';
3
- import type { HeatmapClasses } from "../heatmapClasses.js";
4
- export interface HeatmapItemOwnerState {
5
- seriesId: SeriesId;
6
- dataIndex: number;
7
- color: string;
8
- isFaded: boolean;
9
- isHighlighted: boolean;
10
- classes?: Partial<HeatmapClasses>;
11
- }
12
- export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
13
- x: number;
14
- y: number;
15
- width: number;
16
- height: number;
17
- ownerState: HeatmapItemOwnerState;
18
- }
19
- export declare const HeatmapCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
20
- ownerState: HeatmapItemOwnerState;
21
- }, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
@@ -1,12 +0,0 @@
1
- import { styled } from '@mui/material/styles';
2
- export const HeatmapCell = styled('rect', {
3
- name: 'MuiHeatmap',
4
- slot: 'Cell',
5
- overridesResolver: (_, styles) => styles.arc // FIXME: Inconsistent naming with slot
6
- })(({
7
- ownerState
8
- }) => ({
9
- filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
10
- fill: ownerState.color,
11
- shapeRendering: 'crispEdges'
12
- }));