rescale method

DataPointPipeline rescale({
  1. double currentMin = double.negativeInfinity,
  2. double currentMax = double.infinity,
  3. double targetMin = 0.0,
  4. double targetMax = 1.0,
})

Linearly rescale intervals DataPoint.y..DataPoint.fy from currentMin..currentMax to targetMin..targetMax.

Both y and fy are transformed, and dy is recalculated as (fy - y).

Implementation

DataPointPipeline rescale({
  double currentMin = double.negativeInfinity,
  double currentMax = double.infinity,
  double targetMin = 0.0,
  double targetMax = 1.0,
}) {
  _modifiers.add(
    _RescaleModifier(
      currentMin: currentMin,
      currentMax: currentMax,
      targetMin: targetMin,
      targetMax: targetMax,
    ),
  );

  return this;
}