import { VizPanel, VizPanelState } from '@grafana/scenes'; import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema'; import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen'; import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/models.gen'; import { TimeSeriesOptions } from 'app/plugins/panel/timeseries/types'; export type TypedVizPanelState = Omit< Partial>, 'pluginId' >; export const panelBuilders = { newTable: (state: TypedVizPanelState) => { return new VizPanel({ ...state, pluginId: 'table', }); }, newGraph: (state: TypedVizPanelState) => { return new VizPanel({ ...state, pluginId: 'timeseries', }); }, newBarGauge: (state: TypedVizPanelState) => { return new VizPanel({ ...state, pluginId: 'bargauge', }); }, };