mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
StateTimeline: Properly type tooltip prop, remove ts-ignore (#83189)
This commit is contained in:
parent
0dcdfc261b
commit
dbbbfa282d
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DataFrame, FALLBACK_COLOR, FieldType, TimeRange } from '@grafana/data';
|
||||
import { VisibilityMode, TimelineValueAlignment, TooltipDisplayMode } from '@grafana/schema';
|
||||
import { VisibilityMode, TimelineValueAlignment, TooltipDisplayMode, VizTooltipOptions } from '@grafana/schema';
|
||||
import { PanelContext, PanelContextRoot, UPlotConfigBuilder, VizLayout, VizLegend, VizLegendItem } from '@grafana/ui';
|
||||
|
||||
import { GraphNG, GraphNGProps } from '../GraphNG/GraphNG';
|
||||
@ -18,6 +18,7 @@ export interface TimelineProps extends Omit<GraphNGProps, 'prepConfig' | 'propsT
|
||||
alignValue?: TimelineValueAlignment;
|
||||
colWidth?: number;
|
||||
legendItems?: VizLegendItem[];
|
||||
tooltip?: VizTooltipOptions;
|
||||
}
|
||||
|
||||
const propsToDiff = ['rowHeight', 'colWidth', 'showValue', 'mergeValues', 'alignValue', 'tooltip'];
|
||||
@ -58,7 +59,7 @@ export class TimelineChart extends React.Component<TimelineProps> {
|
||||
// When there is only one row, use the full space
|
||||
rowHeight: alignedFrame.fields.length > 2 ? this.props.rowHeight : 1,
|
||||
getValueColor: this.getValueColor,
|
||||
// @ts-ignore
|
||||
|
||||
hoverMulti: this.props.tooltip?.mode === TooltipDisplayMode.Multi,
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user