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.
Output type for
Float64Column.bin(W, reducer). Narrows on the reducer name so consumers don't need a runtime cast:Float64Array(W)— one number per bin. Empty bins land asNaN(or0for'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-pixello[px]/hi[px]reads. Empty bins on both channels areNaN.'minMaxFirstLast'produces the four-channel{ lo, hi, first, last }(allFloat64Array(W)) — the M4 reducer.first/lastcarry the bin's first/last defined value so a decimated line stays continuous at bin seams. Empty bins areNaNon all four channels (canvas-friendly: aNaNvertex 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.