import React , { FC } from 'react' ; import { ScaleType , AreaSeries , CurveType } from '@elastic/charts' ; import { ModelItem } from '../../../../common/results_loader' ; import { seriesStyle , useChartColors } from '../common/settings' ; interface Props { modelData ? : ModelItem [ ] ; } const SPEC_ID = 'model' ; const areaSeriesStyle = { ... seriesStyle , area : { ... seriesStyle . area , visible : true , } , line : { ... seriesStyle . line , strokeWidth : 1 , opacity : 0.4 , } , } ; export const ModelBounds = ( { modelData } ) => { const { MODEL_COLOR } = useChartColors ( ) ; const model = modelData === undefined ? [ ] : modelData ; return ( < AreaSeries id = { SPEC_ID } xScaleType = { ScaleType . Time } yScaleType = { ScaleType . Linear } xAccessor = { 'time' } yAccessors = { [ 'modelUpper' ] } y0Accessors = { [ 'modelLower' ] } data = { model } curve = { CurveType . CURVE_MONOTONE_X } areaSeriesStyle = { areaSeriesStyle } color = { MODEL_COLOR } / > ) ; } ;