lttb

package
Version: v12.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iter

type Iter func(count int) ([]Point, error)

An Iter is an iterator function that returns count number of Points or an error.

type Point

type Point struct{ X, Y float64 }

A Point in a line chart.

func Downsample

func Downsample(count, threshold int, it Iter) ([]Point, error)

Downsample `count` number of data points retrieved from the given iterator function to contain only `threshold` number of points while maintaining close visual similarity to the original data. The algorithm is called Largest-Triangle-Three-Buckets and is described in: https://skemman.is/bitstream/1946/15343/3/SS_MSthesis.pdf

This implementation grew out of https://github.com/dgryski/go-lttb to limit memory usage by leveraging iterators.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL