mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* remove text alignment, per-box hover for grid, fix mergeValues * unconditionally set spanNulls = -1 * fix stroke width offset math * split multi-hover, so only single mark overlays in grid mode * restore alignValue in state-timeline * better descriptions, maybe * init field.config.custom if necessary * don't show last out-of-view value Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
79 lines
2.0 KiB
TypeScript
Executable File
79 lines
2.0 KiB
TypeScript
Executable File
import { FieldColorModeId, FieldConfigProperty, PanelPlugin } from '@grafana/data';
|
|
import { StatusGridPanel } from './StatusGridPanel';
|
|
import { StatusPanelOptions, StatusFieldConfig, defaultStatusFieldConfig } from './types';
|
|
import { BarValueVisibility } from '@grafana/ui';
|
|
|
|
export const plugin = new PanelPlugin<StatusPanelOptions, StatusFieldConfig>(StatusGridPanel)
|
|
.useFieldConfig({
|
|
standardOptions: {
|
|
[FieldConfigProperty.Color]: {
|
|
settings: {
|
|
byValueSupport: true,
|
|
},
|
|
defaultValue: {
|
|
mode: FieldColorModeId.PaletteClassic,
|
|
},
|
|
},
|
|
},
|
|
useCustomConfig: (builder) => {
|
|
builder
|
|
.addSliderInput({
|
|
path: 'lineWidth',
|
|
name: 'Line width',
|
|
defaultValue: defaultStatusFieldConfig.lineWidth,
|
|
settings: {
|
|
min: 0,
|
|
max: 10,
|
|
step: 1,
|
|
},
|
|
})
|
|
.addSliderInput({
|
|
path: 'fillOpacity',
|
|
name: 'Fill opacity',
|
|
defaultValue: defaultStatusFieldConfig.fillOpacity,
|
|
settings: {
|
|
min: 0,
|
|
max: 100,
|
|
step: 1,
|
|
},
|
|
});
|
|
},
|
|
})
|
|
.setPanelOptions((builder) => {
|
|
builder
|
|
.addRadio({
|
|
path: 'showValue',
|
|
name: 'Show values',
|
|
settings: {
|
|
options: [
|
|
{ value: BarValueVisibility.Auto, label: 'Auto' },
|
|
{ value: BarValueVisibility.Always, label: 'Always' },
|
|
{ value: BarValueVisibility.Never, label: 'Never' },
|
|
],
|
|
},
|
|
defaultValue: BarValueVisibility.Auto,
|
|
})
|
|
.addSliderInput({
|
|
path: 'rowHeight',
|
|
name: 'Row height',
|
|
defaultValue: 0.9,
|
|
settings: {
|
|
min: 0,
|
|
max: 1,
|
|
step: 0.01,
|
|
},
|
|
})
|
|
.addSliderInput({
|
|
path: 'colWidth',
|
|
name: 'Column width',
|
|
defaultValue: 0.9,
|
|
settings: {
|
|
min: 0,
|
|
max: 1,
|
|
step: 0.01,
|
|
},
|
|
});
|
|
|
|
//addLegendOptions(builder);
|
|
});
|