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


TypeScript types.isStrictNaN函數代碼示例

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


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

示例1: get_ticks_no_defaults

 // The version of get_ticks() that does the work (and the version that
 // should be overridden in subclasses).
 get_ticks_no_defaults(data_low: number, data_high: number, _cross_loc: any, desired_n_ticks: number) {
   const interval = this.get_interval(data_low, data_high, desired_n_ticks)
   const start_factor = Math.floor(data_low / interval)
   const end_factor   = Math.ceil(data_high / interval)
   let factors: number[]
   if (isStrictNaN(start_factor) || isStrictNaN(end_factor))
     factors = []
   else
     factors = range(start_factor, end_factor + 1)
   const ticks =
     factors.map((factor) => factor*interval)
            .filter((tick) => data_low <= tick && tick <= data_high)
   const num_minor_ticks = this.num_minor_ticks
   const minor_ticks = []
   if (num_minor_ticks > 0 && ticks.length > 0) {
     const minor_interval = interval / num_minor_ticks
     const minor_offsets = range(0, num_minor_ticks).map((i) => i*minor_interval)
     for (const x of minor_offsets.slice(1)) {
       minor_ticks.push(ticks[0] - x)
     }
     for (const tick of ticks) {
       for (const x of minor_offsets) {
         minor_ticks.push(tick + x)
       }
     }
   }
   return {
     major: ticks,
     minor: minor_ticks,
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:33,代碼來源:continuous_ticker.ts

示例2: set_initial_range

 set_initial_range(): void {
   // check for good values for ranges before setting initial range
   let good_vals = true
   const {x_ranges, y_ranges} = this.frame
   const xrs: {[key: string]: Interval} = {}
   const yrs: {[key: string]: Interval} = {}
   for (const name in x_ranges) {
     const {start, end} = x_ranges[name]
     if (start == null || end == null || isStrictNaN(start + end)) {
       good_vals = false
       break
     }
     xrs[name] = {start, end}
   }
   if (good_vals) {
     for (const name in y_ranges) {
       const {start, end} = y_ranges[name]
       if (start == null || end == null || isStrictNaN(start + end)) {
         good_vals = false
         break
       }
       yrs[name] = {start, end}
     }
   }
   if (good_vals) {
     this._initial_state_info.range = {xrs, yrs}
     logger.debug("initial ranges set")
   } else
     logger.warn('could not set initial ranges')
 }
開發者ID:gully,項目名稱:bokeh,代碼行數:30,代碼來源:plot_canvas.ts

示例3: set_initial_range

 set_initial_range() {
   // check for good values for ranges before setting initial range
   let good_vals = true;
   const xrs = {};
   const yrs = {};
   for (const name in this.frame.x_ranges) {
     const rng = this.frame.x_ranges[name];
     if ((rng.start == null) || (rng.end == null) || isStrictNaN(rng.start + rng.end)) {
       good_vals = false;
       break;
     }
     xrs[name] = { start: rng.start, end: rng.end };
   }
   if (good_vals) {
     for (const name in this.frame.y_ranges) {
       const rng = this.frame.y_ranges[name];
       if ((rng.start == null) || (rng.end == null) || isStrictNaN(rng.start + rng.end)) {
         good_vals = false;
         break;
       }
       yrs[name] = { start: rng.start, end: rng.end };
     }
   }
   if (good_vals) {
     this._initial_state_info.range = this.initial_range_info = {xrs, yrs};
     return logger.debug("initial ranges set");
   } else {
     return logger.warn('could not set initial ranges');
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:30,代碼來源:plot_canvas.ts

示例4: _index_data

  protected _index_data(): SpatialIndex {
    const points = []
    for (let i = 0, end = this._xs.length; i < end; i++) {
      if (this._xs[i] == null || this._xs[i].length === 0)
        continue

      const _xsi = this._xs[i]
      const xs: number[] = []
      for (let j = 0, n = _xsi.length; j < n; j++) {
        const x = _xsi[j]
        if (!isStrictNaN(x))
          xs.push(x)
      }

      const _ysi = this._ys[i]
      const ys: number[] = []
      for (let j = 0, n = _ysi.length; j < n; j++) {
        const y = _ysi[j]
        if (!isStrictNaN(y))
          ys.push(y)
      }

      const [minX, maxX] = [min(xs), max(xs)]
      const [minY, maxY] = [min(ys), max(ys)]

      points.push({minX, minY, maxX, maxY, i})
    }

    return new SpatialIndex(points)
  }
開發者ID:digitalsatori,項目名稱:Bokeh,代碼行數:30,代碼來源:multi_line.ts

示例5:

 const denanned = qs_part.filter((q) => !isStrictNaN(q))
開發者ID:gully,項目名稱:bokeh,代碼行數:1,代碼來源:patches.ts

示例6: findLastIndex

 const nan_index = findLastIndex(qs, (q) => isStrictNaN(q))
開發者ID:gully,項目名稱:bokeh,代碼行數:1,代碼來源:patches.ts

示例7: find_last_index

 const nan_index = find_last_index(qs, (q) => isStrictNaN(q))
開發者ID:digitalsatori,項目名稱:Bokeh,代碼行數:1,代碼來源:patches.ts


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