onPan method
Horizontal scroll / pan gesture handler.
Implementation
void onPan(double deltaX) {
final maxScroll = (candles.length * _viewport.candleTotalWidth).toDouble();
const minScroll = -120.0; // Allow right margin expansion
final newOffset = (_viewport.scrollOffset + deltaX)
.clamp(minScroll, math.max(0.0, maxScroll))
.toDouble();
_viewport = _viewport.copyWith(scrollOffset: newOffset);
notifyListeners();
}