mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* 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>
37 lines
1.3 KiB
TypeScript
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);
|