overlayDomain method

(double, double) overlayDomain(
  1. int pane,
  2. GraphMarkSpec mark
)

The domain of a mark on a scale of its own (GraphMarkSpec.overlay): from zero, its largest value in view at the top of its share of the pane.

Implementation

(double, double) overlayDomain(int pane, GraphMarkSpec mark) {
  final (first, last) = visible;
  var hi = 0.0;
  for (var i = first; i <= last; i++) {
    if (rows[i][mark.valueField] case final num v when v.isFinite) hi = math.max(hi, v.toDouble());
  }
  return (0, (hi == 0 ? 1 : hi) / mark.overlay!.clamp(0.01, 1));
}