import React from 'react' ; import { ChartType } from '../..' ; import { DEFAULT_CSS_CURSOR } from '../../../common/constants' ; import { LegendItem } from '../../../common/legend' ; import { InternalChartState , GlobalChartState } from '../../../state/chart_state' ; import { InitStatus } from '../../../state/selectors/get_internal_is_intialized' ; import { LegendItemLabel } from '../../../state/selectors/get_legend_items_labels' ; import { DebugState } from '../../../state/types' ; import { Dimensions } from '../../../utils/dimensions' ; import { EMPTY_TOOLTIP } from '../../partition_chart/layout/viewmodel/tooltip_info' ; import { Wordcloud } from '../renderer/svg/connected_component' ; import { getSpecOrNull } from './selectors/wordcloud_spec' ; const EMPTY_MAP = new Map ( ) ; const EMPTY_LEGEND_LIST = [ ] ; const EMPTY_LEGEND_ITEM_LIST = [ ] ; internal export class WordcloudState implements InternalChartState { chartType = ChartType . Wordcloud ; isInitialized ( globalState ) { return getSpecOrNull ( globalState ) !== null ? InitStatus . Initialized : InitStatus . ChartNotInitialized ; } isBrushAvailable ( ) { return false ; } isBrushing ( ) { return false ; } isChartEmpty ( ) { return false ; } getLegendItems ( ) { return EMPTY_LEGEND_LIST ; } getLegendItemsLabels ( ) { return EMPTY_LEGEND_ITEM_LIST ; } getLegendExtraValues ( ) { return EMPTY_MAP ; } chartRenderer ( ) { return < Wordcloud />; } getPointerCursor ( ) { return DEFAULT_CSS_CURSOR ; } isTooltipVisible ( ) { return { visible : false , isExternal : false } ; } getTooltipInfo ( ) { return EMPTY_TOOLTIP ; } getTooltipAnchor ( state ) { const { position } = state . interactions . pointer . current ; return { isRotated : false , x : position . x , width : 0 , y : position . y , height : 0 , } ; } eventCallbacks ( ) { } getChartTypeDescription ( ) { return 'Word cloud chart' ; } getProjectionContainerArea ( ) { return { width : 0 , height : 0 , top : 0 , left : 0 } ; } getMainProjectionArea ( ) { return { width : 0 , height : 0 , top : 0 , left : 0 } ; } getBrushArea ( ) { return null ; } getDebugState ( ) { return { } ; } }