import { GlobalChartState } from '../../../../state/chart_state' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { Cell , TextBox } from '../../layout/types/viewmodel_types' ; import { computeChartElementSizesSelector } from './compute_chart_dimensions' ; import { getHeatmapGeometries } from './geometries' ; function getCurrentPointerPosition ( state ) { return state . interactions . pointer . current . position ; } internal export const getPickedShapes = createCustomCachedSelector ( [ getHeatmapGeometries , getCurrentPointerPosition , computeChartElementSizesSelector ] , ( geoms , pointerPosition , dims ) : Cell [ ] | TextBox => { const picker = geoms . pickQuads ; const { x , y } = pointerPosition ; const pickedData = picker ( x , y ) ; return Array . isArray ( pickedData ) ? pickedData . filter ( ( { y } ) => y < dims . rowHeight * dims . visibleNumberOfRows ) : pickedData ; } ) ;