Files
grafana/public/app/plugins/panel/bargauge/module.tsx
Torkel Ödegaard b10392733d FieldConfig: Unify the custom and standard registry (#23307)
* FieldConfig: Unifying standard and custom registry

* Adding path to option items to make id be prefixed for custom options

* Code updates progress

* Add docs back

* Fix TS

* ld overrides tests from ui to data

* Refactor - rename

* Gauge and table cleanup

* F-I-X e2e

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-04-06 16:24:41 +02:00

37 lines
1.3 KiB
TypeScript

import { sharedSingleStatPanelChangedHandler } from '@grafana/ui';
import { PanelPlugin } from '@grafana/data';
import { BarGaugePanel } from './BarGaugePanel';
import { BarGaugeOptions, defaults } from './types';
import { addStandardDataReduceOptions } from '../stat/types';
import { BarGaugePanelEditor } from './BarGaugePanelEditor';
import { barGaugePanelMigrationHandler } from './BarGaugeMigrations';
export const plugin = new PanelPlugin<BarGaugeOptions>(BarGaugePanel)
.setDefaults(defaults)
.setEditor(BarGaugePanelEditor)
.useFieldConfig()
.setPanelOptions(builder => {
addStandardDataReduceOptions(builder);
builder
.addRadio({
path: 'displayMode',
name: 'Display mode',
description: 'Controls the bar style',
settings: {
options: [
{ value: 'basic', label: 'Basic' },
{ value: 'gradient', label: 'Gradient' },
{ value: 'lcd', label: 'Retro LCD' },
],
},
})
.addBooleanSwitch({
path: 'showUnfilled',
name: 'Show unfilled area',
description: 'When enabled renders the unfilled region as gray',
});
})
.setPanelChangeHandler(sharedSingleStatPanelChangedHandler)
.setMigrationHandler(barGaugePanelMigrationHandler);