various stuff

This commit is contained in:
2023-02-27 19:59:43 +01:00
parent bd1b4fb655
commit 66da69a57a
6 changed files with 105 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PlotConfig } from './plot.service';
import { PlotConfig, PlotResponse } from './plot.service';
@Injectable({
providedIn: 'root'
@@ -41,20 +41,29 @@ export class DashboardList{
}
export abstract class BaseWidget {
constructor(public type: 'TEXT'|'PLOT', public size: 'SMALL'|'MEDIUM'|'LARGE') {}
constructor(public type: PlotType, public size: PlotSize) {}
}
export class TextWidget extends BaseWidget {
constructor(override size: 'SMALL'|'MEDIUM'|'LARGE', public text: string) {
constructor(override size: PlotSize, public text: string) {
super('TEXT', size);
}
}
export class PlotWidget extends BaseWidget {
constructor(override size: 'SMALL'|'MEDIUM'|'LARGE', public config: PlotConfig) {
constructor(override size: PlotSize, public config: PlotConfig) {
super('PLOT', size);
}
}
export type PlotSize = 'SMALL'|'MEDIUM'|'LARGE';
export type PlotType = 'TEXT'|'PLOT';
export class PlotWidgetRenderData {
constructor(public widget: PlotWidget, public plotResponse?: PlotResponse) {
}
}
export class WidgetDimensions{
constructor(public width: number, public height: number){}
}