pond-ts API Reference (core)
    Preparing search index...

    Class TimeKeyColumn

    Implements

    • KeyColumnBase<"time">
    Index

    Constructors

    Properties

    begin: Float64Array

    Half-open interval start in epoch milliseconds.

    end: Float64Array

    For time keys, end === begin. Exposed as a separate field so callers writing generic key code (endAt(i) - beginAt(i)) get the right answer (0 for a point in time).

    kind: "time" = ...
    length: number

    Row count.

    Methods

    • Returns the begin timestamp at row i as a raw number, or undefined for out-of-range. For point-in-time keys begin === end, so this is the only timestamp at row i.

      The columnar idiom: returns the raw value, not a Time class instance. Consumers that want the Time wrapper (with methods like .toISOString()) can reach for it via the row-API path (series.events[i].key).

      Parameters

      • i: number

      Returns number | undefined

    • Zero-copy index-range view. start clamps to [0, length], end clamps to [start, length]. Composes with the column- side slice so chart adapters can slice both axes the same way: series.keyColumn().slice(s, e) / series.column('x').slice(s, e).

      Parameters

      • start: number
      • end: number

      Returns TimeKeyColumn

    • Gathers rows by index into a new TimeKeyColumn. Out-of-range source indices produce a 0 slot in the output buffer — the caller is responsible for ensuring indices are valid (typically from a prior filter / range-query that returned source-row indices).

      Parameters

      • indices: Int32Array

      Returns TimeKeyColumn

    • Zero-copy index-range view: returns a TimeKeyColumn over begin.subarray(start, end). Same trusted-buffer-immutability contract as the source — the underlying Float64Array is shared. start clamps to [0, +∞) via Math.max(0, start); end clamps to (-∞, length] via Math.min(this.length, end). If the clamped range is empty (hi <= lo), returns a zero- length column with a fresh empty buffer.

      Mirrors Float64Column.sliceByRange's clamping shape exactly — including the behavior on NaN / Infinity / non-integer inputs: NaN propagates through Math.max / Math.min and surfaces via the validateColumnLength(NaN) check; non- integer start - end deltas land in validateColumnLength for the same throw.

      Uses fromValidatedSubarray (not the public constructor) so the per-row finiteness scan doesn't re-run on every slice — the source was already validated, and a subarray of a finite buffer is also finite. Keeps the chart's pan/zoom/hover loops O(1) on the key axis rather than O(e − s).

      Parameters

      • start: number
      • end: number

      Returns TimeKeyColumn