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

    Type Alias BinOutput<R>

    BinOutput: R extends "minMax"
        ? { hi: Float64Array; lo: Float64Array }
        : R extends "minMaxFirstLast"
            ? {
                first: Float64Array;
                hi: Float64Array;
                last: Float64Array;
                lo: Float64Array;
            }
            : Float64Array

    Output type for Float64Column.bin(W, reducer). Narrows on the reducer name so consumers don't need a runtime cast:

    • Scalar reducers (min/max/sum/mean/stdev/median/count/p${q}) produce Float64Array(W) — one number per bin. Empty bins land as NaN (or 0 for 'count' and 'sum', where empty has a well-defined mathematical value).
    • 'minMax' produces { lo: Float64Array(W); hi: Float64Array(W) } — stride-1 access per channel matches the canvas-2D inner draw loop's per-pixel lo[px] / hi[px] reads. Empty bins on both channels are NaN.
    • 'minMaxFirstLast' produces the four-channel { lo, hi, first, last } (all Float64Array(W)) — the M4 reducer. first/last carry the bin's first/last defined value so a decimated line stays continuous at bin seams. Empty bins are NaN on all four channels (canvas-friendly: a NaN vertex breaks the sub-path, the correct "no data here" visual).

    Generalized for future multi-point reducers (e.g. LTTB) — those would land as their own output shape (e.g. { keys, values } with W output points). The shape per reducer is the contract.

    Type Parameters