lttb

package module
v0.0.0-...-2585f63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 2 Imported by: 2

README

godoc: https://godoc.org/github.com/dgryski/go-lttb

Documentation

Overview

Package lttb implements the Largest-Triangle-Three-Buckets algorithm for downsampling points

The downsampled data maintains the visual characteristics of the original line using considerably fewer data points.

This is a translation of the javascript code at

https://github.com/sveinn-steinarsson/flot-downsample/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point[T constraints.Float] struct {
	X T
	Y T
}

Point is a point on a line

func LTTB

func LTTB[T constraints.Float](data []Point[T], threshold int) []Point[T]

LTTB down-samples the data to contain only threshold number of points that have the same visual shape as the original data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL