diff --git a/pdb-js/src/app/app.component.html b/pdb-js/src/app/app.component.html
index 11756ec..7b3d5dd 100644
--- a/pdb-js/src/app/app.component.html
+++ b/pdb-js/src/app/app.component.html
@@ -1,13 +1,7 @@
diff --git a/pdb-js/src/app/dashboard-page/dashboard/add-plot-dialog/add-plot-dialog.component.ts b/pdb-js/src/app/dashboard-page/dashboard/add-plot-dialog/add-plot-dialog.component.ts
index cda3170..c3e4fb8 100644
--- a/pdb-js/src/app/dashboard-page/dashboard/add-plot-dialog/add-plot-dialog.component.ts
+++ b/pdb-js/src/app/dashboard-page/dashboard/add-plot-dialog/add-plot-dialog.component.ts
@@ -1,5 +1,6 @@
import { Component, ElementRef, ViewChild } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
+import { VisualizationPageComponent } from 'src/app/visualization-page/visualization-page.component';
@Component({
selector: 'app-add-plot-dialog',
@@ -8,10 +9,13 @@ import { MatDialogRef } from '@angular/material/dialog';
})
export class AddPlotDialogComponent {
+ @ViewChild("plot") plotElement! :VisualizationPageComponent;
+
constructor(public dialogRef: MatDialogRef
){
}
onSaveClick(): void {
- this.dialogRef.close("todo");
+ const config = this.plotElement.createPlotConfig();
+ this.dialogRef.close(config);
}
}
diff --git a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.html b/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.html
index 845f89e..7f70674 100644
--- a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.html
+++ b/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.html
@@ -1,3 +1,20 @@
+
@@ -11,4 +28,5 @@
{{dashboard.description}}
+
diff --git a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.scss b/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.scss
deleted file mode 100644
index 401d07e..0000000
--- a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-:host {
- width: 100%;
- height: 100%;
-
-}
-.spinner {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
-}
-
-.content {
- padding: 0.5em;
-}
\ No newline at end of file
diff --git a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.ts b/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.ts
index 19b7252..3ca0027 100644
--- a/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.ts
+++ b/pdb-js/src/app/dashboard-page/dashboard/dashboard.component.ts
@@ -2,14 +2,14 @@ import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { ActivatedRoute } from '@angular/router';
-import { Dashboard, DashboardService, TextWidget } from 'src/app/dashboard.service';
+import { Dashboard, DashboardService, PlotWidget, TextWidget } from 'src/app/dashboard.service';
+import { PlotConfig } from 'src/app/plot.service';
import { AddPlotDialogComponent } from './add-plot-dialog/add-plot-dialog.component';
import { AddTextDialogComponent } from './add-text-dialog/add-text-dialog.component';
@Component({
selector: 'app-dashboard',
- templateUrl: './dashboard.component.html',
- styleUrls: ['./dashboard.component.scss']
+ templateUrl: './dashboard.component.html'
})
export class DashboardComponent implements OnInit {
@@ -34,9 +34,9 @@ export class DashboardComponent implements OnInit {
addPlot() {
this.dialog.open(AddPlotDialogComponent,{
width: 'calc(100% - 1em)',
- //height: 'calc(100% - 1em)'
- }).afterClosed().subscribe((text: string) => {
- //this.dashboard!.texts.push(new TextWidget('MEDIUM', text));
+ height: 'calc(100% - 1em)'
+ }).afterClosed().subscribe((config: PlotConfig) => {
+ this.dashboard!.plots.push(new PlotWidget('MEDIUM', config));
});
}
diff --git a/pdb-js/src/app/dashboard-page/dashboard/plot-widget/plot-widget.component.html b/pdb-js/src/app/dashboard-page/dashboard/plot-widget/plot-widget.component.html
new file mode 100644
index 0000000..04564e4
--- /dev/null
+++ b/pdb-js/src/app/dashboard-page/dashboard/plot-widget/plot-widget.component.html
@@ -0,0 +1,4 @@
+
+