use new render result for visualization

This commit is contained in:
2023-03-04 10:18:55 +01:00
parent 9e53022b4a
commit bc3b6ec3e9
4 changed files with 40 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults, DataType, YAxisDefinition, AxesTypes, PlotConfig } from '../plot.service';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults, DataType, YAxisDefinition, AxesTypes, PlotConfig, RenderOptions, RenderOptionsMap } from '../plot.service';
import { UntypedFormControl, Validators } from '@angular/forms';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { LimitByComponent } from '../limit-by/limit-by.component';
@@ -148,11 +148,6 @@ export class VisualizationPageComponent implements OnInit {
abort() {
this.plotService.abort((<any>window).submitterId).subscribe({
complete: () => {
//this.plotView.imageUrl = '';
//this.plotView.stats = null;
//this.plotJobActive = false;
//this.showError("Job aborted");
//document.dispatchEvent(new Event("invadersPause", {}));
}
});
}
@@ -164,8 +159,9 @@ export class VisualizationPageComponent implements OnInit {
plotDimensionSupplier(): WidgetDimensions{
const results = document.getElementById("results");
return new WidgetDimensions(results != null ? results.offsetHeight-1: 1024,
results != null ? results.offsetWidth-1 : 1024,);
return new WidgetDimensions(
results != null ? results.offsetWidth-1 : 1024,
results != null ? results.offsetHeight-1: 1024);
}
createPlotConfig(): PlotConfig {
@@ -192,10 +188,15 @@ export class VisualizationPageComponent implements OnInit {
}
createPlotRequest(): PlotRequest {
const results = document.getElementById("results");
const results = document.getElementById("results");
const config = this.createPlotConfig();
const renderOptions : RenderOptionsMap = {
'main': new RenderOptions(results!.offsetHeight-1, results!.offsetWidth-1, false, true),
'thumbnail': new RenderOptions(200, 300, false, false),
};
const request = new PlotRequest(
results != null ? results.offsetHeight-1: 1024,
results != null ? results.offsetWidth-1 : 1024,
@@ -205,7 +206,8 @@ export class VisualizationPageComponent implements OnInit {
this.enableGallery, // generateThumbnail
(<any>window).submitterId,
config,
{});
renderOptions
);
return request;
}
}