import React from 'react'; import type uPlot from 'uplot'; import { LocaleInfo } from './utilities/formatTimestamp'; import { AlertPeriod, AlertBarConfig } from './AlertBar'; import { EventAnnotation, EventAnnotationConfig } from './EventAnnotations'; import { Legend } from './Legends'; import { Tooltip } from './Tooltips'; import { Range } from './providers/RangeSelectionProvider'; import type { PlotUtilitiesFn, AxisDisplayProps, AreaOnlyOptions } from './renderers/types'; import { VizThemeKey } from './theme'; import type { AdditionalTooltipValues, AxisRange, GenericDataSet, LegendTruncation, MarkAnnotation, ScaleConfig, SeriesConfig, TimestampFormat } from './types'; export type CrosshairValue = { time: number; seriesKey?: string; index?: number; seriesIndex?: number; value?: number; rowContext?: Record; }; export type CrosshairClickEvent = { time: number; index: number; seriesIndex: number; originalEvent: MouseEvent; seriesKey: string; value?: number; rowContext?: Record; }; export type CrosshairClickEventWResolution = CrosshairClickEvent & { xResolution: number; }; export type PlotDimensions = { root: DOMRect; over: DOMRect; }; export type InternalTimeSeriesChartProps = AxisDisplayProps & AreaOnlyOptions & { id?: string; width: number | string; height: number | string; loading?: boolean; data: GenericDataSet; seriesConfig?: SeriesConfig; scaleConfig?: ScaleConfig; hideXAxis?: true; hideTooltipSeriesLabel?: boolean; legend?: false | Legend; tooltip?: false | Tooltip; /** * Display tooltip values outside chart instead of displaying on chart. * If set to true, tooltip prop is overridden. */ showTooltipOutsideChart?: boolean; onSeriesClick?: (field: string, anchorRef: React.Ref) => void; alerts?: AlertPeriod[]; alertsConfig?: AlertBarConfig; events?: EventAnnotation[]; eventsConfig?: EventAnnotationConfig; marks?: MarkAnnotation[]; /** * Callback that triggers when the chart is initialized. * * The is a workaround for 1 specific team, olly, and should not be relied on. */ onReady?: (utils?: PlotUtilitiesFn, uplotRef?: uPlot) => void; onCrosshairChange?: (crosshairValue?: CrosshairValue) => void; onCrosshairClick?: (event: CrosshairClickEventWResolution) => void; onPinClose?: () => void; onRangeSelection?: (range: Range | undefined, e: MouseEvent) => void; onRangeZoom?: (range: Range, e: MouseEvent) => void; serverSideZoom?: boolean; title?: string; userLocale?: LocaleInfo; range?: AxisRange; /** Toggles the visibility of a given series when it is clicked in the legend. * Note: if this is `true` `onSeriesClick` will not be called */ legendClickTogglesSeriesVisibility?: boolean; /** Maximum number of series that still allows for "closest series focus" functionality to be enabled. * defaults to FOCUS_MAX_SERIES (30) */ maxSeriesFocus?: number; /** X-axis timeseries label format - compact(one-line), expanded (multi-line) * defaults to compact */ timestampFormat?: TimestampFormat; /** Color palette used for series coloring * defaults to VIZ_CATEGORICAL color palette */ seriesColors?: string[]; /** Specify a color for a field in the series * defaults to seriesColors if this option is not set */ seriesColorsByField?: Record; /** * Additional values to display in the tooltip. * Array of objects, one per data point, mapping field names to values. */ additionalTooltipValues?: AdditionalTooltipValues; /** * Ref to additional tooltip values. Used to avoid chart remounts when values change. * Takes precedence over additionalTooltipValues if provided. */ additionalTooltipValuesRef?: React.MutableRefObject; /** Add additional uplot plugins */ plugins?: uPlot.Plugin[]; /** Specify a list of labels to pre-populate the legend */ legendLabels?: string[]; /** Whether we're in series compare mode (affects legend behavior) */ isSeriesCompare?: boolean; /** Controls how legend labels are truncated when they exceed available space */ legendTruncation?: LegendTruncation; }; export type TimeSeriesChartProps = InternalTimeSeriesChartProps & { theme?: VizThemeKey; }; export declare const TimeSeriesChart: React.FC;