mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 00:17:09 +08:00
23 lines
527 B
TypeScript
23 lines
527 B
TypeScript
import { autoMigrateAngular } from './PanelModel';
|
|
|
|
export function getPanelPluginToMigrateTo(panel: any): string | undefined {
|
|
// Graph needs special logic as it can be migrated to multiple panels
|
|
if (panel.type === 'graph') {
|
|
if (panel.xaxis?.mode === 'series') {
|
|
if (panel.legend?.values) {
|
|
return 'bargauge';
|
|
}
|
|
|
|
return 'barchart';
|
|
}
|
|
|
|
if (panel.xaxis?.mode === 'histogram') {
|
|
return 'histogram';
|
|
}
|
|
|
|
return 'timeseries';
|
|
}
|
|
|
|
return autoMigrateAngular[panel.type];
|
|
}
|