invertExtent method

(double, double) invertExtent(
  1. R value
)

Returns the extent of values in the domain that map to the given range value.

Implementation

(double, double) invertExtent(R value) {
  final i = _range.indexOf(value);
  if (i < 0) return (double.nan, double.nan);

  final lo = i > 0 ? _thresholds[i - 1] : _domain.first;
  final hi = i < _thresholds.length ? _thresholds[i] : _domain.last;

  return (lo, hi);
}