Skip to content

Function: lttb()

ts
function lttb(
   x, 
   y, 
   threshold): {
  x: Float64Array;
  y: Float64Array;
};

Defined in: data/downsample.ts:7

Largest-Triangle-Three-Buckets (LTTB) downsampling — reduce a series to threshold points while preserving its visual shape (peaks/troughs), the standard technique for plotting very long line series. First and last points are always kept.

Parameters

ParameterType
xArrayLike<number>
yArrayLike<number>
thresholdnumber

Returns

ts
{
  x: Float64Array;
  y: Float64Array;
}

x

ts
x: Float64Array;

y

ts
y: Float64Array;

MIT licensed. WebGL2 required.