|
|
|
@ -82,6 +82,7 @@ const DEFAULT_OPTIONS: Options = {
|
|
|
|
|
keyEvent: KeyEvent.SHIFT, |
|
|
|
|
panStep: DEFAULT_SCROLL_PAN_STEP, |
|
|
|
|
orientation: ScrollPanOrientation.HORIZONTAL, |
|
|
|
|
direction: ScrollPanDirection.BOTH, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -608,11 +609,25 @@ abstract class ChartwerkPod<T extends TimeSerie, O extends Options> {
|
|
|
|
|
.text('No data points'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private disableScrollForward(event: any): boolean { |
|
|
|
|
return event.sourceEvent.wheelDelta > 0 |
|
|
|
|
&& this.options.zoomEvents.scroll.pan.direction === ScrollPanDirection.FORWARD; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private disableScrollBackward(event: any): boolean { |
|
|
|
|
return event.sourceEvent.wheelDelta < 0 |
|
|
|
|
&& this.options.zoomEvents.scroll.pan.direction === ScrollPanDirection.BACKWARD; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected onPanning(): void { |
|
|
|
|
const event = this.d3.event; |
|
|
|
|
if(event.sourceEvent === null || event.sourceEvent === undefined) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (event.sourceEvent.type === 'wheel' |
|
|
|
|
&& (this.disableScrollBackward(event) || this.disableScrollForward(event))) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.rescaleMetricAndAxis(event); |
|
|
|
|
|
|
|
|
|
if(this.options.eventsCallbacks !== undefined && this.options.eventsCallbacks.panning !== undefined) { |
|
|
|
|