;
+type FacetValues = any[];
+type FacetSeries = FacetValues[];
+type FacetedData = [_: null, ...series: FacetSeries];
+interface PlotProps {
+ data: AlignedData | FacetedData;
+ width: number;
+ height: number;
+ config: UPlotConfigBuilder;
+ children?: React__default.ReactNode;
+ plotRef?: (u: uPlot) => void;
+}
+declare abstract class PlotConfigBuilder {
+ props: P;
+ constructor(props: P);
+ abstract getConfig(): T;
+}
+/**
+ * @alpha
+ */
+type PlotTooltipInterpolator = (updateActiveSeriesIdx: (sIdx: number | null) => void, updateActiveDatapointIdx: (dIdx: number | null) => void, updateTooltipPosition: (clear?: boolean) => void, u: uPlot) => void;
+interface PlotSelection {
+ min: number;
+ max: number;
+ bbox: {
+ top: number;
+ left: number;
+ width: number;
+ height: number;
+ };
+}
+
+/** @internal */
+interface StackingGroup {
+ series: number[];
+ dir: StackDirection;
+}
+/** @internal */
+declare const enum StackDirection {
+ Pos = 1,
+ Neg = -1
+}
+
+interface AxisProps {
+ scaleKey: string;
+ theme: GrafanaTheme2;
+ label?: string;
+ show?: boolean;
+ size?: number | null;
+ gap?: number;
+ tickLabelRotation?: number;
+ placement?: AxisPlacement;
+ grid?: Axis.Grid;
+ ticks?: Axis.Ticks;
+ filter?: Axis.Filter;
+ space?: Axis.Space;
+ formatValue?: (v: any, decimals?: DecimalCount) => string;
+ incrs?: Axis.Incrs;
+ splits?: Axis.Splits;
+ values?: Axis.Values;
+ isTime?: boolean;
+ timeZone?: TimeZone;
+ color?: uPlot.Axis.Stroke;
+ border?: uPlot.Axis.Border;
+ decimals?: DecimalCount;
+ distr?: ScaleDistribution;
+}
+declare const UPLOT_AXIS_FONT_SIZE = 12;
+
+interface ScaleProps {
+ scaleKey: string;
+ isTime?: boolean;
+ min?: number | null;
+ max?: number | null;
+ softMin?: number | null;
+ softMax?: number | null;
+ range?: Scale.Range;
+ distribution?: ScaleDistribution;
+ orientation: ScaleOrientation;
+ direction: ScaleDirection;
+ log?: number;
+ linearThreshold?: number;
+ centeredZero?: boolean;
+ decimals?: DecimalCount;
+}
+
+interface SeriesProps extends LineConfig, BarConfig, FillConfig, PointsConfig {
+ scaleKey: string;
+ pxAlign?: boolean;
+ gradientMode?: GraphGradientMode;
+ dynamicSeriesColor?: (seriesIdx: number) => string | undefined;
+ facets?: uPlot.Series.Facet[];
+ /** Used when gradientMode is set to Scheme */
+ thresholds?: ThresholdsConfig;
+ colorMode?: FieldColorMode;
+ hardMin?: number | null;
+ hardMax?: number | null;
+ softMin?: number | null;
+ softMax?: number | null;
+ drawStyle?: GraphDrawStyle;
+ pathBuilder?: Series.PathBuilder | null;
+ pointsFilter?: Series.Points.Filter | null;
+ pointsBuilder?: Series.Points.Show | null;
+ show?: boolean;
+ dataFrameFieldIndex?: DataFrameFieldIndex;
+ theme: GrafanaTheme2;
+ value?: uPlot.Series.Value;
+}
+declare class UPlotSeriesBuilder extends PlotConfigBuilder {
+ getConfig(): {
+ show: boolean;
+ class?: string | undefined;
+ scale: string;
+ auto?: boolean | undefined;
+ sorted?: Series.Sorted | undefined;
+ spanGaps: boolean | undefined;
+ gaps?: Series.GapsRefiner | undefined;
+ pxAlign: number | boolean | undefined;
+ label?: string | undefined;
+ value: Series.Value;
+ values?: Series.Values | undefined;
+ paths?: Series.PathBuilder | undefined;
+ points?: Series.Points | undefined;
+ facets: Series.Facet[] | undefined;
+ width?: number | undefined;
+ stroke?: Series.Stroke | undefined;
+ fill: Series.Fill | undefined;
+ fillTo?: Series.FillTo | undefined;
+ dash?: number[] | undefined;
+ cap?: CanvasLineCap | undefined;
+ alpha?: number | undefined;
+ idxs?: Series.MinMaxIdxs | undefined;
+ min?: number | undefined;
+ max?: number | undefined;
+ };
+ private getLineColor;
+ private getFill;
+}
+
+interface UPlotThresholdOptions {
+ scaleKey: string;
+ thresholds: ThresholdsConfig;
+ config: GraphThresholdsStyleConfig;
+ theme: GrafanaTheme2;
+ hardMin?: number | null;
+ hardMax?: number | null;
+ softMin?: number | null;
+ softMax?: number | null;
+}
+
+type PrepData = (frames: DataFrame[]) => AlignedData | FacetedData;
+type PreDataStacked = (frames: DataFrame[], stackingGroups: StackingGroup[]) => AlignedData | FacetedData;
+declare class UPlotConfigBuilder {
+ series: UPlotSeriesBuilder[];
+ private axes;
+ private scales;
+ private bands;
+ private stackingGroups;
+ private cursor;
+ private select;
+ private hasLeftAxis;
+ private hooks;
+ private tz;
+ private sync;
+ private mode;
+ private frames;
+ private thresholds;
+ private tooltipInterpolator;
+ private padding?;
+ private cachedConfig?;
+ prepData: PrepData | undefined;
+ constructor(timeZone?: TimeZone);
+ scaleKeys: [string, string];
+ addHook(type: T, hook: Hooks.Defs[T]): void;
+ addThresholds(options: UPlotThresholdOptions): void;
+ addAxis(props: AxisProps): void;
+ getAxisPlacement(scaleKey: string): AxisPlacement;
+ setCursor(cursor?: Cursor): void;
+ setMode(mode: uPlot.Mode): void;
+ setSelect(select: Select$2): void;
+ addSeries(props: SeriesProps): void;
+ getSeries(): UPlotSeriesBuilder[];
+ /** Add or update the scale with the scale key */
+ addScale(props: ScaleProps): void;
+ addBand(band: Band): void;
+ setStackingGroups(groups: StackingGroup[]): void;
+ getStackingGroups(): StackingGroup[];
+ setTooltipInterpolator(interpolator: PlotTooltipInterpolator): void;
+ getTooltipInterpolator(): PlotTooltipInterpolator | undefined;
+ setPrepData(prepData: PreDataStacked): void;
+ setSync(): void;
+ hasSync(): boolean;
+ setPadding(padding: Padding): void;
+ getConfig(): PlotConfig;
+ private tzDate;
+ private ensureNonOverlappingAxes;
+}
+type Renderers = Array<{
+ fieldMap: Record;
+ indicesOnly: string[];
+ init: (config: UPlotConfigBuilder, fieldIndices: Record) => void;
+}>;
+/** @alpha */
+type UPlotConfigPrepOpts = {}> = {
+ frame: DataFrame;
+ theme: GrafanaTheme2;
+ timeZones: TimeZone[];
+ getTimeRange: () => TimeRange;
+ eventBus: EventBus;
+ allFrames: DataFrame[];
+ renderers?: Renderers;
+ tweakScale?: (opts: ScaleProps, forField: Field$1) => ScaleProps;
+ tweakAxis?: (opts: AxisProps, forField: Field$1) => AxisProps;
+ eventsScope?: string;
+ hoverProximity?: number;
+} & T;
+/** @alpha */
+type UPlotConfigPrepFn = (opts: UPlotConfigPrepOpts) => UPlotConfigBuilder;
+
+interface SparklineProps extends Themeable2 {
+ width: number;
+ height: number;
+ config?: FieldConfig;
+ sparkline: FieldSparkline;
+}
+interface State$4 {
+ data: AlignedData;
+ alignedDataFrame: DataFrame;
+ configBuilder: UPlotConfigBuilder;
+}
+/** @internal */
+declare class Sparkline extends PureComponent {
+ constructor(props: SparklineProps);
+ static getDerivedStateFromProps(props: SparklineProps, state: State$4): {
+ data: AlignedData;
+ alignedDataFrame: DataFrame;
+ configBuilder: UPlotConfigBuilder;
+ };
+ componentDidUpdate(prevProps: SparklineProps, prevState: State$4): void;
+ getYRange(field: Field$1): Range.MinMax;
+ prepareConfig(data: DataFrame): UPlotConfigBuilder;
+ render(): React__default.JSX.Element;
+}
+
+interface Props$H {
+ height: number;
+ field: FieldConfig;
+ showThresholdMarkers: boolean;
+ showThresholdLabels: boolean;
+ width: number;
+ value: DisplayValue;
+ text?: VizTextDisplayOptions;
+ onClick?: React__default.MouseEventHandler;
+ className?: string;
+ theme: GrafanaTheme2;
+ orientation?: VizOrientation;
+}
+declare class Gauge extends PureComponent {
+ canvasElement: HTMLDivElement | null;
+ static defaultProps: Partial;
+ componentDidMount(): void;
+ componentDidUpdate(): void;
+ draw(): void;
+ renderVisualization: () => React__default.JSX.Element;
+ render(): React__default.JSX.Element;
+}
+
+interface Props$G extends Themeable2 {
+ height: number;
+ width: number;
+ field: FieldConfig;
+ display?: DisplayProcessor;
+ value: DisplayValue;
+ orientation: VizOrientation$1;
+ text?: VizTextDisplayOptions;
+ itemSpacing?: number;
+ lcdCellWidth?: number;
+ displayMode: BarGaugeDisplayMode;
+ onClick?: React__default.MouseEventHandler;
+ className?: string;
+ showUnfilled?: boolean;
+ alignmentFactors?: DisplayValueAlignmentFactors;
+ valueDisplayMode?: BarGaugeValueMode;
+ namePlacement?: BarGaugeNamePlacement;
+}
+declare class BarGauge extends PureComponent {
+ static defaultProps: Partial;
+ render(): React__default.JSX.Element;
+ renderBarAndValue(): React__default.ReactNode;
+ renderBasicAndGradientBars(): ReactNode;
+ renderRetroBars(): ReactNode;
+}
+
+interface FlotPosition {
+ pageX: number;
+ pageY: number;
+ x: number;
+ x1: number;
+ y: number;
+ y1: number;
+}
+type ActiveDimensions = {
+ [key in keyof T]: [number, number | undefined] | null;
+};
+interface VizTooltipContentProps {
+ dimensions: T;
+ activeDimensions?: ActiveDimensions;
+ timeZone?: TimeZone;
+ pos: FlotPosition;
+ mode: TooltipDisplayMode;
+}
+interface VizTooltipProps {
+ /** Element used as tooltips content */
+ content?: React__default.ReactElement;
+ /** Optional component to be used as a tooltip content */
+ tooltipComponent?: React__default.ComponentType>;
+ /** x/y position relative to the window */
+ position?: {
+ x: number;
+ y: number;
+ };
+ /** x/y offset relative to tooltip origin element, i.e. graph's datapoint */
+ offset?: {
+ x: number;
+ y: number;
+ };
+ mode?: TooltipDisplayMode;
+}
+/**
+ * @public
+ */
+declare const VizTooltip: {
+ ({ content, position, offset }: VizTooltipProps): React__default.JSX.Element | null;
+ displayName: string;
+};
+
+/**
+ * @public
+ */
+interface VizTooltipContainerProps extends HTMLAttributes {
+ position: {
+ x: number;
+ y: number;
+ };
+ offset: {
+ x: number;
+ y: number;
+ };
+ children?: React__default.ReactNode;
+ allowPointerEvents?: boolean;
+}
+/**
+ * @public
+ */
+declare const VizTooltipContainer: {
+ ({ position: { x: positionX, y: positionY }, offset: { x: offsetX, y: offsetY }, children, allowPointerEvents, className, ...otherProps }: VizTooltipContainerProps): React__default.JSX.Element;
+ displayName: string;
+};
+
+/**
+ * @public
+ */
+interface SeriesTableRowProps {
+ color?: string;
+ label?: React__default.ReactNode;
+ value?: string | GraphSeriesValue;
+ isActive?: boolean;
+}
+/**
+ * @public
+ */
+declare const SeriesTableRow: ({ color, label, value, isActive }: SeriesTableRowProps) => React__default.JSX.Element;
+/**
+ * @public
+ */
+interface SeriesTableProps {
+ timestamp?: string | GraphSeriesValue;
+ series: SeriesTableRowProps[];
+}
+/**
+ * @public
+ */
+declare const SeriesTable: ({ timestamp, series }: SeriesTableProps) => React__default.JSX.Element;
+
+interface Props$F {
+ /**
+ * Optionally precalculate dimensions to support consistent behavior between repeated
+ * values. Two typical patterns are:
+ * 1) Calculate raw values like font size etc and pass them to each vis
+ * 2) find the maximum input values and pass that to the vis
+ */
+ getAlignmentFactors?: (values: V[], width: number, height: number) => D;
+ /**
+ * Render a single value
+ */
+ renderValue: (props: VizRepeaterRenderValueProps) => JSX.Element;
+ height: number;
+ width: number;
+ source: unknown;
+ getValues: () => V[];
+ renderCounter: number;
+ orientation: VizOrientation$1;
+ itemSpacing?: number;
+ /** When orientation is set to auto layout items in a grid */
+ autoGrid?: boolean;
+ minVizWidth?: number;
+ minVizHeight?: number;
+ maxVizHeight?: number;
+}
+interface VizRepeaterRenderValueProps {
+ value: V;
+ width: number;
+ height: number;
+ orientation: VizOrientation$1;
+ alignmentFactors: D;
+ /**
+ * Total number of values being shown in repeater
+ */
+ count: number;
+}
+interface DefaultProps {
+ itemSpacing: number;
+}
+interface State$3 {
+ values: V[];
+}
+declare class VizRepeater extends PureComponent, State$3> {
+ static defaultProps: DefaultProps;
+ constructor(props: Props$F);
+ componentDidUpdate(prevProps: Props$F): void;
+ getOrientation(): VizOrientation$1;
+ renderGrid(): React__default.JSX.Element;
+ render(): React__default.JSX.Element;
+}
+
+/**
+ * @internal
+ */
+type LoadingIndicatorProps = {
+ loading: boolean;
+ onCancel: () => void;
+};
+/**
+ * @internal
+ */
+declare const LoadingIndicator: ({ onCancel, loading }: LoadingIndicatorProps) => React__default.JSX.Element | null;
+
+/**
+ * @internal
+ */
+type PanelChromeProps = (AutoSize | FixedDimensions) & (Collapsible | HoverHeader);
+interface BaseProps {
+ padding?: PanelPadding;
+ title?: string | React__default.ReactElement;
+ description?: string | (() => string);
+ titleItems?: ReactNode;
+ menu?: ReactElement | (() => ReactElement);
+ dragClass?: string;
+ dragClassCancel?: string;
+ /**
+ * Use only to indicate loading or streaming data in the panel.
+ * Any other values of loadingState are ignored.
+ */
+ loadingState?: LoadingState;
+ /**
+ * Used to display status message (used for panel errors currently)
+ */
+ statusMessage?: string;
+ /**
+ * Handle opening error details view (like inspect / error tab)
+ */
+ statusMessageOnClick?: (e: React__default.SyntheticEvent) => void;
+ /**
+ * @deprecated use `actions' instead
+ **/
+ leftItems?: ReactNode[];
+ actions?: ReactNode;
+ displayMode?: 'default' | 'transparent';
+ onCancelQuery?: () => void;
+ /**
+ * callback when opening the panel menu
+ */
+ onOpenMenu?: () => void;
+}
+interface FixedDimensions extends BaseProps {
+ width: number;
+ height: number;
+ children: (innerWidth: number, innerHeight: number) => ReactNode;
+}
+interface AutoSize extends BaseProps {
+ width?: never;
+ height?: never;
+ children: ReactNode;
+}
+interface Collapsible {
+ collapsible: boolean;
+ collapsed?: boolean;
+ /**
+ * callback when collapsing or expanding the panel
+ */
+ onToggleCollapse?: (collapsed: boolean) => void;
+ hoverHeader?: never;
+ hoverHeaderOffset?: never;
+}
+interface HoverHeader {
+ collapsible?: never;
+ collapsed?: never;
+ onToggleCollapse?: never;
+ hoverHeader?: boolean;
+ hoverHeaderOffset?: number;
+}
+/**
+ * @internal
+ */
+type PanelPadding = 'none' | 'md';
+
+type TitleItemProps = {
+ className?: string;
+ children: React__default.ReactNode;
+ onClick?: LinkModel['onClick'];
+ href?: string;
+ target?: LinkTarget;
+ title?: string;
+};
+type TitleItemElement = HTMLAnchorElement & HTMLButtonElement;
+declare const TitleItem: React__default.ForwardRefExoticComponent>;
+
+/**
+ * Mode to describe if a legend is isolated/selected or being appended to an existing
+ * series selection.
+ * @alpha
+ */
+declare enum SeriesVisibilityChangeMode {
+ ToggleSelection = "select",
+ AppendToSelection = "append"
+}
+
+/** @alpha */
+interface PanelContext {
+ /** Identifier for the events scope */
+ eventsScope: string;
+ eventBus: EventBus;
+ /** Dashboard panels sync */
+ sync?: () => DashboardCursorSync;
+ /** Information on what the outer container is */
+ app?: CoreApp | 'string';
+ /**
+ * Called when a component wants to change the color for a series
+ *
+ * @alpha -- experimental
+ */
+ onSeriesColorChange?: (label: string, color: string) => void;
+ onToggleSeriesVisibility?: (label: string, mode: SeriesVisibilityChangeMode) => void;
+ canAddAnnotations?: () => boolean;
+ canEditAnnotations?: (dashboardUID?: string) => boolean;
+ canDeleteAnnotations?: (dashboardUID?: string) => boolean;
+ onAnnotationCreate?: (annotation: AnnotationEventUIModel) => void;
+ onAnnotationUpdate?: (annotation: AnnotationEventUIModel) => void;
+ onAnnotationDelete?: (id: string) => void;
+ /**
+ * Used from visualizations like Table to add ad-hoc filters from cell values
+ */
+ onAddAdHocFilter?: (item: AdHocFilterItem) => void;
+ /**
+ * Enables modifying thresholds directly from the panel
+ *
+ * @alpha -- experimental
+ */
+ canEditThresholds?: boolean;
+ /**
+ * Shows threshold indicators on the right-hand side of the panel
+ *
+ * @alpha -- experimental
+ */
+ showThresholds?: boolean;
+ /**
+ * Called when a panel wants to change default thresholds configuration
+ *
+ * @alpha -- experimental
+ */
+ onThresholdsChange?: (thresholds: ThresholdsConfig) => void;
+ /** For instance state that can be shared between panel & options UI */
+ instanceState?: any;
+ /** Update instance state, this is only supported in dashboard panel context currently */
+ onInstanceStateChange?: (state: any) => void;
+ /**
+ * Called when a panel is changing the sort order of the legends.
+ */
+ onToggleLegendSort?: (sortBy: string) => void;
+ /**
+ * Optional, only some contexts support this. This action can be cancelled by user which will result
+ * in a the Promise resolving to a false value.
+ */
+ onUpdateData?: (frames: DataFrame[]) => Promise;
+ /**
+ * Optional supplier for internal data links. If not provided a link pointing to Explore will be generated.
+ * @internal
+ */
+ dataLinkPostProcessor?: DataLinkPostProcessor;
+}
+declare const PanelContextRoot: React__default.Context;
+/**
+ * @alpha
+ */
+declare const PanelContextProvider: React__default.Provider;
+/**
+ * @alpha
+ */
+declare const usePanelContext: () => PanelContext;
+
+/**
+ * @internal
+ */
+interface PanelChromeType extends React__default.FC {
+ LoadingIndicator: typeof LoadingIndicator;
+ TitleItem: typeof TitleItem;
+}
+/**
+ * @internal
+ */
+declare const PanelChrome: PanelChromeType;
+
+/**
+ * @beta
+ */
+interface VizLayoutProps {
+ width: number;
+ height: number;
+ legend?: React__default.ReactElement | null;
+ children: (width: number, height: number) => React__default.ReactNode;
+}
+/**
+ * @beta
+ */
+interface VizLayoutComponentType extends FC {
+ Legend: ComponentType