vegeta: Index | Files

package lttb

import ""


Package Files


type Iter Uses

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

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

type Point Uses

type Point struct{ X, Y float64 }

A Point in a line chart.

func Downsample Uses

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:

This implementation grew out of to limit memory usage by leveraging iterators.

Package lttb imports 1 packages (graph) and is imported by 2 packages. Updated 2019-03-02. Refresh now. Tools for package owners.