open visualization page with settings

This commit is contained in:
2023-03-18 09:42:04 +01:00
parent 6d8af4fdc6
commit b6045eda22
4 changed files with 26 additions and 3 deletions

View File

@@ -12,8 +12,6 @@
<div id="filters">
<div id="filterpanel">
<mat-form-field class="pdb-form-full-width">
<mat-label>Type:</mat-label>
<mat-select multiple [(ngModel)]="selectedPlotType" (ngModelChange)="changePlotType($event)">
@@ -66,6 +64,13 @@
<div id="plot-button-bar">
<a
mat-icon-button
[routerLink]="['/vis']"
[queryParams]="{config: serializedConfig()}"
target="_blank"
aria-label="open new window with the same search"
title="open new window with the same search"><img src="assets/img/link.svg" aria-hidden="true"/></a>
<button
*ngIf="!enableGallery && !plotJobActive"
[disabled]="plotJobActive"

View File

@@ -67,5 +67,7 @@
}
#plot-button-bar {
text-align: right;
display: flex;
justify-content: space-between;
}

View File

@@ -63,6 +63,12 @@ export class VisualizationPageComponent implements OnInit, AfterViewInit {
plotJobActive = false;
constructor(private plotService: PlotService, private snackBar: MatSnackBar) {
const params = new URLSearchParams(window.location.search);
if (!this.defaultConfig && params.get("config")) {
const config = JSON.parse(params.get("config")!);
this.defaultConfig = config;
}
}
showError(message:string) {
@@ -248,4 +254,13 @@ toggleGallery(event: Event){
);
return request;
}
serializedConfig(): string {
try{
const config = this.createPlotConfig();
return JSON.stringify(config);
}catch (e) {
return "";
}
}
}