当前位置: 首页>>代码示例>>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;未经允许,请勿转载。