本文整理汇总了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,
}
}
示例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')
}
示例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');
}
}
示例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)
}
示例5:
const denanned = qs_part.filter((q) => !isStrictNaN(q))
示例6: findLastIndex
const nan_index = findLastIndex(qs, (q) => isStrictNaN(q))
示例7: find_last_index
const nan_index = find_last_index(qs, (q) => isStrictNaN(q))