Data::DownSample::LargestTriangleThreeBuckets(3pm)

Data::DownSample::LargestTriangleThreeBuckets3pm

Downsample a data set while retaining its visual characteristics

Usage

use Data::DownSample::LargestTriangleThreeBuckets;

my $lttb = new Data::DownSample::LargestTriangleThreeBuckets( {threshold=>1000} );

my $data_src = [ [1,2], [2,3], [3,4], [4,5], ... ]; # <-- load your data source here as reference to a list of a list

my $data_sampled = $lttb->lttb($data_src);

Version

Version 1.00

Overview

Implements a downsample technique known as Largest Triangle Three Buckets as defined in Sveinn Steinarsson MS thesis.

http://skemman.is/stream/get/1946/15343/37285/3/SS_MSthesis.pdf

The idea is to downsample a data set without losing the visual character of the plotted data. The technique draws on ideas in cartographic generalization or polyline simplification. This technique is often useful in client-server applications such as webserver-browser where the length of the data far exceeds the pixels available to plot. Reducing the data size significantly speeds up data transfer and rendering time.

Subroutines/methods

lttb()

my $data_sampled = $lttb->lttb($data_src);

Also can overwrite the class threashold variable such as

my $data_sampled = $lttb->lttb($data_src,20000);

This function is an optimized version of the algorithm given in Sveinn Steinarsson paper. Several of the math operation are factored out of the loops and it executes better than 33% faster.

lttb_ref()

my $data_sampled = $lttb->lttb_ref($data_src);

The reference function implimentation of the algorithm given in Sveinn Steinarsson paper and used to verify that the optimized version is giving correct results.

Support

You can find documentation for this module with the perldoc command.

    perldoc Data::DownSample::LargestTriangleThreeBuckets

You can also look for information at:

•

RT: CPAN's request tracker (report bugs here)

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-DownSample-LargestTriangleThreeBuckets>

•

AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Data-DownSample-LargestTriangleThreeBuckets>

•

CPAN Ratings

<http://cpanratings.perl.org/d/Data-DownSample-LargestTriangleThreeBuckets>

•

Search CPAN

<http://search.cpan.org/dist/Data-DownSample-LargestTriangleThreeBuckets/>

Releases

Unchanged in 3 releases since Debian 11 (Bullseye).

  1. 11–13

Author

Steve Troxel, "<troxel at perlworks.com>"

Bugs

Please report any bugs or feature requests to "bug-data-downsample-largesttrianglethreebuckets at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-DownSample-LargestTriangleThreeBuckets>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

From libdata-downsample-largesttrianglethreebuckets-perl 1.00-2.1 in Debian 13 (Trixie). Parsed by carta from the page's man source.