logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Data::DownSample::LargestTriangleThreeBuckets - downsample a data set while retaining its visual

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.

Description

       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.

Name

       Data::DownSample::LargestTriangleThreeBuckets  - downsample a data set while retaining its visual
       characteristics

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/>

Synopsis

       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

return

See Also