當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript kbn.calculateInterval函數代碼示例

本文整理匯總了TypeScript中app/core/utils/kbn.calculateInterval函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript calculateInterval函數的具體用法?TypeScript calculateInterval怎麽用?TypeScript calculateInterval使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了calculateInterval函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getIntervals

export function getIntervals(range: TimeRange, lowLimit: string, resolution: number): IntervalValues {
  if (!resolution) {
    return { interval: '1s', intervalMs: 1000 };
  }

  return kbn.calculateInterval(range, resolution, lowLimit);
}
開發者ID:grafana,項目名稱:grafana,代碼行數:7,代碼來源:explore.ts

示例2: getIntervals

export function getIntervals(range: RawTimeRange, datasource: DataSourceApi, resolution: number): IntervalValues {
  if (!datasource || !resolution) {
    return { interval: '1s', intervalMs: 1000 };
  }

  const absoluteRange: RawTimeRange = {
    from: parseDate(range.from, false),
    to: parseDate(range.to, true),
  };

  return kbn.calculateInterval(absoluteRange, resolution, datasource.interval);
}
開發者ID:acedrew,項目名稱:grafana,代碼行數:12,代碼來源:explore.ts

示例3: getIntervals

export function getIntervals(range: RawTimeRange, lowLimit: string, resolution: number): IntervalValues {
  if (!resolution) {
    return { interval: '1s', intervalMs: 1000 };
  }

  const absoluteRange: RawTimeRange = {
    from: parseDate(range.from, false),
    to: parseDate(range.to, true),
  };

  return kbn.calculateInterval(absoluteRange, resolution, lowLimit);
}
開發者ID:gnydick,項目名稱:grafana,代碼行數:12,代碼來源:explore.ts

示例4: calculateInterval

  calculateInterval() {
    var intervalOverride = this.panel.interval;

    // if no panel interval check datasource
    if (intervalOverride) {
      intervalOverride = this.templateSrv.replace(intervalOverride, this.panel.scopedVars);
    } else if (this.datasource && this.datasource.interval) {
      intervalOverride = this.datasource.interval;
    }

    var res = kbn.calculateInterval(this.range, this.resolution, intervalOverride);
    this.interval = res.interval;
    this.intervalMs = res.intervalMs;
  }
開發者ID:,項目名稱:,代碼行數:14,代碼來源:

示例5: updateTimeRange

  updateTimeRange() {
    this.range = this.timeSrv.timeRange();
    this.rangeRaw = this.timeSrv.timeRange(false);

    this.applyPanelTimeOverrides();

    if (this.panel.maxDataPoints) {
      this.resolution = this.panel.maxDataPoints;
    } else {
      this.resolution = Math.ceil($(window).width() * (this.panel.span / 12));
    }

    var panelInterval = this.panel.interval;
    var datasourceInterval = (this.datasource || {}).interval;
    this.interval = kbn.calculateInterval(this.range, this.resolution, panelInterval || datasourceInterval);
  };
開發者ID:1tylermitchell,項目名稱:grafana,代碼行數:16,代碼來源:metrics_panel_ctrl.ts


注:本文中的app/core/utils/kbn.calculateInterval函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。