BarGauge: First bar gauge panel option & some refactoring (#23128)

* First bar gauge panel option

* Update doc comments

* Minor changes

* progress

* Fixing typing errors

* Minor type updates

* Fix that TS!

* Bring satisfaction to that beast called typescript

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Torkel Ödegaard
2020-03-27 12:38:46 +01:00
committed by GitHub
parent 7e094ac559
commit 08133ea31a
19 changed files with 150 additions and 117 deletions

View File

@@ -6,7 +6,14 @@ import { config } from 'app/core/config';
// Types
import { StatPanelOptions } from './types';
import { VizRepeater, BigValue, DataLinksContextMenu, BigValueSparkline, BigValueGraphMode } from '@grafana/ui';
import {
VizRepeater,
VizRepeaterRenderValueProps,
BigValue,
DataLinksContextMenu,
BigValueSparkline,
BigValueGraphMode,
} from '@grafana/ui';
import {
PanelProps,
@@ -21,13 +28,9 @@ import {
import { getFieldLinksSupplier } from 'app/features/panel/panellinks/linkSuppliers';
export class StatPanel extends PureComponent<PanelProps<StatPanelOptions>> {
renderValue = (
value: FieldDisplay,
width: number,
height: number,
alignmentFactors: DisplayValueAlignmentFactors
): JSX.Element => {
renderValue = (valueProps: VizRepeaterRenderValueProps<FieldDisplay, DisplayValueAlignmentFactors>): JSX.Element => {
const { timeRange, options } = this.props;
const { value, alignmentFactors, width, height } = valueProps;
let sparkline: BigValueSparkline | undefined;
if (value.sparkline) {