use one multi-select drop down for plot type
All plot types we currently have can be combined in one image. So there is no need to compute combinable types.
This commit is contained in:
@@ -17,23 +17,13 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Type:</mat-label>
|
||||
<mat-select [formControl]="selectedPlotType">
|
||||
<mat-select multiple [(value)]="selectedPlotType">
|
||||
<mat-option *ngFor="let plotType of plotTypes" [value]="plotType">
|
||||
<img src="assets/img/{{plotType.icon}}.svg" class="icon-select" /> {{plotType.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Combine With Type:</mat-label>
|
||||
<mat-select [formControl]="selectedCombinePlotType">
|
||||
<mat-option>-</mat-option>
|
||||
<mat-option *ngFor="let plotType of combinePlotTypes" [value]="plotType">
|
||||
<img src="assets/img/{{plotType.icon}}.svg" class="icon-select" /> {{plotType.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Group By:</mat-label>
|
||||
<mat-select multiple [(value)]="groupBy">
|
||||
|
||||
@@ -23,12 +23,9 @@ export class VisualizationPageComponent implements OnInit {
|
||||
|
||||
availablePlotTypes = {};
|
||||
|
||||
selectedPlotType = new FormControl('');
|
||||
selectedPlotType = [];
|
||||
plotTypes: Array<any>;
|
||||
|
||||
selectedCombinePlotType = new FormControl('');
|
||||
combinePlotTypes: Array<any>;
|
||||
|
||||
tagFields: Array<TagField> = new Array<TagField>();
|
||||
|
||||
groupBy = new Array<TagField>();
|
||||
@@ -66,12 +63,10 @@ export class VisualizationPageComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const that = this;
|
||||
this.plotTypes = this.plotService.getPlotTypes();
|
||||
this.selectedPlotType.setValue(this.plotTypes[0]);
|
||||
this.selectedPlotType.push(this.plotTypes[0]);
|
||||
|
||||
this.plotTypes.forEach(pt => this.availablePlotTypes[pt.name] = pt);
|
||||
|
||||
this.combinePlotTypes = this.getCombinablePlotTypes(this.selectedPlotType.value);
|
||||
|
||||
that.plotService.getFilterDefaults().subscribe(function(filterDefaults) {
|
||||
|
||||
filterDefaults.fields.forEach(function(name) {
|
||||
@@ -85,16 +80,6 @@ export class VisualizationPageComponent implements OnInit {
|
||||
that.splitBy = that.tagFields.find(val => filterDefaults.splitBy == val.name);
|
||||
});
|
||||
this.yAxisScale = "LOG10";
|
||||
|
||||
this.selectedPlotType.valueChanges.subscribe(function(selectedMainPlotType){
|
||||
that.combinePlotTypes = that.getCombinablePlotTypes(selectedMainPlotType);
|
||||
if (!that.combinePlotTypes.includes(that.selectedCombinePlotType.value)){
|
||||
that.selectedCombinePlotType.setValue('');
|
||||
}
|
||||
},
|
||||
error => {
|
||||
that.showError(error.error.message);
|
||||
});
|
||||
}
|
||||
|
||||
getCombinablePlotTypes(selectedMainPlotType) : Array<any>{
|
||||
@@ -137,10 +122,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
|
||||
createPlotRequest(): PlotRequest {
|
||||
const aggregates = [];
|
||||
aggregates.push(this.selectedPlotType.value.id);
|
||||
if (this.selectedCombinePlotType.value){
|
||||
aggregates.push(this.selectedCombinePlotType.value.id);
|
||||
}
|
||||
this.selectedPlotType.forEach(a => aggregates.push(a.id));
|
||||
|
||||
const request = new PlotRequest();
|
||||
request.query = this.query.query;
|
||||
|
||||
Reference in New Issue
Block a user