render gallery items

This commit is contained in:
2019-11-16 15:14:21 +01:00
parent 3022edb1e1
commit 73ea635ac1
11 changed files with 220 additions and 19 deletions

View File

@@ -46,6 +46,9 @@ export class VisualizationPageComponent implements OnInit {
@ViewChild(PlotViewComponent, {static: false})
plotView: PlotViewComponent;
@ViewChild(GalleryViewComponent, {static: false})
galleryView: GalleryViewComponent;
enableGallery = false;
splitBy = null;
@@ -108,13 +111,9 @@ export class VisualizationPageComponent implements OnInit {
gallery(){
const that = this;
this.plotService.splitQuery(this.query.query, this.splitBy.name).subscribe(function(valuesForSplitBy){
console.log("valuesForSplitBy: " + JSON.stringify(valuesForSplitBy));
},
error => {
that.plotView.imageUrl = '';
that.showError(error.error.message);
});
this.plotView.imageUrl = '';
const request = this.createPlotRequest();
this.galleryView.renderGallery(request, this.splitBy.name);
}
plot(){
@@ -122,7 +121,19 @@ export class VisualizationPageComponent implements OnInit {
that.plotView.imageUrl = '';
const request = this.createPlotRequest();
this.plotService.sendPlotRequest(request).subscribe(function(plotResponse){
console.log("response: " + JSON.stringify(plotResponse));
that.plotView.imageUrl = "http://"+window.location.hostname+':8080/'+plotResponse.imageUrl;
},
error => {
that.plotView.imageUrl = '';
that.showError(error.error.message);
});
}
createPlotRequest(): PlotRequest {
const aggregates = [];
aggregates.push(this.selectedPlotType.value.id);
if (this.selectedCombinePlotType.value){
@@ -144,16 +155,7 @@ export class VisualizationPageComponent implements OnInit {
request.yRangeMin = this.yAxisRangeComponent.minYValue;
request.yRangeMax = this.yAxisRangeComponent.maxYValue;
request.yRangeUnit = this.yAxisRangeComponent.yAxisUnit;
this.plotService.sendPlotRequest(request).subscribe(function(plotResponse){
console.log("response: " + JSON.stringify(plotResponse));
that.plotView.imageUrl = "http://"+window.location.hostname+':8080/'+plotResponse.imageUrl;
},
error => {
that.plotView.imageUrl = '';
that.showError(error.error.message);
});
return request;
}
/**