grafana/public/app/plugins/panel/stat/module.tsx
Dominik Prokop 63d25944c4
Minor UI touches (#24371)
* Justify to alignment in stat

* No stats label in inspect

* Use sentence case in panel names

* typos

* typo

* Typo

* Query -> query options

* prettier

* Transformer -> transform data

* Do not show deprecated plugins in the viz picker

* Update viz picker layout
2020-05-08 12:40:42 +02:00

53 lines
1.6 KiB
TypeScript

import { sharedSingleStatMigrationHandler } from '@grafana/ui';
import { PanelPlugin } from '@grafana/data';
import { StatPanelOptions, addStandardDataReduceOptions } from './types';
import { StatPanel } from './StatPanel';
import { statPanelChangedHandler } from './StatMigrations';
export const plugin = new PanelPlugin<StatPanelOptions>(StatPanel)
.useFieldConfig()
.setPanelOptions(builder => {
addStandardDataReduceOptions(builder);
builder
.addRadio({
path: 'colorMode',
name: 'Color mode',
description: 'Color either the value or the background',
defaultValue: 'value',
settings: {
options: [
{ value: 'value', label: 'Value' },
{ value: 'background', label: 'Background' },
],
},
})
.addRadio({
path: 'graphMode',
name: 'Graph mode',
description: 'Stat panel graph / sparkline mode',
defaultValue: 'area',
settings: {
options: [
{ value: 'none', label: 'None' },
{ value: 'area', label: 'Area' },
],
},
})
.addRadio({
path: 'justifyMode',
name: 'Alignment mode',
description: 'Value & title posititioning',
defaultValue: 'auto',
settings: {
options: [
{ value: 'auto', label: 'Auto' },
{ value: 'center', label: 'Center' },
],
},
});
})
.setNoPadding()
.setPanelChangeHandler(statPanelChangedHandler)
.setMigrationHandler(sharedSingleStatMigrationHandler);