sample static method
Down-sample data to at most threshold points using the LTTB algorithm.
Returns the original list when data.length <= threshold and all points
are finite. Non-finite points are dropped before sampling.
Implementation
static List<DataPoint> sample(List<DataPoint> data, int threshold) {
final finiteData = _finiteDataPoints(data);
return _sampleFinite(finiteData, threshold);
}