@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.
- package/BarChartPro/BarChartPro.js +2 -2
- package/CHANGELOG.md +78 -0
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
- package/FunnelChart/FunnelPlot.js +8 -3
- package/FunnelChart/FunnelSection.js +7 -3
- package/FunnelChart/FunnelSectionLabel.d.ts +6 -0
- package/FunnelChart/FunnelSectionLabel.js +18 -5
- package/FunnelChart/funnelClasses.d.ts +29 -0
- package/FunnelChart/funnelClasses.js +29 -0
- package/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/FunnelChart/funnelSectionClasses.js +19 -0
- package/FunnelChart/index.d.ts +2 -0
- package/FunnelChart/index.js +8 -0
- package/Heatmap/Heatmap.js +2 -2
- package/Heatmap/HeatmapCell.d.ts +34 -0
- package/Heatmap/HeatmapCell.js +64 -0
- package/Heatmap/HeatmapItem.d.ts +1 -8
- package/Heatmap/HeatmapItem.js +4 -19
- package/Heatmap/heatmapClasses.d.ts +6 -1
- package/Heatmap/heatmapClasses.js +18 -3
- package/Heatmap/index.d.ts +4 -2
- package/Heatmap/index.js +17 -13
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
- package/LineChartPro/LineChartPro.js +2 -2
- package/SankeyChart/SankeyLinkElement.js +4 -2
- package/SankeyChart/SankeyLinkLabel.js +3 -0
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +5 -3
- package/SankeyChart/SankeyNodeLabel.js +3 -0
- package/SankeyChart/SankeyPlot.js +2 -2
- package/SankeyChart/index.d.ts +2 -1
- package/SankeyChart/index.js +7 -0
- package/SankeyChart/sankeyClasses.d.ts +27 -6
- package/SankeyChart/sankeyClasses.js +27 -8
- package/ScatterChartPro/ScatterChartPro.js +2 -2
- package/esm/BarChartPro/BarChartPro.js +2 -2
- package/esm/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
- package/esm/FunnelChart/FunnelPlot.js +8 -3
- package/esm/FunnelChart/FunnelSection.js +9 -5
- package/esm/FunnelChart/FunnelSectionLabel.d.ts +6 -0
- package/esm/FunnelChart/FunnelSectionLabel.js +20 -7
- package/esm/FunnelChart/funnelClasses.d.ts +29 -0
- package/esm/FunnelChart/funnelClasses.js +19 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/esm/FunnelChart/funnelSectionClasses.js +20 -0
- package/esm/FunnelChart/index.d.ts +2 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/Heatmap/Heatmap.js +2 -2
- package/esm/Heatmap/HeatmapCell.d.ts +34 -0
- package/esm/Heatmap/HeatmapCell.js +58 -0
- package/esm/Heatmap/HeatmapItem.d.ts +1 -8
- package/esm/Heatmap/HeatmapItem.js +4 -19
- package/esm/Heatmap/heatmapClasses.d.ts +6 -1
- package/esm/Heatmap/heatmapClasses.js +16 -2
- package/esm/Heatmap/index.d.ts +4 -2
- package/esm/Heatmap/index.js +2 -1
- package/esm/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
- package/esm/LineChartPro/LineChartPro.js +2 -2
- package/esm/SankeyChart/SankeyLinkElement.js +4 -2
- package/esm/SankeyChart/SankeyLinkLabel.js +3 -0
- package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/esm/SankeyChart/SankeyNodeElement.js +5 -3
- package/esm/SankeyChart/SankeyNodeLabel.js +3 -0
- package/esm/SankeyChart/SankeyPlot.js +2 -2
- package/esm/SankeyChart/index.d.ts +2 -1
- package/esm/SankeyChart/index.js +1 -1
- package/esm/SankeyChart/sankeyClasses.d.ts +27 -6
- package/esm/SankeyChart/sankeyClasses.js +25 -6
- package/esm/ScatterChartPro/ScatterChartPro.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
- package/esm/themeAugmentation/components.d.ts +19 -1
- package/esm/themeAugmentation/overrides.d.ts +5 -2
- package/esm/themeAugmentation/props.d.ts +8 -0
- package/index.js +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +19 -1
- package/themeAugmentation/overrides.d.ts +5 -2
- package/themeAugmentation/props.d.ts +8 -0
- package/Heatmap/internals/HeatmapCell.d.ts +0 -21
- package/Heatmap/internals/HeatmapCell.js +0 -18
- package/esm/Heatmap/internals/HeatmapCell.d.ts +0 -21
- package/esm/Heatmap/internals/HeatmapCell.js +0 -12
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
2
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
3
3
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `FunnelClasses` from `funnelClasses` instead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `getFunnelUtilityClass` from `funnelClasses` instead.
|
|
11
|
+
*/
|
|
4
12
|
function getFunnelSectionUtilityClass(slot) {
|
|
5
13
|
return generateUtilityClass('MuiFunnelSection', slot);
|
|
6
14
|
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `useUtilityClasses` from `funnelClasses` instead.
|
|
18
|
+
*/
|
|
7
19
|
export const useUtilityClasses = props => {
|
|
8
20
|
const {
|
|
9
21
|
classes,
|
|
@@ -21,6 +33,10 @@ export const useUtilityClasses = props => {
|
|
|
21
33
|
};
|
|
22
34
|
return composeClasses(slots, getFunnelSectionUtilityClass, classes);
|
|
23
35
|
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `useUtilityClasses` from `funnelClasses` instead.
|
|
39
|
+
*/
|
|
24
40
|
export const useLabelUtilityClasses = props => {
|
|
25
41
|
const {
|
|
26
42
|
classes,
|
|
@@ -32,4 +48,8 @@ export const useLabelUtilityClasses = props => {
|
|
|
32
48
|
};
|
|
33
49
|
return composeClasses(slots, getFunnelSectionUtilityClass, classes);
|
|
34
50
|
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use `funnelClasses` from `funnelClasses` instead.
|
|
54
|
+
*/
|
|
35
55
|
export const funnelSectionClasses = generateUtilityClasses('MuiFunnelSection', ['root', 'highlighted', 'faded', 'filled', 'outlined', 'label', 'series', 'data-index']);
|
|
@@ -13,5 +13,7 @@ export * from "./FunnelChart.plugins.js";
|
|
|
13
13
|
export type { FunnelCurveType } from "./curves/index.js";
|
|
14
14
|
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
15
15
|
export type { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
16
|
+
export { funnelClasses } from "./funnelClasses.js";
|
|
17
|
+
export type { FunnelClassKey, FunnelClasses } from "./funnelClasses.js";
|
|
16
18
|
export { FunnelSection } from "./FunnelSection.js";
|
|
17
19
|
export { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
package/esm/FunnelChart/index.js
CHANGED
|
@@ -12,5 +12,6 @@ export * from "./categoryAxis.types.js";
|
|
|
12
12
|
export * from "./funnelSlots.types.js";
|
|
13
13
|
export * from "./FunnelChart.plugins.js";
|
|
14
14
|
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
15
|
+
export { funnelClasses } from "./funnelClasses.js";
|
|
15
16
|
export { FunnelSection } from "./FunnelSection.js";
|
|
16
17
|
export { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -562,8 +562,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
562
562
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
563
563
|
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
564
564
|
}), PropTypes.shape({
|
|
565
|
-
pointerMode: PropTypes.
|
|
566
|
-
requiredKeys: PropTypes.
|
|
565
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
566
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
567
567
|
type: PropTypes.oneOf(['brush']).isRequired
|
|
568
568
|
})]).isRequired)
|
|
569
569
|
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SeriesId } from "../models/index.js";
|
|
3
|
+
import type { HeatmapClasses } from "./heatmapClasses.js";
|
|
4
|
+
export interface HeatmapCellOwnerState {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
dataIndex: number;
|
|
7
|
+
color: string;
|
|
8
|
+
value: number;
|
|
9
|
+
isFaded: boolean;
|
|
10
|
+
isHighlighted: boolean;
|
|
11
|
+
classes?: Partial<HeatmapClasses>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
15
|
+
*/
|
|
16
|
+
export type HeatmapItemOwnerState = HeatmapCellOwnerState;
|
|
17
|
+
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
ownerState: HeatmapCellOwnerState;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Demos:
|
|
26
|
+
*
|
|
27
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
28
|
+
*
|
|
29
|
+
* API:
|
|
30
|
+
*
|
|
31
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
32
|
+
*/
|
|
33
|
+
declare const HeatmapCell: React.ForwardRefExoticComponent<Omit<HeatmapCellProps, "ref"> & React.RefAttributes<SVGRectElement>>;
|
|
34
|
+
export { HeatmapCell };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const HeatmapCellRoot = styled('rect', {
|
|
13
|
+
name: 'MuiHeatmap',
|
|
14
|
+
slot: 'Cell',
|
|
15
|
+
overridesResolver: (_, styles) => styles.cell
|
|
16
|
+
})(({
|
|
17
|
+
ownerState
|
|
18
|
+
}) => ({
|
|
19
|
+
filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
|
|
20
|
+
fill: ownerState.color,
|
|
21
|
+
shapeRendering: 'crispEdges'
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Demos:
|
|
26
|
+
*
|
|
27
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
28
|
+
*
|
|
29
|
+
* API:
|
|
30
|
+
*
|
|
31
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
32
|
+
*/
|
|
33
|
+
const HeatmapCell = /*#__PURE__*/React.forwardRef(function HeatmapCell(props, ref) {
|
|
34
|
+
return /*#__PURE__*/_jsx(HeatmapCellRoot, _extends({
|
|
35
|
+
ref: ref
|
|
36
|
+
}, props));
|
|
37
|
+
});
|
|
38
|
+
if (process.env.NODE_ENV !== "production") HeatmapCell.displayName = "HeatmapCell";
|
|
39
|
+
process.env.NODE_ENV !== "production" ? HeatmapCell.propTypes = {
|
|
40
|
+
// ----------------------------- Warning --------------------------------
|
|
41
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
42
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
43
|
+
// ----------------------------------------------------------------------
|
|
44
|
+
height: PropTypes.number.isRequired,
|
|
45
|
+
ownerState: PropTypes.shape({
|
|
46
|
+
classes: PropTypes.object,
|
|
47
|
+
color: PropTypes.string.isRequired,
|
|
48
|
+
dataIndex: PropTypes.number.isRequired,
|
|
49
|
+
isFaded: PropTypes.bool.isRequired,
|
|
50
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
51
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
52
|
+
value: PropTypes.number.isRequired
|
|
53
|
+
}).isRequired,
|
|
54
|
+
width: PropTypes.number.isRequired,
|
|
55
|
+
x: PropTypes.number.isRequired,
|
|
56
|
+
y: PropTypes.number.isRequired
|
|
57
|
+
} : void 0;
|
|
58
|
+
export { HeatmapCell };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import { type
|
|
3
|
+
import { type HeatmapCellProps } from "./HeatmapCell.js";
|
|
4
4
|
export interface HeatmapItemSlots {
|
|
5
5
|
/**
|
|
6
6
|
* The component that renders the heatmap cell.
|
|
@@ -33,13 +33,6 @@ export interface HeatmapItemProps {
|
|
|
33
33
|
*/
|
|
34
34
|
slots?: HeatmapItemSlots;
|
|
35
35
|
}
|
|
36
|
-
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
ownerState: HeatmapItemOwnerState;
|
|
42
|
-
}
|
|
43
36
|
/**
|
|
44
37
|
* @ignore - internal component.
|
|
45
38
|
*/
|
|
@@ -4,25 +4,11 @@ const _excluded = ["seriesId", "dataIndex", "color", "value", "isHighlighted", "
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
7
|
-
import composeClasses from '@mui/utils/composeClasses';
|
|
8
7
|
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
9
|
-
import {
|
|
10
|
-
import { HeatmapCell } from "./
|
|
8
|
+
import { useUtilityClasses } from "./heatmapClasses.js";
|
|
9
|
+
import { HeatmapCell } from "./HeatmapCell.js";
|
|
11
10
|
import { shouldRegisterPointerInteractionsGlobally } from "./shouldRegisterPointerInteractionsGlobally.js";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
const useUtilityClasses = ownerState => {
|
|
14
|
-
const {
|
|
15
|
-
classes,
|
|
16
|
-
seriesId,
|
|
17
|
-
isFaded,
|
|
18
|
-
isHighlighted
|
|
19
|
-
} = ownerState;
|
|
20
|
-
const slots = {
|
|
21
|
-
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
22
|
-
};
|
|
23
|
-
return composeClasses(slots, getHeatmapUtilityClass, classes);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
12
|
/**
|
|
27
13
|
* @ignore - internal component.
|
|
28
14
|
*/
|
|
@@ -51,9 +37,9 @@ function HeatmapItem(props) {
|
|
|
51
37
|
seriesId,
|
|
52
38
|
dataIndex,
|
|
53
39
|
color,
|
|
54
|
-
value,
|
|
55
40
|
isFaded,
|
|
56
|
-
isHighlighted
|
|
41
|
+
isHighlighted,
|
|
42
|
+
value
|
|
57
43
|
};
|
|
58
44
|
const classes = useUtilityClasses(ownerState);
|
|
59
45
|
const Cell = slots?.cell ?? HeatmapCell;
|
|
@@ -73,7 +59,6 @@ process.env.NODE_ENV !== "production" ? HeatmapItem.propTypes = {
|
|
|
73
59
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
74
60
|
// ----------------------------------------------------------------------
|
|
75
61
|
color: PropTypes.string.isRequired,
|
|
76
|
-
dataIndex: PropTypes.number.isRequired,
|
|
77
62
|
height: PropTypes.number.isRequired,
|
|
78
63
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
79
64
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { HeatmapCellOwnerState } from "./HeatmapCell.js";
|
|
1
2
|
export interface HeatmapClasses {
|
|
3
|
+
/** Styles applied to the heatmap plot root element. */
|
|
4
|
+
root: string;
|
|
2
5
|
/** Styles applied to the heatmap cells. */
|
|
3
6
|
cell: string;
|
|
4
7
|
/** Styles applied to the cell element if highlighted. */
|
|
@@ -8,9 +11,11 @@ export interface HeatmapClasses {
|
|
|
8
11
|
/**
|
|
9
12
|
* Styles applied to the root element for a specified series.
|
|
10
13
|
* Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`.
|
|
14
|
+
* @deprecated Use `[data-series="${seriesId}"]` selector instead.
|
|
11
15
|
*/
|
|
12
16
|
series: string;
|
|
13
17
|
}
|
|
14
18
|
export type HeatmapClassKey = keyof HeatmapClasses;
|
|
15
19
|
export declare function getHeatmapUtilityClass(slot: string): string;
|
|
16
|
-
export declare const heatmapClasses: HeatmapClasses;
|
|
20
|
+
export declare const heatmapClasses: HeatmapClasses;
|
|
21
|
+
export declare const useUtilityClasses: (ownerState: HeatmapCellOwnerState) => Record<"cell" | "root", string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
3
4
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
4
5
|
export function getHeatmapUtilityClass(slot) {
|
|
5
6
|
// Those should be common to all charts
|
|
@@ -8,7 +9,20 @@ export function getHeatmapUtilityClass(slot) {
|
|
|
8
9
|
}
|
|
9
10
|
return generateUtilityClass('MuiHeatmap', slot);
|
|
10
11
|
}
|
|
11
|
-
export const heatmapClasses = _extends({}, generateUtilityClasses('MuiHeatmap', ['cell', 'series']), {
|
|
12
|
+
export const heatmapClasses = _extends({}, generateUtilityClasses('MuiHeatmap', ['root', 'cell', 'series']), {
|
|
12
13
|
highlighted: 'Charts-highlighted',
|
|
13
14
|
faded: 'Charts-faded'
|
|
14
|
-
});
|
|
15
|
+
});
|
|
16
|
+
export const useUtilityClasses = ownerState => {
|
|
17
|
+
const {
|
|
18
|
+
classes,
|
|
19
|
+
seriesId,
|
|
20
|
+
isFaded,
|
|
21
|
+
isHighlighted
|
|
22
|
+
} = ownerState;
|
|
23
|
+
const slots = {
|
|
24
|
+
root: ['root'],
|
|
25
|
+
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
26
|
+
};
|
|
27
|
+
return composeClasses(slots, getHeatmapUtilityClass, classes);
|
|
28
|
+
};
|
package/esm/Heatmap/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export { Heatmap } from "./Heatmap.js";
|
|
|
2
2
|
export type { HeatmapSeries, HeatmapProps } from "./Heatmap.js";
|
|
3
3
|
export { HeatmapPlot } from "./HeatmapPlot.js";
|
|
4
4
|
export * from "./FocusedHeatmapCell.js";
|
|
5
|
-
export
|
|
5
|
+
export { HeatmapCell } from "./HeatmapCell.js";
|
|
6
|
+
export type { HeatmapCellProps, HeatmapCellOwnerState } from "./HeatmapCell.js";
|
|
6
7
|
export * from "./HeatmapTooltip/index.js";
|
|
7
8
|
export * from "./Heatmap.plugins.js";
|
|
8
|
-
export
|
|
9
|
+
export { heatmapClasses } from "./heatmapClasses.js";
|
|
10
|
+
export type { HeatmapClasses, HeatmapClassKey } from "./heatmapClasses.js";
|
package/esm/Heatmap/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Heatmap } from "./Heatmap.js";
|
|
2
2
|
export { HeatmapPlot } from "./HeatmapPlot.js";
|
|
3
3
|
export * from "./FocusedHeatmapCell.js";
|
|
4
|
+
export { HeatmapCell } from "./HeatmapCell.js";
|
|
4
5
|
export * from "./HeatmapTooltip/index.js";
|
|
5
6
|
export * from "./Heatmap.plugins.js";
|
|
6
|
-
export
|
|
7
|
+
export { heatmapClasses } from "./heatmapClasses.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HeatmapCell } from "./
|
|
1
|
+
import { HeatmapCell } from "./HeatmapCell.js";
|
|
2
2
|
|
|
3
3
|
/* Global pointer interactions should be registered when we're using the default HeatmapCell.
|
|
4
4
|
* We only want to return false when a custom slot is being used to avoid breaking changes.
|
|
@@ -1581,8 +1581,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1581
1581
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1582
1582
|
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1583
1583
|
}), PropTypes.shape({
|
|
1584
|
-
pointerMode: PropTypes.
|
|
1585
|
-
requiredKeys: PropTypes.
|
|
1584
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1585
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1586
1586
|
type: PropTypes.oneOf(['brush']).isRequired
|
|
1587
1587
|
})]).isRequired)
|
|
1588
1588
|
})
|
|
@@ -4,8 +4,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
6
|
import { useInteractionItemProps, useStore } from '@mui/x-charts/internals';
|
|
7
|
-
import { selectorIsLinkHighlighted } from "./plugins/
|
|
8
|
-
import {
|
|
7
|
+
import { selectorIsLinkHighlighted, selectorIsSankeyItemFaded } from "./plugins/useSankeyHighlight.selectors.js";
|
|
8
|
+
import { useUtilityClasses } from "./sankeyClasses.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
/**
|
|
11
11
|
* @ignore - internal component.
|
|
@@ -31,6 +31,7 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
31
31
|
|
|
32
32
|
// Add interaction props for tooltips
|
|
33
33
|
const interactionProps = useInteractionItemProps(identifier);
|
|
34
|
+
const classes = useUtilityClasses();
|
|
34
35
|
const handleClick = useEventCallback(event => {
|
|
35
36
|
onClick?.(event, identifier);
|
|
36
37
|
});
|
|
@@ -45,6 +46,7 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
45
46
|
}
|
|
46
47
|
return /*#__PURE__*/_jsx("path", _extends({
|
|
47
48
|
ref: ref,
|
|
49
|
+
className: classes.link,
|
|
48
50
|
d: link.path,
|
|
49
51
|
fill: link.color,
|
|
50
52
|
opacity: finalOpacity,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
import { useSankeySeries } from "../hooks/useSankeySeries.js";
|
|
6
|
+
import { useUtilityClasses } from "./sankeyClasses.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const getLinkMidpoint = link => {
|
|
8
9
|
if (link.y0 === undefined || link.y1 === undefined) {
|
|
@@ -32,6 +33,7 @@ export const SankeyLinkLabel = /*#__PURE__*/React.forwardRef(function SankeyLink
|
|
|
32
33
|
} = props;
|
|
33
34
|
const theme = useTheme();
|
|
34
35
|
const series = useSankeySeries()[0];
|
|
36
|
+
const classes = useUtilityClasses();
|
|
35
37
|
if (!link.path || link.y0 === undefined || link.y1 === undefined) {
|
|
36
38
|
return null; // No path defined or invalid coordinates, nothing to render
|
|
37
39
|
}
|
|
@@ -46,6 +48,7 @@ export const SankeyLinkLabel = /*#__PURE__*/React.forwardRef(function SankeyLink
|
|
|
46
48
|
}) : link.value;
|
|
47
49
|
return /*#__PURE__*/_jsx("text", {
|
|
48
50
|
ref: ref,
|
|
51
|
+
className: classes.linkLabel,
|
|
49
52
|
x: midpoint.x,
|
|
50
53
|
y: midpoint.y,
|
|
51
54
|
textAnchor: "middle",
|
|
@@ -20,4 +20,4 @@ export interface SankeyNodeElementProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @ignore - internal component.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<
|
|
23
|
+
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGRectElement>>;
|
|
@@ -4,8 +4,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
6
|
import { useInteractionItemProps, useStore } from '@mui/x-charts/internals';
|
|
7
|
-
import { selectorIsNodeHighlighted } from "./plugins/
|
|
8
|
-
import {
|
|
7
|
+
import { selectorIsNodeHighlighted, selectorIsSankeyItemFaded } from "./plugins/useSankeyHighlight.selectors.js";
|
|
8
|
+
import { useUtilityClasses } from "./sankeyClasses.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
/**
|
|
11
11
|
* @ignore - internal component.
|
|
@@ -35,6 +35,7 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
35
35
|
|
|
36
36
|
// Add interaction props for tooltips
|
|
37
37
|
const interactionProps = useInteractionItemProps(identifier);
|
|
38
|
+
const classes = useUtilityClasses();
|
|
38
39
|
const handleClick = useEventCallback(event => {
|
|
39
40
|
onClick?.(event, identifier);
|
|
40
41
|
});
|
|
@@ -58,7 +59,8 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
58
59
|
cursor: onClick ? 'pointer' : 'default',
|
|
59
60
|
stroke: "none",
|
|
60
61
|
"data-highlighted": isHighlighted || undefined,
|
|
61
|
-
"data-faded": isFaded || undefined
|
|
62
|
+
"data-faded": isFaded || undefined,
|
|
63
|
+
className: classes.node
|
|
62
64
|
}, interactionProps))
|
|
63
65
|
});
|
|
64
66
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
import { useSankeyNodeHighlightState } from "./sankeyHighlightHooks.js";
|
|
6
|
+
import { useUtilityClasses } from "./sankeyClasses.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
/**
|
|
8
9
|
* @ignore - internal component.
|
|
@@ -23,6 +24,7 @@ export const SankeyNodeLabel = /*#__PURE__*/React.forwardRef(function SankeyNode
|
|
|
23
24
|
: x0 - 6; // Left side for other columns
|
|
24
25
|
|
|
25
26
|
const labelAnchor = isRightSide ? 'start' : 'end';
|
|
27
|
+
const classes = useUtilityClasses();
|
|
26
28
|
const highlightState = useSankeyNodeHighlightState(node.id);
|
|
27
29
|
let opacity = 1;
|
|
28
30
|
if (highlightState === 'faded') {
|
|
@@ -35,6 +37,7 @@ export const SankeyNodeLabel = /*#__PURE__*/React.forwardRef(function SankeyNode
|
|
|
35
37
|
}
|
|
36
38
|
return /*#__PURE__*/_jsx("text", {
|
|
37
39
|
ref: ref,
|
|
40
|
+
className: classes.nodeLabel,
|
|
38
41
|
x: labelX,
|
|
39
42
|
y: (y0 + y1) / 2,
|
|
40
43
|
textAnchor: labelAnchor,
|
|
@@ -11,8 +11,8 @@ import { SankeyNodeLabelPlot } from "./SankeyNodeLabelPlot.js";
|
|
|
11
11
|
import { SankeyLinkLabelPlot } from "./SankeyLinkLabelPlot.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const SankeyPlotRoot = styled('g', {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
name: 'MuiSankeyPlot',
|
|
15
|
+
slot: 'Root'
|
|
16
16
|
})({});
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -12,6 +12,7 @@ export * from "./sankey.types.js";
|
|
|
12
12
|
export * from "./sankeySlots.types.js";
|
|
13
13
|
export * from "./sankeyHighlightHooks.js";
|
|
14
14
|
export * from "../hooks/useSankeySeries.js";
|
|
15
|
-
export { type SankeyPlotClasses, sankeyPlotClasses } from "./sankeyClasses.js";
|
|
15
|
+
export { type SankeyPlotClasses, sankeyPlotClasses, sankeyClasses } from "./sankeyClasses.js";
|
|
16
|
+
export type { SankeyClassKey, SankeyClasses } from "./sankeyClasses.js";
|
|
16
17
|
export { SankeyTooltip, SankeyTooltipContent } from "./SankeyTooltip/index.js";
|
|
17
18
|
export type { SankeyTooltipProps } from "./SankeyTooltip/index.js";
|
package/esm/SankeyChart/index.js
CHANGED
|
@@ -11,5 +11,5 @@ export * from "./sankey.types.js";
|
|
|
11
11
|
export * from "./sankeySlots.types.js";
|
|
12
12
|
export * from "./sankeyHighlightHooks.js";
|
|
13
13
|
export * from "../hooks/useSankeySeries.js";
|
|
14
|
-
export { sankeyPlotClasses } from "./sankeyClasses.js";
|
|
14
|
+
export { sankeyPlotClasses, sankeyClasses } from "./sankeyClasses.js";
|
|
15
15
|
export { SankeyTooltip, SankeyTooltipContent } from "./SankeyTooltip/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SankeyClasses {
|
|
2
2
|
/** Styles applied to the root element. */
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the nodes container. */
|
|
@@ -9,9 +9,30 @@ export interface SankeyPlotClasses {
|
|
|
9
9
|
links: string;
|
|
10
10
|
/** Styles applied to the link label container. */
|
|
11
11
|
linkLabels: string;
|
|
12
|
+
/** Styles applied to an individual node element. */
|
|
13
|
+
node: string;
|
|
14
|
+
/** Styles applied to an individual link element. */
|
|
15
|
+
link: string;
|
|
16
|
+
/** Styles applied to an individual node label element. */
|
|
17
|
+
nodeLabel: string;
|
|
18
|
+
/** Styles applied to an individual link label element. */
|
|
19
|
+
linkLabel: string;
|
|
12
20
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
export type SankeyClassKey = keyof SankeyClasses;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `SankeyClasses` instead.
|
|
24
|
+
*/
|
|
25
|
+
export type SankeyPlotClasses = SankeyClasses;
|
|
26
|
+
export declare function getSankeyUtilityClass(slot: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `getSankeyUtilityClass` instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getSankeyPlotUtilityClass: typeof getSankeyUtilityClass;
|
|
31
|
+
export declare const sankeyClasses: SankeyClasses;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `sankeyClasses` instead.
|
|
34
|
+
*/
|
|
35
|
+
export declare const sankeyPlotClasses: SankeyClasses;
|
|
36
|
+
export declare const useUtilityClasses: (options?: {
|
|
37
|
+
classes?: Partial<SankeyClasses>;
|
|
38
|
+
}) => Record<"nodes" | "links" | "node" | "link" | "root" | "nodeLabels" | "linkLabels" | "nodeLabel" | "linkLabel", string>;
|
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import composeClasses from '@mui/utils/composeClasses';
|
|
2
2
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
3
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `SankeyClasses` instead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export function getSankeyUtilityClass(slot) {
|
|
5
10
|
return generateUtilityClass('MuiSankeyChart', slot);
|
|
6
11
|
}
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `getSankeyUtilityClass` instead.
|
|
15
|
+
*/
|
|
16
|
+
export const getSankeyPlotUtilityClass = getSankeyUtilityClass;
|
|
17
|
+
export const sankeyClasses = generateUtilityClasses('MuiSankeyChart', ['root', 'nodes', 'nodeLabels', 'links', 'linkLabels', 'node', 'link', 'nodeLabel', 'linkLabel']);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `sankeyClasses` instead.
|
|
21
|
+
*/
|
|
22
|
+
export const sankeyPlotClasses = sankeyClasses;
|
|
23
|
+
export const useUtilityClasses = options => {
|
|
9
24
|
const {
|
|
10
25
|
classes
|
|
11
|
-
} =
|
|
26
|
+
} = options ?? {};
|
|
12
27
|
const slots = {
|
|
13
28
|
root: ['root'],
|
|
14
29
|
nodes: ['nodes'],
|
|
15
30
|
nodeLabels: ['nodeLabels'],
|
|
16
31
|
links: ['links'],
|
|
17
|
-
linkLabels: ['linkLabels']
|
|
32
|
+
linkLabels: ['linkLabels'],
|
|
33
|
+
node: ['node'],
|
|
34
|
+
link: ['link'],
|
|
35
|
+
nodeLabel: ['nodeLabel'],
|
|
36
|
+
linkLabel: ['linkLabel']
|
|
18
37
|
};
|
|
19
|
-
return composeClasses(slots,
|
|
38
|
+
return composeClasses(slots, getSankeyUtilityClass, classes);
|
|
20
39
|
};
|
|
@@ -1563,8 +1563,8 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1563
1563
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1564
1564
|
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1565
1565
|
}), PropTypes.shape({
|
|
1566
|
-
pointerMode: PropTypes.
|
|
1567
|
-
requiredKeys: PropTypes.
|
|
1566
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1567
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1568
1568
|
type: PropTypes.oneOf(['brush']).isRequired
|
|
1569
1569
|
})]).isRequired)
|
|
1570
1570
|
})
|
package/esm/index.js
CHANGED
|
@@ -99,7 +99,7 @@ export type DoubleTapResetInteraction = Unpack<{
|
|
|
99
99
|
} & AllModeProp & AllKeysProp>;
|
|
100
100
|
export type BrushInteraction = Unpack<{
|
|
101
101
|
type: 'brush';
|
|
102
|
-
} &
|
|
102
|
+
} & AllModeProp & AllKeysProp>;
|
|
103
103
|
export type AnyInteraction = {
|
|
104
104
|
type: string;
|
|
105
105
|
pointerMode?: InteractionMode;
|
|
@@ -16,6 +16,19 @@ export const useZoomOnBrush = ({
|
|
|
16
16
|
React.useEffect(() => {
|
|
17
17
|
instance.setZoomBrushEnabled(isZoomOnBrushEnabled);
|
|
18
18
|
}, [isZoomOnBrushEnabled, instance]);
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (!isZoomOnBrushEnabled) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
instance.updateZoomInteractionListeners('brush', {
|
|
24
|
+
requiredKeys: config.requiredKeys,
|
|
25
|
+
pointerMode: config.pointerMode,
|
|
26
|
+
pointerOptions: {
|
|
27
|
+
mouse: config.mouse,
|
|
28
|
+
touch: config.touch
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}, [isZoomOnBrushEnabled, config, instance]);
|
|
19
32
|
|
|
20
33
|
// Zoom on brush
|
|
21
34
|
React.useEffect(() => {
|
|
@@ -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
|
-
|
|
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> {}
|