mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* FieldConfig: Some name change suggestions and moving defaults to PanelPlugin * More name changes
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { PanelPlugin } from '@grafana/data';
|
|
import { GaugePanelEditor } from './GaugePanelEditor';
|
|
import { GaugePanel } from './GaugePanel';
|
|
import { GaugeOptions, defaults } from './types';
|
|
import { addStandardDataReduceOptions } from '../stat/types';
|
|
import { gaugePanelMigrationHandler, gaugePanelChangedHandler } from './GaugeMigrations';
|
|
|
|
export const plugin = new PanelPlugin<GaugeOptions>(GaugePanel)
|
|
.setDefaults(defaults)
|
|
.setEditor(GaugePanelEditor)
|
|
.setPanelOptions(builder => {
|
|
addStandardDataReduceOptions(builder);
|
|
|
|
builder
|
|
.addBooleanSwitch({
|
|
id: 'showThresholdLabels',
|
|
name: 'Show threshold Labels',
|
|
description: 'Render the threshold values around the gauge bar',
|
|
})
|
|
.addBooleanSwitch({
|
|
id: 'showThresholdMarkers',
|
|
name: 'Show threshold markers',
|
|
description: 'Renders the thresholds as an outer bar',
|
|
});
|
|
})
|
|
.setPanelChangeHandler(gaugePanelChangedHandler)
|
|
.setMigrationHandler(gaugePanelMigrationHandler)
|
|
.useStandardFieldConfig();
|