https://github.com/seanvelasco/lttb
Largest-Triangle-Three-Buckets algorithm for downsampling time-series data while retaining original shape including sharp inflections
https://github.com/seanvelasco/lttb
charting downsampling graphing imaging
Last synced: 2 months ago
JSON representation
Largest-Triangle-Three-Buckets algorithm for downsampling time-series data while retaining original shape including sharp inflections
- Host: GitHub
- URL: https://github.com/seanvelasco/lttb
- Owner: seanvelasco
- Created: 2022-06-07T06:26:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-19T12:18:50.000Z (almost 3 years ago)
- Last Synced: 2025-03-23T23:36:06.114Z (3 months ago)
- Topics: charting, downsampling, graphing, imaging
- Language: TypeScript
- Homepage:
- Size: 5.2 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## What is LTTB?
Largest Triangle Three Buckets is a downsampling algorithm for time series data.
## Installation
```
npm install @seanvelasco/lttb
```## Usage
```typescript
import LTTB from '@seanvelasco/lttb'const threshold = 300
const untreatedData = [...]
// Accepts an array of numbers (number[]) or typed arrays (Uint8Array, Uint16Array, Uint32Array, etc)
const downsampledData = LTTB(untreatedData, threshold)
```