various stuff
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
}
|
||||
.size-medium {
|
||||
width: 602px;
|
||||
height: 502px;
|
||||
height: 402px;
|
||||
}
|
||||
</style>
|
||||
<div class="dashboard-card" [ngClass]="{'size-medium' : data.size=='MEDIUM'}">
|
||||
<mat-spinner *ngIf="!thumbnailUrl && !isError"></mat-spinner>
|
||||
<img *ngIf="thumbnailUrl" src="{{thumbnailUrl}}" />
|
||||
<div class="dashboard-card" [ngClass]="{'size-medium' : data.widget.size=='MEDIUM'}">
|
||||
<mat-spinner *ngIf="!data.plotResponse?.imageUrl && !isError"></mat-spinner>
|
||||
<img *ngIf="data.plotResponse?.imageUrl" src="{{data.plotResponse?.imageUrl}}" />
|
||||
<div *ngIf="isError">
|
||||
There was an error! This is a good time to panic!
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { PlotWidget } from 'src/app/dashboard.service';
|
||||
import { PlotWidget, PlotWidgetRenderData } from 'src/app/dashboard.service';
|
||||
import { PlotViewComponent } from 'src/app/plot-view/plot-view.component';
|
||||
import { PlotRequest, PlotResponse, PlotService } from 'src/app/plot.service';
|
||||
|
||||
@@ -9,9 +9,9 @@ import { PlotRequest, PlotResponse, PlotService } from 'src/app/plot.service';
|
||||
})
|
||||
export class PlotWidgetComponent implements AfterViewInit {
|
||||
@Input("data")
|
||||
data!: PlotWidget;
|
||||
data!: PlotWidgetRenderData;
|
||||
|
||||
thumbnailUrl = "";
|
||||
public thumbnailUrl = "";
|
||||
|
||||
isError = false;
|
||||
|
||||
@@ -20,17 +20,17 @@ export class PlotWidgetComponent implements AfterViewInit {
|
||||
constructor(private plotService : PlotService){}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
|
||||
|
||||
/*
|
||||
const plotRequest = this.createPlotRequest();
|
||||
this.plotService.sendPlotRequest(plotRequest).subscribe({
|
||||
next: (response: PlotResponse) => {
|
||||
this.thumbnailUrl = response.thumbnailUrl;
|
||||
this.thumbnailUrl = response.imageUrl;
|
||||
},
|
||||
error: () => {
|
||||
this.isError = true;
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
createPlotRequest(): PlotRequest {
|
||||
@@ -38,15 +38,15 @@ export class PlotWidgetComponent implements AfterViewInit {
|
||||
const height = window.innerHeight - 20;
|
||||
const width = window. innerWidth - 20;
|
||||
|
||||
const request = new PlotRequest(
|
||||
height,
|
||||
width,
|
||||
600, // thumbnailMaxWidth
|
||||
500, // thumbnailMaxHeight
|
||||
false, // keyOutside
|
||||
true, // generateThumbnail
|
||||
(<any>window).submitterId,
|
||||
this.data.config!);
|
||||
const request = new PlotRequest(
|
||||
500,
|
||||
600,
|
||||
600, // thumbnailMaxWidth
|
||||
500, // thumbnailMaxHeight
|
||||
false, // keyOutside
|
||||
false, // generateThumbnail
|
||||
(<any>window).submitterId,
|
||||
this.data.widget.config!);
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user