extract shareable plot config

This commit is contained in:
2023-02-26 09:03:39 +01:00
parent a2945d2d9b
commit dc8a462031
6 changed files with 178 additions and 148 deletions

View File

@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults, DataType, YAxisDefinition, AxesTypes } from '../plot.service';
import { PlotService, PlotType, PlotRequest, PlotResponse, TagField, FilterDefaults, DataType, YAxisDefinition, AxesTypes, PlotConfig } 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';
@@ -189,12 +189,8 @@ export class VisualizationPageComponent implements OnInit {
const y2 = this.y2AxisDefinitionComponent ? this.y2AxisDefinitionComponent.getAxisDefinition() : undefined;
const results = document.getElementById("results");
const request = new PlotRequest(
const config = new PlotConfig(
this.query.query,
results != null ? results.offsetHeight-1: 1024,
results != null ? results.offsetWidth-1 : 1024,
300, // thumbnailMaxWidth
200, // thumbnailMaxHeight
this.groupBy.map(o => o.name),
this.limitbycomponent.limitBy,
this.limitbycomponent.limit,
@@ -202,12 +198,20 @@ export class VisualizationPageComponent implements OnInit {
y2,
this.dateRangeAsString(), // dateRange
aggregates, // aggregates
false, // keyOutside
this.enableGallery, // generateThumbnail
this.intervalUnit,
this.intervalValue,
this.renderBarChartTickLabels,
);
const request = new PlotRequest(
results != null ? results.offsetHeight-1: 1024,
results != null ? results.offsetWidth-1 : 1024,
300, // thumbnailMaxWidth
200, // thumbnailMaxHeight
false, // keyOutside
this.enableGallery, // generateThumbnail
this.submitterId,
this.renderBarChartTickLabels);
config);
return request;
}