grafana/public/app/plugins/panel/gauge/module.tsx
Ashley Harrison 970c395fb1
Cue: Use BarGauge, DashList and Gauge panel cue schemas (#49580)
* user essentials mob! 🔱

* Wip

* user essentials mob! 🔱

lastFile:public/app/plugins/panel/bargauge/module.tsx

* user essentials mob! 🔱

* update betterer results file

Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
2022-05-25 14:18:21 +01:00

36 lines
1.3 KiB
TypeScript

import { PanelPlugin } from '@grafana/data';
import { commonOptionsBuilder } from '@grafana/ui';
import { addOrientationOption, addStandardDataReduceOptions } from '../stat/common';
import { gaugePanelMigrationHandler, gaugePanelChangedHandler } from './GaugeMigrations';
import { GaugePanel } from './GaugePanel';
import { PanelOptions, defaultPanelOptions } from './models.gen';
import { GaugeSuggestionsSupplier } from './suggestions';
export const plugin = new PanelPlugin<PanelOptions>(GaugePanel)
.useFieldConfig()
.setPanelOptions((builder) => {
addStandardDataReduceOptions(builder);
addOrientationOption(builder);
builder
.addBooleanSwitch({
path: 'showThresholdLabels',
name: 'Show threshold labels',
description: 'Render the threshold values around the gauge bar',
defaultValue: defaultPanelOptions.showThresholdLabels,
})
.addBooleanSwitch({
path: 'showThresholdMarkers',
name: 'Show threshold markers',
description: 'Renders the thresholds as an outer bar',
defaultValue: defaultPanelOptions.showThresholdMarkers,
});
commonOptionsBuilder.addTextSizeOptions(builder);
})
.setPanelChangeHandler(gaugePanelChangedHandler)
.setSuggestionsSupplier(new GaugeSuggestionsSupplier())
.setMigrationHandler(gaugePanelMigrationHandler);