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