module.tsx 907 B

12345678910111213141516171819
  1. import { PanelPlugin } from '@grafana/data';
  2. import { GraphFieldConfig } from '@grafana/schema';
  3. import { commonOptionsBuilder } from '@grafana/ui';
  4. import { TimeSeriesPanel } from './TimeSeriesPanel';
  5. import { defaultGraphConfig, getGraphFieldConfig } from './config';
  6. import { graphPanelChangedHandler } from './migrations';
  7. import { TimeSeriesSuggestionsSupplier } from './suggestions';
  8. import { TimeSeriesOptions } from './types';
  9. export const plugin = new PanelPlugin<TimeSeriesOptions, GraphFieldConfig>(TimeSeriesPanel)
  10. .setPanelChangeHandler(graphPanelChangedHandler)
  11. .useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
  12. .setPanelOptions((builder) => {
  13. commonOptionsBuilder.addTooltipOptions(builder);
  14. commonOptionsBuilder.addLegendOptions(builder);
  15. })
  16. .setSuggestionsSupplier(new TimeSeriesSuggestionsSupplier())
  17. .setDataSupport({ annotations: true, alertStates: true });