2021-01-22 13:25:39 -08:00
|
|
|
import { PanelPlugin } from '@grafana/data';
|
2021-08-24 08:22:34 -07:00
|
|
|
import { commonOptionsBuilder } from '@grafana/ui';
|
2022-04-22 14:33:13 +01:00
|
|
|
|
2021-01-08 11:06:52 -08:00
|
|
|
import { TimeSeriesPanel } from './TimeSeriesPanel';
|
2022-07-22 20:18:27 -07:00
|
|
|
import { TimezonesEditor } from './TimezonesEditor';
|
2021-05-10 22:25:14 +02:00
|
|
|
import { defaultGraphConfig, getGraphFieldConfig } from './config';
|
2022-04-22 14:33:13 +01:00
|
|
|
import { graphPanelChangedHandler } from './migrations';
|
2023-05-15 23:07:54 -04:00
|
|
|
import { FieldConfig, Options } from './panelcfg.gen';
|
2021-10-25 13:55:06 +02:00
|
|
|
import { TimeSeriesSuggestionsSupplier } from './suggestions';
|
2020-09-24 16:44:35 +02:00
|
|
|
|
2023-05-15 23:07:54 -04:00
|
|
|
export const plugin = new PanelPlugin<Options, FieldConfig>(TimeSeriesPanel)
|
2020-12-08 08:13:39 -08:00
|
|
|
.setPanelChangeHandler(graphPanelChangedHandler)
|
2021-01-10 22:57:48 -08:00
|
|
|
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
|
2021-01-20 07:59:48 +01:00
|
|
|
.setPanelOptions((builder) => {
|
2021-05-11 15:46:12 +02:00
|
|
|
commonOptionsBuilder.addTooltipOptions(builder);
|
2021-05-10 22:25:14 +02:00
|
|
|
commonOptionsBuilder.addLegendOptions(builder);
|
2022-07-22 20:18:27 -07:00
|
|
|
|
|
|
|
|
builder.addCustomEditor({
|
2022-09-10 11:25:27 -05:00
|
|
|
id: 'timezone',
|
2022-07-23 17:49:58 +02:00
|
|
|
name: 'Time zone',
|
2022-09-10 11:25:27 -05:00
|
|
|
path: 'timezone',
|
2022-07-22 20:18:27 -07:00
|
|
|
category: ['Axis'],
|
|
|
|
|
editor: TimezonesEditor,
|
|
|
|
|
defaultValue: undefined,
|
|
|
|
|
});
|
2021-04-27 07:39:02 +02:00
|
|
|
})
|
2021-10-25 13:55:06 +02:00
|
|
|
.setSuggestionsSupplier(new TimeSeriesSuggestionsSupplier())
|
2021-05-03 08:52:05 +02:00
|
|
|
.setDataSupport({ annotations: true, alertStates: true });
|