UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

17 lines (16 loc) 706 B
'use client'; import { useStore } from "../internals/store/useStore.mjs"; import { selectorChartsHighlightState } from "../internals/plugins/featurePlugins/useChartHighlight/index.mjs"; /** * A hook to check the highlighted state of the item. * This function already calculates that an item is not faded if it is highlighted. * * If you need fine control over the state, use the `useItemHighlightStateGetter` hook instead. * * @param {HighlightItemIdentifierWithType<SeriesType> | null} item is the item to check * @returns {HighlightState} the state of the item */ export function useItemHighlightState(item) { const store = useStore(); return store.use(selectorChartsHighlightState, item); }