sampleRaw static method

List<DataPoint> sampleRaw(
  1. List<double> yValues,
  2. int threshold
)

Sample from raw y-values, generating synthetic x = index.

Implementation

static List<DataPoint> sampleRaw(List<double> yValues, int threshold) {
  final indices = DoubleListSampler.lttbIndices(yValues, threshold);
  return [for (final i in indices) DataPoint(i.toDouble(), yValues[i])];
}