import React, { PureComponent } from 'react'; import { FieldDisplay, getFieldDisplayValues, PanelProps } from '@grafana/data'; import { DataLinksContextMenu, Gauge, VizRepeater, VizRepeaterRenderValueProps } from '@grafana/ui'; import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu'; import { config } from 'app/core/config'; import { clearNameForSingleSeries } from '../bargauge/BarGaugePanel'; import { GaugeOptions } from './types'; export class GaugePanel extends PureComponent> { renderComponent = ( valueProps: VizRepeaterRenderValueProps, menuProps: DataLinksContextMenuApi ): JSX.Element => { const { options, fieldConfig } = this.props; const { width, height, count, value } = valueProps; const { field, display } = value; const { openMenu, targetClassName } = menuProps; return ( ); }; renderValue = (valueProps: VizRepeaterRenderValueProps): JSX.Element => { const { value } = valueProps; const { getLinks, hasLinks } = value; if (hasLinks && getLinks) { return ( {(api) => { return this.renderComponent(valueProps, api); }} ); } return this.renderComponent(valueProps, {}); }; getValues = (): FieldDisplay[] => { const { data, options, replaceVariables, fieldConfig, timeZone } = this.props; return getFieldDisplayValues({ fieldConfig, reduceOptions: options.reduceOptions, replaceVariables, theme: config.theme2, data: data.series, timeZone, }); }; render() { const { height, width, data, renderCounter, options } = this.props; return ( ); } }