import { GlobalChartState } from '../../../../state/chart_state' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs' ; import { QuadViewModel } from '../../layout/types/viewmodel_types' ; import { highlightedGeoms } from '../../layout/utils/highlighted_geoms' ; import { partitionMultiGeometries } from './geometries' ; const getHighlightedLegendItemPath = ( state ) => state . interactions . highlightedLegendPath ; internal export const legendHoverHighlightNodes = createCustomCachedSelector ( [ getSettingsSpecSelector , getHighlightedLegendItemPath , partitionMultiGeometries ] , ( { legendStrategy , flatLegend } , highlightedLegendItemPath , geometries ) : QuadViewModel [ ] => { if ( highlightedLegendItemPath . length === 0 ) return [ ] ; return geometries . flatMap ( ( { quadViewModel } ) => highlightedGeoms ( legendStrategy , flatLegend , quadViewModel , highlightedLegendItemPath ) ) ; } ) ;