import React, { useMemo } from 'react'; import { PanelProps } from '@grafana/data'; import { TooltipPlugin, useTheme2, ZoomPlugin } from '@grafana/ui'; import { StatusPanelOptions } from './types'; import { TimelineChart } from '../state-timeline/TimelineChart'; import { TimelineMode } from '../state-timeline/types'; import { prepareTimelineFields, prepareTimelineLegendItems } from '../state-timeline/utils'; interface TimelinePanelProps extends PanelProps {} /** * @alpha */ export const StatusHistoryPanel: React.FC = ({ data, timeRange, timeZone, options, width, height, onChangeTimeRange, }) => { const theme = useTheme2(); const { frames, warn } = useMemo(() => prepareTimelineFields(data?.series, false), [data]); const legendItems = useMemo(() => prepareTimelineLegendItems(frames, options.legend, theme), [ frames, options.legend, theme, ]); if (!frames || warn) { return (

{warn ?? 'No data found in response'}

); } // Status grid requires some space between values if (frames[0].length > width / 2) { return (

Too many points to visualize properly.
Update the query to return fewer points.
({frames[0].length} points recieved)

); } return ( {(config, alignedFrame) => { return ( <> ); }} ); };