only allow zoom by mouse wheel or selection when time axis is available
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
|
||||
import { DataType, AxesTypes } from '../plot.service';
|
||||
|
||||
@Component({
|
||||
selector: 'pdb-plot-view',
|
||||
@@ -16,6 +17,8 @@ export class PlotViewComponent implements OnInit {
|
||||
|
||||
imageUrl : string;
|
||||
|
||||
axes: AxesTypes;
|
||||
|
||||
@Output()
|
||||
zoomRange : EventEmitter<SelectionRange> = new EventEmitter<SelectionRange>();
|
||||
|
||||
@@ -89,7 +92,7 @@ export class PlotViewComponent implements OnInit {
|
||||
//console.log("dragStart inPlot: " + this.isInPlot(event));
|
||||
|
||||
event.preventDefault();
|
||||
if (event.buttons == 1 && this.isInPlot(event)) {
|
||||
if (event.buttons == 1 && this.isInPlot(event) && this.axes.hasXAxis(DataType.Time)) {
|
||||
const pos = this.positionInImage(event);
|
||||
this.in_drag_mode = true;
|
||||
this.drag_start_x = pos.x;
|
||||
@@ -157,7 +160,7 @@ export class PlotViewComponent implements OnInit {
|
||||
}
|
||||
|
||||
zoomByScroll(event) {
|
||||
if (this.isInImage(event) && event.deltaY != 0) {
|
||||
if (this.isInImage(event) && event.deltaY != 0 && this.axes.hasXAxis(DataType.Time)) {
|
||||
this.in_drag_mode = false;
|
||||
this.hideZoomInSlider();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user