update plotType drop down on selection
The drop down for plot types should only contain plot types that can be combined. The reason is, that we can only draw images with two x/y-axis. Therefore a combination of types that would need three or more axis is not supported.
This commit is contained in:
@@ -21,7 +21,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
|
||||
dateRange = new FormControl('2019-10-05 00:00:00 - 2019-10-11 23:59:59');
|
||||
|
||||
availablePlotTypes = {};
|
||||
availablePlotTypes = [];
|
||||
|
||||
selectedPlotType = [];
|
||||
plotTypes: Array<any>;
|
||||
@@ -65,7 +65,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
this.plotTypes = this.plotService.getPlotTypes();
|
||||
this.selectedPlotType.push(this.plotTypes[0]);
|
||||
|
||||
this.plotTypes.forEach(pt => this.availablePlotTypes[pt.name] = pt);
|
||||
this.availablePlotTypes = [].concat(this.plotTypes);
|
||||
|
||||
that.plotService.getFilterDefaults().subscribe(function(filterDefaults) {
|
||||
|
||||
@@ -81,14 +81,12 @@ export class VisualizationPageComponent implements OnInit {
|
||||
});
|
||||
this.yAxisScale = "LOG10";
|
||||
}
|
||||
|
||||
getCombinablePlotTypes(selectedMainPlotType) : Array<any>{
|
||||
//const mainPlotType = this.availablePlotTypes[selectedMainPlotType];
|
||||
const mainPlotType = selectedMainPlotType;
|
||||
|
||||
const compatiblePlotTypes = this.plotTypes.filter(pt => pt.compatible(mainPlotType));
|
||||
return compatiblePlotTypes;
|
||||
|
||||
changePlotType(selectedPlotTypes: Array<PlotType>) {
|
||||
const compatiblePlotTypes = this.availablePlotTypes.filter(pt => pt.compatible(selectedPlotTypes));
|
||||
this.plotTypes = compatiblePlotTypes;
|
||||
}
|
||||
|
||||
|
||||
dateRangeAsString() : string {
|
||||
return (<HTMLInputElement>document.getElementById("search-date-range")).value;
|
||||
|
||||
Reference in New Issue
Block a user