@mui/x-charts-pro 8.14.0 → 8.14.1
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/CHANGELOG.md +95 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/SankeyChart/SankeyChart.d.ts +1 -1
- package/SankeyChart/SankeyChart.js +30 -0
- package/SankeyChart/SankeyChart.plugins.d.ts +3 -2
- package/SankeyChart/SankeyChart.plugins.js +2 -1
- package/SankeyChart/SankeyLinkElement.d.ts +1 -1
- package/SankeyChart/SankeyLinkElement.js +15 -2
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +16 -1
- package/SankeyChart/SankeyPlot.js +13 -1
- package/SankeyChart/plugins/index.d.ts +3 -0
- package/SankeyChart/plugins/index.js +49 -0
- package/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
- package/SankeyChart/plugins/useSankeyHighlight.js +76 -0
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
- package/SankeyChart/plugins/useSankeyHighlight.selectors.js +126 -0
- package/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
- package/SankeyChart/plugins/useSankeyHighlight.types.js +5 -0
- package/SankeyChart/sankey.highlight.types.d.ts +42 -0
- package/SankeyChart/sankey.highlight.types.js +6 -0
- package/SankeyChart/sankey.types.d.ts +3 -2
- package/SankeyChart/sankeyClasses.d.ts +1 -1
- package/SankeyChart/useSankeyChartProps.js +5 -5
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/SankeyChart/SankeyChart.d.ts +1 -1
- package/esm/SankeyChart/SankeyChart.js +30 -0
- package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -2
- package/esm/SankeyChart/SankeyChart.plugins.js +3 -4
- package/esm/SankeyChart/SankeyLinkElement.d.ts +1 -1
- package/esm/SankeyChart/SankeyLinkElement.js +16 -3
- package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/esm/SankeyChart/SankeyNodeElement.js +17 -2
- package/esm/SankeyChart/SankeyPlot.js +15 -3
- package/esm/SankeyChart/plugins/index.d.ts +3 -0
- package/esm/SankeyChart/plugins/index.js +3 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.js +68 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.js +120 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.types.js +1 -0
- package/esm/SankeyChart/sankey.highlight.types.d.ts +42 -0
- package/esm/SankeyChart/sankey.highlight.types.js +3 -0
- package/esm/SankeyChart/sankey.types.d.ts +3 -2
- package/esm/SankeyChart/sankeyClasses.d.ts +1 -1
- package/esm/SankeyChart/useSankeyChartProps.js +5 -5
- package/esm/index.js +1 -1
- package/index.js +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { SankeyLayoutLink, SankeyLayoutNode } from "../sankey.types.js";
|
|
2
|
+
import type { SankeyLinkFade, SankeyLinkHighlight, SankeyNodeFade, SankeyNodeHighlight } from "../sankey.highlight.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the node highlight configuration from the Sankey series.
|
|
5
|
+
* Defaults to 'nodes' if not specified.
|
|
6
|
+
*/
|
|
7
|
+
export declare const selectorNodeHighlightConfig: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
8
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
9
|
+
} & {
|
|
10
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
11
|
+
}, SankeyNodeHighlight, any[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Get the node fade configuration from the Sankey series.
|
|
14
|
+
* Defaults to 'none' if not specified.
|
|
15
|
+
*/
|
|
16
|
+
export declare const selectorNodeFadeConfig: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
17
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
18
|
+
} & {
|
|
19
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
20
|
+
}, SankeyNodeFade, any[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get the link highlight configuration from the Sankey series.
|
|
23
|
+
* Defaults to 'links' if not specified.
|
|
24
|
+
*/
|
|
25
|
+
export declare const selectorLinkHighlightConfig: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
26
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
27
|
+
} & {
|
|
28
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
29
|
+
}, SankeyLinkHighlight, any[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Get the link fade configuration from the Sankey series.
|
|
32
|
+
* Defaults to 'none' if not specified.
|
|
33
|
+
*/
|
|
34
|
+
export declare const selectorLinkFadeConfig: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
35
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
36
|
+
} & {
|
|
37
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
38
|
+
}, SankeyLinkFade, any[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Get the currently highlighted item in the Sankey chart.
|
|
41
|
+
* @param {UseSankeyHighlightSignature['state']} state The state of the chart.
|
|
42
|
+
* @returns {SankeyItemIdentifier | null} The highlighted item identifier or null.
|
|
43
|
+
*/
|
|
44
|
+
export declare const selectorSankeyHighlightedItem: import("reselect").Selector<import("./useSankeyHighlight.types.js").UseSankeyHighlightState & {
|
|
45
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
46
|
+
}, import("../index.js").SankeyItemIdentifier | null, []>;
|
|
47
|
+
/**
|
|
48
|
+
* Determines if a specific node should be highlighted.
|
|
49
|
+
* A node is highlighted if:
|
|
50
|
+
* - It's the highlighted node (unless highlight mode is 'none')
|
|
51
|
+
* - It's connected to a highlighted link (based on linkOptions.highlight)
|
|
52
|
+
*/
|
|
53
|
+
export declare const selectorIsNodeHighlighted: import("reselect").Selector<any, boolean, [node: SankeyLayoutNode]>;
|
|
54
|
+
/**
|
|
55
|
+
* Selector that determines if a specific link should be highlighted.
|
|
56
|
+
* A link is highlighted if:
|
|
57
|
+
* - It's the highlighted link (unless highlight mode is 'none')
|
|
58
|
+
* - It's connected to a highlighted node (based on nodeOptions.highlight)
|
|
59
|
+
*/
|
|
60
|
+
export declare const selectorIsLinkHighlighted: import("reselect").Selector<any, boolean, [link: SankeyLayoutLink]>;
|
|
61
|
+
/**
|
|
62
|
+
* Selector that determines if an item should be faded.
|
|
63
|
+
* An item is faded if:
|
|
64
|
+
* - There's a highlighted item
|
|
65
|
+
* - This item is not highlighted
|
|
66
|
+
* - The fade mode is 'global' for the highlighted element type
|
|
67
|
+
*/
|
|
68
|
+
export declare const selectorIsSankeyItemFaded: import("reselect").Selector<any, boolean, [isHighlighted: any]>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createSelector } from '@mui/x-charts/internals';
|
|
2
|
+
const selectorSankeyHighlight = state => state.highlight;
|
|
3
|
+
const selectSeries = state => state.series;
|
|
4
|
+
const selectorSankeySeries = createSelector([selectSeries], series => series.processedSeries.sankey?.series[series.processedSeries.sankey?.seriesOrder[0]] || null);
|
|
5
|
+
const DEFAULT_NODE_HIGHLIGHT = 'links';
|
|
6
|
+
const DEFAULT_LINK_HIGHLIGHT = 'links';
|
|
7
|
+
const DEFAULT_FADE = 'none';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get the node highlight configuration from the Sankey series.
|
|
11
|
+
* Defaults to 'nodes' if not specified.
|
|
12
|
+
*/
|
|
13
|
+
export const selectorNodeHighlightConfig = createSelector([selectorSankeySeries], series => series?.nodeOptions?.highlight ?? DEFAULT_NODE_HIGHLIGHT);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the node fade configuration from the Sankey series.
|
|
17
|
+
* Defaults to 'none' if not specified.
|
|
18
|
+
*/
|
|
19
|
+
export const selectorNodeFadeConfig = createSelector([selectorSankeySeries], series => series?.nodeOptions?.fade ?? DEFAULT_FADE);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the link highlight configuration from the Sankey series.
|
|
23
|
+
* Defaults to 'links' if not specified.
|
|
24
|
+
*/
|
|
25
|
+
export const selectorLinkHighlightConfig = createSelector([selectorSankeySeries], series => series?.linkOptions?.highlight ?? DEFAULT_LINK_HIGHLIGHT);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get the link fade configuration from the Sankey series.
|
|
29
|
+
* Defaults to 'none' if not specified.
|
|
30
|
+
*/
|
|
31
|
+
export const selectorLinkFadeConfig = createSelector([selectorSankeySeries], series => series?.linkOptions?.fade ?? DEFAULT_FADE);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the currently highlighted item in the Sankey chart.
|
|
35
|
+
* @param {UseSankeyHighlightSignature['state']} state The state of the chart.
|
|
36
|
+
* @returns {SankeyItemIdentifier | null} The highlighted item identifier or null.
|
|
37
|
+
*/
|
|
38
|
+
export const selectorSankeyHighlightedItem = createSelector([selectorSankeyHighlight], highlight => highlight.item);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Determines if a specific node should be highlighted.
|
|
42
|
+
* A node is highlighted if:
|
|
43
|
+
* - It's the highlighted node (unless highlight mode is 'none')
|
|
44
|
+
* - It's connected to a highlighted link (based on linkOptions.highlight)
|
|
45
|
+
*/
|
|
46
|
+
export const selectorIsNodeHighlighted = createSelector([selectorSankeyHighlightedItem, selectorNodeHighlightConfig, selectorLinkHighlightConfig, (_, node) => node.id], (highlightedItem, nodeHighlight, linkHighlight, nodeId) => {
|
|
47
|
+
if (!highlightedItem) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (highlightedItem.subType === 'node' && highlightedItem.nodeId === nodeId) {
|
|
51
|
+
return nodeHighlight !== 'none';
|
|
52
|
+
}
|
|
53
|
+
if (highlightedItem.subType === 'link') {
|
|
54
|
+
if (!linkHighlight || linkHighlight === 'none' || linkHighlight === 'links') {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const {
|
|
58
|
+
sourceId,
|
|
59
|
+
targetId
|
|
60
|
+
} = highlightedItem;
|
|
61
|
+
switch (linkHighlight) {
|
|
62
|
+
case 'nodes':
|
|
63
|
+
return nodeId === sourceId || nodeId === targetId;
|
|
64
|
+
case 'source':
|
|
65
|
+
return nodeId === sourceId;
|
|
66
|
+
case 'target':
|
|
67
|
+
return nodeId === targetId;
|
|
68
|
+
default:
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Selector that determines if a specific link should be highlighted.
|
|
77
|
+
* A link is highlighted if:
|
|
78
|
+
* - It's the highlighted link (unless highlight mode is 'none')
|
|
79
|
+
* - It's connected to a highlighted node (based on nodeOptions.highlight)
|
|
80
|
+
*/
|
|
81
|
+
export const selectorIsLinkHighlighted = createSelector([selectorSankeyHighlightedItem, selectorNodeHighlightConfig, selectorLinkHighlightConfig, (_, link) => link], (highlightedItem, nodeHighlight, linkHighlight, link) => {
|
|
82
|
+
if (!highlightedItem) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (highlightedItem.subType === 'link' && highlightedItem.sourceId === link.source.id && highlightedItem.targetId === link.target.id) {
|
|
86
|
+
return linkHighlight !== 'none';
|
|
87
|
+
}
|
|
88
|
+
if (highlightedItem.subType === 'node') {
|
|
89
|
+
if (!nodeHighlight || nodeHighlight === 'none' || nodeHighlight === 'nodes') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const highlightedNodeId = highlightedItem.nodeId;
|
|
93
|
+
switch (nodeHighlight) {
|
|
94
|
+
case 'links':
|
|
95
|
+
return link.source.id === highlightedNodeId || link.target.id === highlightedNodeId;
|
|
96
|
+
case 'incoming':
|
|
97
|
+
return link.target.id === highlightedNodeId;
|
|
98
|
+
case 'outgoing':
|
|
99
|
+
return link.source.id === highlightedNodeId;
|
|
100
|
+
default:
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Selector that determines if an item should be faded.
|
|
109
|
+
* An item is faded if:
|
|
110
|
+
* - There's a highlighted item
|
|
111
|
+
* - This item is not highlighted
|
|
112
|
+
* - The fade mode is 'global' for the highlighted element type
|
|
113
|
+
*/
|
|
114
|
+
export const selectorIsSankeyItemFaded = createSelector([selectorSankeyHighlightedItem, selectorNodeFadeConfig, selectorLinkFadeConfig, (_, isHighlighted) => isHighlighted], (highlightedItem, nodeFade, linkFade, isHighlighted) => {
|
|
115
|
+
if (!highlightedItem || isHighlighted) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
const fadeMode = highlightedItem.subType === 'node' ? nodeFade : linkFade;
|
|
119
|
+
return fadeMode === 'global';
|
|
120
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { ChartPluginSignature } from '@mui/x-charts/internals';
|
|
3
|
+
import { SankeyItemIdentifier } from "../sankey.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* The data of the highlighted item in a Sankey chart.
|
|
6
|
+
* Can be either a node or a link.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Highlight a node
|
|
10
|
+
* { type: 'sankey', seriesId: 'series-1', subType: 'node', nodeId: 'A' }
|
|
11
|
+
*
|
|
12
|
+
* // Highlight a link
|
|
13
|
+
* { type: 'sankey', seriesId: 'series-1', subType: 'link', sourceId: 'A', targetId: 'B' }
|
|
14
|
+
*
|
|
15
|
+
* // Clear the highlight
|
|
16
|
+
* null
|
|
17
|
+
*/
|
|
18
|
+
export type SankeyHighlightItemData = SankeyItemIdentifier;
|
|
19
|
+
export interface UseSankeyHighlightInstance {
|
|
20
|
+
/**
|
|
21
|
+
* Remove all highlight.
|
|
22
|
+
*/
|
|
23
|
+
clearHighlight: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Set the highlighted item.
|
|
26
|
+
* @param {SankeyHighlightItemData} item The item to highlight.
|
|
27
|
+
*/
|
|
28
|
+
setHighlight: (item: SankeyHighlightItemData) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface UseSankeyHighlightParameters {
|
|
31
|
+
/**
|
|
32
|
+
* The highlighted item.
|
|
33
|
+
* Used when the highlight is controlled.
|
|
34
|
+
*/
|
|
35
|
+
highlightedItem?: SankeyHighlightItemData | null;
|
|
36
|
+
/**
|
|
37
|
+
* The callback fired when the highlighted item changes.
|
|
38
|
+
*
|
|
39
|
+
* @param {SankeyHighlightItemData | null} highlightedItem The newly highlighted item.
|
|
40
|
+
*/
|
|
41
|
+
onHighlightChange?: (highlightedItem: SankeyHighlightItemData | null) => void;
|
|
42
|
+
}
|
|
43
|
+
export type UseSankeyHighlightDefaultizedParameters = DefaultizedProps<UseSankeyHighlightParameters, 'highlightedItem'>;
|
|
44
|
+
export interface UseSankeyHighlightState {
|
|
45
|
+
highlight: {
|
|
46
|
+
item: SankeyHighlightItemData | null;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export type UseSankeyHighlightSignature = ChartPluginSignature<{
|
|
50
|
+
instance: UseSankeyHighlightInstance;
|
|
51
|
+
state: UseSankeyHighlightState;
|
|
52
|
+
params: UseSankeyHighlightParameters;
|
|
53
|
+
defaultizedParams: UseSankeyHighlightDefaultizedParameters;
|
|
54
|
+
modelNames: 'highlightedItem';
|
|
55
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type SankeyNodeHighlight = 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none';
|
|
2
|
+
export type SankeyNodeFade = 'global' | 'none';
|
|
3
|
+
export type SankeyLinkHighlight = 'links' | 'nodes' | 'source' | 'target' | 'none';
|
|
4
|
+
export type SankeyLinkFade = 'global' | 'none';
|
|
5
|
+
export type SankeyNodeHighlightScope = {
|
|
6
|
+
/**
|
|
7
|
+
* Highlight mode for nodes
|
|
8
|
+
* - 'nodes': Highlight hovered node
|
|
9
|
+
* - 'links': Highlight links connected to hovered node
|
|
10
|
+
* - 'incoming': Highlight incoming links to hovered node
|
|
11
|
+
* - 'outgoing': Highlight outgoing links from hovered node
|
|
12
|
+
* - 'none': No highlighting
|
|
13
|
+
* @default 'links'
|
|
14
|
+
*/
|
|
15
|
+
highlight?: SankeyNodeHighlight;
|
|
16
|
+
/**
|
|
17
|
+
* Fade mode for nodes
|
|
18
|
+
* - 'global': Fade all non-highlighted items
|
|
19
|
+
* - 'none': No fading
|
|
20
|
+
* @default 'none'
|
|
21
|
+
*/
|
|
22
|
+
fade?: SankeyNodeFade;
|
|
23
|
+
};
|
|
24
|
+
export type SankeyLinkHighlightScope = {
|
|
25
|
+
/**
|
|
26
|
+
* Highlight mode for links
|
|
27
|
+
* - 'links': Highlight hovered link
|
|
28
|
+
* - 'nodes': Highlight nodes connected to hovered link
|
|
29
|
+
* - 'source': Highlight source node of hovered link
|
|
30
|
+
* - 'target': Highlight target node of hovered link
|
|
31
|
+
* - 'none': No highlighting
|
|
32
|
+
* @default 'links'
|
|
33
|
+
*/
|
|
34
|
+
highlight?: SankeyLinkHighlight;
|
|
35
|
+
/**
|
|
36
|
+
* Fade mode for links
|
|
37
|
+
* - 'global': Fade all non-highlighted items
|
|
38
|
+
* - 'none': No fading
|
|
39
|
+
* @default 'none'
|
|
40
|
+
*/
|
|
41
|
+
fade?: SankeyLinkFade;
|
|
42
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HighlightScope, SeriesId } from '@mui/x-charts/internals';
|
|
2
2
|
import type { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
3
3
|
import type { SankeyLink as D3SankeyLink, SankeyNode as D3SankeyNode } from '@mui/x-charts-vendor/d3-sankey';
|
|
4
|
+
import type { SankeyLinkHighlightScope, SankeyNodeHighlightScope } from "./sankey.highlight.types.js";
|
|
4
5
|
export type SankeyNodeId = string | number;
|
|
5
6
|
export interface SankeyNode {
|
|
6
7
|
/**
|
|
@@ -79,7 +80,7 @@ export type SankeyNodeOptions = {
|
|
|
79
80
|
* @returns {number} Comparison result
|
|
80
81
|
*/
|
|
81
82
|
sort?: (a: SankeyLayoutNode, b: SankeyLayoutNode) => number | null;
|
|
82
|
-
};
|
|
83
|
+
} & SankeyNodeHighlightScope;
|
|
83
84
|
export type SankeyLinkOptions = {
|
|
84
85
|
/**
|
|
85
86
|
* Default color for links without specified colors.
|
|
@@ -111,7 +112,7 @@ export type SankeyLinkOptions = {
|
|
|
111
112
|
* @default 10
|
|
112
113
|
*/
|
|
113
114
|
curveCorrection?: number;
|
|
114
|
-
};
|
|
115
|
+
} & SankeyLinkHighlightScope;
|
|
115
116
|
export interface SankeyData {
|
|
116
117
|
/**
|
|
117
118
|
* An array of node configs for the Sankey diagram
|
|
@@ -12,4 +12,4 @@ export declare function getSankeyPlotUtilityClass(slot: string): string;
|
|
|
12
12
|
export declare const sankeyPlotClasses: SankeyPlotClasses;
|
|
13
13
|
export declare const useUtilityClasses: (ownerState: {
|
|
14
14
|
classes?: Partial<SankeyPlotClasses>;
|
|
15
|
-
}) => Record<"
|
|
15
|
+
}) => Record<"nodes" | "links" | "root" | "linkLabels", string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "loading", "className", "apiRef", "onNodeClick", "onLinkClick"];
|
|
3
|
+
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "apiRef", "onNodeClick", "onLinkClick"];
|
|
4
4
|
import { DEFAULT_MARGINS } from '@mui/x-charts/constants';
|
|
5
5
|
import { defaultizeMargin } from '@mui/x-charts/internals';
|
|
6
6
|
import { SANKEY_CHART_PLUGINS } from "./SankeyChart.plugins.js";
|
|
@@ -24,8 +24,8 @@ export const useSankeyChartProps = props => {
|
|
|
24
24
|
slots,
|
|
25
25
|
slotProps,
|
|
26
26
|
loading,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
highlightedItem,
|
|
28
|
+
onHighlightChange,
|
|
29
29
|
className,
|
|
30
30
|
apiRef,
|
|
31
31
|
onNodeClick,
|
|
@@ -42,8 +42,8 @@ export const useSankeyChartProps = props => {
|
|
|
42
42
|
margin,
|
|
43
43
|
colors,
|
|
44
44
|
sx,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
highlightedItem,
|
|
46
|
+
onHighlightChange,
|
|
47
47
|
className,
|
|
48
48
|
apiRef,
|
|
49
49
|
plugins: SANKEY_CHART_PLUGINS
|
package/esm/index.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-pro",
|
|
3
|
-
"version": "8.14.
|
|
3
|
+
"version": "8.14.1",
|
|
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,11 +31,11 @@
|
|
|
31
31
|
"@mui/utils": "^7.3.3",
|
|
32
32
|
"clsx": "^2.1.1",
|
|
33
33
|
"prop-types": "^15.8.1",
|
|
34
|
-
"@mui/x-charts
|
|
35
|
-
"@mui/x-charts": "8.14.
|
|
36
|
-
"@mui/x-internals": "8.14.0",
|
|
34
|
+
"@mui/x-charts": "8.14.1",
|
|
35
|
+
"@mui/x-charts-vendor": "8.14.1",
|
|
37
36
|
"@mui/x-internal-gestures": "0.3.3",
|
|
38
|
-
"@mui/x-
|
|
37
|
+
"@mui/x-internals": "8.14.0",
|
|
38
|
+
"@mui/x-license": "8.14.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@emotion/react": "^11.9.0",
|