import { TooltipInfo } from '../../../../components/tooltip/types' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { EMPTY_TOOLTIP , getTooltipInfo } from '../../layout/viewmodel/tooltip_info' ; import { getPartitionSpec } from './partition_spec' ; import { getPickedShapes } from './picked_shapes' ; internal export const getTooltipInfoSelector = createCustomCachedSelector ( [ getPartitionSpec , getPickedShapes ] , ( spec , pickedShapes ) : TooltipInfo => { return spec ? getTooltipInfo ( pickedShapes , spec . layers . map ( ( l ) => l . nodeLabel ) , spec . valueGetter , spec . valueFormatter , spec . percentFormatter , spec . id ) : EMPTY_TOOLTIP ; } ) ;