@raindrops-on-roses/number-lttb
v0.0.3
Published
Downsamples a numeric data series using the Largest-Triangle-Three-Buckets algorithm while preserving the first and last data points.
Readme
@raindrops-on-roses/number-lttb
Downsamples a numeric data series using the Largest-Triangle-Three-Buckets algorithm while preserving the first and last data points.
lttb utility from raindrops-on-roses.
Install
npm install @raindrops-on-roses/number-lttbUsage
import { lttb } from "@raindrops-on-roses/number-lttb";
lttb({
data: [5, 1, 2, 4, 6, 9],
threshold: 4,
}); // [5, 4, 9, 9]Parameters
data- The numeric series to downsamplethreshold- The max number of data points to retain
With the complete library
You can also install the complete library:
npm install raindrops-on-rosesand import the utility from the umbrella package:
import { lttb } from "raindrops-on-roses";Lore
A point appears. A second point as a mirror sends a distance. There love makes a triangle.
