constructor()

in scripts/dashboard-importer/src/dashboards/converter/converter.ts [62:90]


  constructor(dashboard: GrafanaDashboard, fileName: string) {
    this.fileName = fileName;
    this.grid = new Set<string>();
    this.title = dashboard.title || dashboard.description || '';
    this.gnetId = typeof dashboard.gnetId === 'number' ? dashboard.gnetId :
      undefined;
    this.version = typeof dashboard.version === 'number' ? dashboard.version : 1;

    this.warnings = [];
    this.errors = [];

    this.templating = dashboard.templating;
    this.templateVariables = this.getResult(
      getTemplateVariableMap(this.templating),
      new Map<string, string>(),
    );
    this.yOffSet = 0;
    this.dashboardHeight = 0;

    this.panels = dashboard.panels || [];

    // Rows are a Grafana schema for panel layout used from version 12 - 14
    if (dashboard.rows) {
      // Convert Rows format by calculating and adding x, y, h, w attributes
      this.panels = [...parseRowPanels(dashboard.rows)];
    }

    this.tiles = [];
  }