bandAt method

GraphBandSpec? bandAt(
  1. num index
)

The band a position is in; null for none.

Implementation

GraphBandSpec? bandAt(num index) {
  final bands = spec.x.bands;
  for (final b in bands) {
    // A band ends where the next starts; the last holds its own end.
    if (index >= b.from && (index < b.to || (identical(b, bands.last) && index <= b.to))) return b;
  }
  return null;
}