import React , { lazy } from 'react' ; import { XYChartSeriesIdentifier , GeometryValue } from '@elastic/charts' ; import { IUiSettingsClient } from 'src/core/public' ; import { PersistedState } from 'src/plugins/visualizations/public' ; import { PaletteRegistry } from 'src/plugins/charts/public' ; import { TimeseriesVisParams } from '../../../types' ; import type { TimeseriesVisData , PanelData } from '../../../../common/types' ; import type { FieldFormatMap } from '../../../../../../data/common' ; /**
 * Lazy load each visualization type, since the only one is presented on the screen at the same time.
 * Disable typescript errors since the components are not typed yet.
 */ const timeseries = lazy ( ( ) => import ( './timeseries/vis' ) ) ; const metric = lazy ( ( ) => import ( './metric/vis' ) ) ; const topN = lazy ( ( ) => import ( './top_n/vis' ) ) ; const table = lazy ( ( ) => import ( './table/vis' ) ) ; const gauge = lazy ( ( ) => import ( './gauge/vis' ) ) ; const markdown = lazy ( ( ) => import ( './markdown/vis' ) ) ; export const TimeseriesVisTypes = { timeseries , metric , top_n : topN , table , gauge , markdown , } ; export interface TimeseriesVisProps { model : TimeseriesVisParams ; onBrush : ( gte : string , lte : string , series : PanelData [ ] ) => Promise < void > ; onFilterClick : ( series : PanelData [ ] , points : Array < [ GeometryValue , XYChartSeriesIdentifier ] > ) => Promise < void > ; onUiState : ( field : string , value : { column : string ; order : string ; } ) => void ; uiState : PersistedState ; visData : TimeseriesVisData ; getConfig : IUiSettingsClient [ 'get' ] ; syncColors : boolean ; palettesService : PaletteRegistry ; fieldFormatMap ? : FieldFormatMap ; }