本文へ移動

@eightkk/vue-weave / core / timeBucketIndex

Function: timeBucketIndex() ​

timeBucketIndex(buckets, time): number

Defined in: src/core/timeBuckets.ts:224

Index of the bucket that contains time (start <= time < end), or -1 when it is before, after or between the buckets. A binary search: the buckets must be sorted without overlaps, as createTimeBucketColumns checks; they are not validated again. Throws RangeError for a non-finite time.

Parameters ​

buckets ​

readonly TimeRange[]

time ​

number

Returns ​

number

MIT ライセンスで公開しています。