mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 02:23:31 -06:00
* 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>
36 lines
1.3 KiB
TypeScript
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);
|