disable plot types instead of hiding them
This commit is contained in:
@@ -20,9 +20,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
readonly DATE_PATTERN = "YYYY-MM-DD HH:mm:ss"; // for moment-JS
|
||||
|
||||
dateRange = new FormControl('2019-10-05 00:00:00 - 2019-10-11 23:59:59');
|
||||
|
||||
availablePlotTypes = [];
|
||||
|
||||
|
||||
selectedPlotType = [];
|
||||
plotTypes: Array<any>;
|
||||
|
||||
@@ -64,9 +62,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
const that = this;
|
||||
this.plotTypes = this.plotService.getPlotTypes();
|
||||
this.selectedPlotType.push(this.plotTypes[0]);
|
||||
|
||||
this.availablePlotTypes = [].concat(this.plotTypes);
|
||||
|
||||
|
||||
that.plotService.getFilterDefaults().subscribe(function(filterDefaults) {
|
||||
|
||||
filterDefaults.fields.forEach(function(name) {
|
||||
@@ -83,8 +79,9 @@ export class VisualizationPageComponent implements OnInit {
|
||||
}
|
||||
|
||||
changePlotType(selectedPlotTypes: Array<PlotType>) {
|
||||
const compatiblePlotTypes = this.availablePlotTypes.filter(pt => pt.compatible(selectedPlotTypes));
|
||||
this.plotTypes = compatiblePlotTypes;
|
||||
const compatiblePlotTypes = this.plotTypes.filter(pt => pt.compatible(selectedPlotTypes));
|
||||
this.plotTypes.forEach(pt => pt.active=false);
|
||||
compatiblePlotTypes.forEach(pt => pt.active=true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user