only allow zoom by mouse wheel or selection when time axis is available

This commit is contained in:
2019-12-27 19:16:21 +01:00
parent 4f5fe15ac7
commit 90244c6e4b
3 changed files with 41 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults } from '../plot.service';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults, DataType, AxesTypes } from '../plot.service';
import { Observable } from 'rxjs/Observable';
import { FormControl, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
@@ -99,11 +99,27 @@ export class VisualizationPageComponent implements OnInit {
const request = this.createPlotRequest();
this.galleryView.renderGallery(request, this.splitBy.name);
}
getAxes() : AxesTypes {
var x = new Set<DataType>();
var y = new Set<DataType>();
for(var i = 0; i < this.selectedPlotType.length; i++){
var plotType = this.selectedPlotType[i];
x.add(plotType.xAxis);
y.add(plotType.yAxis);
}
return new AxesTypes(x,y);
}
plot(){
const that = this;
that.plotView.imageUrl = '';
this.plotView.axes = this.getAxes();
console.log(JSON.stringify(this.getAxes()));
that.galleryView.show=false;
document.dispatchEvent(new Event("invadersStart", {}));