@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
12 lines • 448 B
JavaScript
export const createIsFaded = (highlightScope, highlightedItem) => input => {
if (!highlightScope) {
return false;
}
if (highlightScope.fade === 'series') {
return input.seriesId === highlightedItem?.seriesId && input.dataIndex !== highlightedItem?.dataIndex;
}
if (highlightScope.fade === 'global') {
return input.seriesId !== highlightedItem?.seriesId || input.dataIndex !== highlightedItem?.dataIndex;
}
return false;
};