import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { DataSeries , getSeriesKey } from '../../utils/series' ; import { computeSeriesDomainsSelector } from './compute_series_domains' ; internal export const getSiDataSeriesMapSelector = createCustomCachedSelector ( [ computeSeriesDomainsSelector ] , ( { formattedDataSeries } ) => { return formattedDataSeries . reduce < Record < string , DataSeries > > ( ( acc , dataSeries ) => { const seriesKey = getSeriesKey ( dataSeries , dataSeries . groupId ) ; acc [ seriesKey ] = dataSeries ; return acc ; } , { } ) ; } ) ;