import { ChartType } from '../../..' ; import { SpecType } from '../../../../specs/constants' ; import { GlobalChartState } from '../../../../state/chart_state' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { getChartThemeSelector } from '../../../../state/selectors/get_chart_theme' ; import { getSpecsFromStore } from '../../../../state/utils' ; import { nullShapeViewModel , ShapeViewModel } from '../../layout/types/viewmodel_types' ; import { WordcloudSpec } from '../../specs' ; import { render } from './scenegraph' ; const getSpecs = ( state ) => state . specs ; const getParentDimensions = ( state ) => state . parentDimensions ; internal export const geometries = createCustomCachedSelector ( [ getSpecs , getChartThemeSelector , getParentDimensions ] , ( specs , theme , parentDimensions ) : ShapeViewModel => { const wordcloudSpecs = getSpecsFromStore < WordcloudSpec > ( specs , ChartType . Wordcloud , SpecType . Series ) ; return wordcloudSpecs . length === 1 ? render ( wordcloudSpecs [ 0 ] , theme , parentDimensions ) : nullShapeViewModel ( ) ; } ) ;