From 3b552e38b263cff042578ee866063dc19c1c3ea7 Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Wed, 25 May 2022 00:33:30 +0200 Subject: Opcije Update i Save As za experiment. Napravljena dijalog komponenta. --- .../_elements/column-table/column-table.component.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'frontend/src/app/_elements/column-table/column-table.component.ts') diff --git a/frontend/src/app/_elements/column-table/column-table.component.ts b/frontend/src/app/_elements/column-table/column-table.component.ts index 4b10401d..41153353 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -15,6 +15,7 @@ import Shared from 'src/app/Shared'; import { PieChartComponent } from '../_charts/pie-chart/pie-chart.component'; import { BoxPlotComponent } from '../_charts/box-plot/box-plot.component'; import { ActivatedRoute } from '@angular/router'; +import { UpdateExperimentDialogComponent } from 'src/app/_modals/update-experiment-dialog/update-experiment-dialog.component'; @Component({ selector: 'app-column-table', @@ -365,11 +366,19 @@ export class ColumnTableComponent implements AfterViewInit { } openUpdateExperimentDialog() { - this.experimentService.updateExperiment(this.experiment).subscribe((response) => { - Object.assign(this.experiment, response); - this.experiment._columnsSelected = true; + const dialogRef = this.dialog.open(UpdateExperimentDialogComponent, { + width: '350px', + data: { experiment: this.experiment } + }); + dialogRef.afterClosed().subscribe(experiment => { + if (experiment == undefined) + return; + if (this.experiment._id != experiment._id) + Shared.openDialog("Novi eksperiment", "Uspešno ste sačuvali novi eksperiment. Nastavite rad na njemu."); + else + Shared.openDialog("Izmena eksperimenta", "Uspešno ste izmenili podatke o eksperimentu."); + Object.assign(this.experiment, experiment); this.experimentChanged.emit(); - Shared.openDialog("Izmena eksperimenta", "Uspešno ste izmenili podatke o eksperimentu."); }); } -- cgit v1.2.3 From 7f587b3feeeb3f59666176ec1cbcd8f450fe590d Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Wed, 25 May 2022 00:36:57 +0200 Subject: Dodata linija this.experiment._columnsSelected = true --- frontend/src/app/_elements/column-table/column-table.component.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'frontend/src/app/_elements/column-table/column-table.component.ts') diff --git a/frontend/src/app/_elements/column-table/column-table.component.ts b/frontend/src/app/_elements/column-table/column-table.component.ts index 41153353..8398f7ef 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -378,6 +378,7 @@ export class ColumnTableComponent implements AfterViewInit { else Shared.openDialog("Izmena eksperimenta", "Uspešno ste izmenili podatke o eksperimentu."); Object.assign(this.experiment, experiment); + this.experiment._columnsSelected = true; this.experimentChanged.emit(); }); } -- cgit v1.2.3 From c0be95d8a56896cdac1330c614ded3b8c17ba0da Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Wed, 25 May 2022 21:18:58 +0200 Subject: Ispravljen bag: Popunjavanje nedostajucih vrednosti - ako je numericki tip ne moze da se unese tekstualna vrednost vise, samo brojcana. --- .../_elements/column-table/column-table.component.html | 15 ++++++++------- .../app/_elements/column-table/column-table.component.ts | 11 ++++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'frontend/src/app/_elements/column-table/column-table.component.ts') diff --git a/frontend/src/app/_elements/column-table/column-table.component.html b/frontend/src/app/_elements/column-table/column-table.component.html index 26770c41..e970bfb4 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.html +++ b/frontend/src/app/_elements/column-table/column-table.component.html @@ -109,7 +109,7 @@

Kategorijski

- + Kategorijski Numerički @@ -180,12 +180,12 @@ - - - - + + + + - + @@ -195,7 +195,8 @@ - + + diff --git a/frontend/src/app/_elements/column-table/column-table.component.ts b/frontend/src/app/_elements/column-table/column-table.component.ts index 8398f7ef..8d2875a5 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -7,7 +7,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MissingvaluesDialogComponent } from 'src/app/_modals/missingvalues-dialog/missingvalues-dialog.component'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { CsvParseService } from 'src/app/_services/csv-parse.service'; -import { ProblemType } from 'src/app/_data/Model'; +import { NullValReplacer, ProblemType } from 'src/app/_data/Model'; import { ExperimentsService } from 'src/app/_services/experiments.service'; import { SaveExperimentDialogComponent } from 'src/app/_modals/save-experiment-dialog/save-experiment-dialog.component'; import { AlertDialogComponent } from 'src/app/_modals/alert-dialog/alert-dialog.component'; @@ -181,8 +181,13 @@ export class ColumnTableComponent implements AfterViewInit { this.columnTableChanged.emit(); } - columnTypeChanged(columnName: string) { - if (this.experiment.outputColumn == columnName) + columnTypeChanged(columnName: string, colIndex: number) { + + this.experiment.nullValuesReplacers[colIndex].option = NullValueOptions.DeleteRows; + this.experiment.nullValuesReplacers[colIndex].value = ""; + this.nullValOption[colIndex] = "Obriši redove (" + this.dataset?.columnInfo[colIndex].numNulls + ")"; + + if (this.experiment.outputColumn == columnName) this.changeProblemType(); else this.columnTableChangeDetected(); -- cgit v1.2.3 From 542acf92fd69fea61afbef34f12cd6147f919bc8 Mon Sep 17 00:00:00 2001 From: Sonja Galovic Date: Sun, 5 Jun 2022 19:19:56 +0200 Subject: Ispravljeno da kod ucitavanje prediktora iz kolekcije bude lepo ucitan model. Disable-ovani dugmici za cuvanje dataseta i modela da se ne bi vise puta slao zahtev backu za cuvanje istog. Biranje drugog dataseta nakon izbora prvog (refresh). --- .../app/_elements/column-table/column-table.component.ts | 6 +++++- frontend/src/app/_elements/folder/folder.component.ts | 15 ++++++++++++++- .../app/_elements/form-dataset/form-dataset.component.ts | 1 + .../src/app/_pages/experiment/experiment.component.html | 2 +- .../src/app/_pages/experiment/experiment.component.ts | 11 +++++++---- 5 files changed, 28 insertions(+), 7 deletions(-) (limited to 'frontend/src/app/_elements/column-table/column-table.component.ts') diff --git a/frontend/src/app/_elements/column-table/column-table.component.ts b/frontend/src/app/_elements/column-table/column-table.component.ts index 8d2875a5..96818976 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.ts +++ b/frontend/src/app/_elements/column-table/column-table.component.ts @@ -88,6 +88,7 @@ export class ColumnTableComponent implements AfterViewInit { if (this.route.snapshot.paramMap.get("id") == null && this.route.snapshot.paramMap.get("predictorId") == null) { this.dataset = dataset; this.setColumnTypeInitial(); + this.resetColumnEncodings(Encoding.Label); this.columnsChecked = []; this.dataset.columnInfo.forEach(column => { @@ -96,7 +97,6 @@ export class ColumnTableComponent implements AfterViewInit { this.resetInputColumns(); this.resetOutputColumn(); - this.resetColumnEncodings(Encoding.Label); this.setDeleteRowsForMissingValTreatment(); this.nullValOption = []; @@ -258,9 +258,11 @@ export class ColumnTableComponent implements AfterViewInit { resetColumnEncodings(encodingType: Encoding) { if (this.experiment != undefined && this.dataset != undefined) { this.experiment.encodings = []; + console.log("prvi: RESET COLUMN ENC, DUZINA ENCODINGS NIZA:", this.experiment.encodings.length); for (let i = 0; i < this.dataset.columnInfo.length; i++) { this.experiment.encodings.push(new ColumnEncoding(this.dataset?.columnInfo[i].columnName, encodingType)); } + console.log("drugi: RESET COLUMN ENC, DUZINA ENCODINGS NIZA:", this.experiment.encodings.length); this.columnTableChangeDetected(); } } @@ -366,6 +368,7 @@ export class ColumnTableComponent implements AfterViewInit { Object.assign(this.experiment, experiment); this.experiment._columnsSelected = true; this.experimentChanged.emit(); + this.okPressed.emit(); } }); } @@ -385,6 +388,7 @@ export class ColumnTableComponent implements AfterViewInit { Object.assign(this.experiment, experiment); this.experiment._columnsSelected = true; this.experimentChanged.emit(); + this.okPressed.emit(); }); } diff --git a/frontend/src/app/_elements/folder/folder.component.ts b/frontend/src/app/_elements/folder/folder.component.ts index fc3b98b2..60f6857c 100644 --- a/frontend/src/app/_elements/folder/folder.component.ts +++ b/frontend/src/app/_elements/folder/folder.component.ts @@ -62,6 +62,8 @@ export class FolderComponent implements AfterViewInit { if (this.type == FolderType.Dataset) { this.refreshFiles(dId); } + this.saveDisabled = false; + console.log("Notify dataset ", this.saveDisabled); }); } else { console.warn("Dataset-Load: No connection!"); @@ -140,6 +142,9 @@ export class FolderComponent implements AfterViewInit { createNewFile() { if (this.type == FolderType.Dataset) { this.newFile = new Dataset(); + this.formNewDataset.files = []; + this.formNewDataset.firstInput = false; + this.formNewDataset.filename = ""; } else if (this.type == FolderType.Model) { this.newFile = new Model(); } @@ -251,6 +256,11 @@ export class FolderComponent implements AfterViewInit { } saveNewFile() { + console.log("USAO U saveDisabled: ", this.saveDisabled); + if (this.saveDisabled) { + console.log("USAO U IF"); + return; + } this.saveDisabled = true; this.loadingAction = true; switch (this.type) { @@ -261,9 +271,11 @@ export class FolderComponent implements AfterViewInit { this.okPressed.emit(); //Shared.openDialog("Obaveštenje", "Uspešno ste dodali novi izvor podataka u kolekciju. Molimo sačekajte par trenutaka da se obradi."); this.refreshFiles(); + this.createNewFile(); }, () => { Shared.openDialog("Neuspeo pokušaj!", "Izvor podataka sa unetim nazivom već postoji u Vašoj kolekciji. Izmenite naziv ili iskoristite postojeći dataset."); + this.saveDisabled = false; }); break; case FolderType.Model: @@ -273,12 +285,13 @@ export class FolderComponent implements AfterViewInit { this.loadingAction = false; //Shared.openDialog("Obaveštenje", "Uspešno ste dodali novu konfiguraciju neuronske mreže u kolekciju."); this.refreshFiles(null, model._id); // todo select model + this.createNewFile(); }, (err) => { Shared.openDialog("Neuspeo pokušaj!", "Konfiguracija neuronske mreže sa unetim nazivom već postoji u Vašoj kolekciji. Izmenite naziv ili iskoristite postojeću konfiguraciju."); + this.saveDisabled = false; }); break; } - this.saveDisabled = false; } predictorsForExp: { [expId: string]: Predictor[] } = {} diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts index 8714ae7f..3df76aa5 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts @@ -155,6 +155,7 @@ export class FormDatasetComponent { uploadDataset(onSuccess: Function = (dataset: Dataset) => { }, onError: Function = () => { }) { if (this.files[0] == undefined) { shared.openDialog("Greška", "Niste izabrali fajl za učitavanje."); + onError(); return; } diff --git a/frontend/src/app/_pages/experiment/experiment.component.html b/frontend/src/app/_pages/experiment/experiment.component.html index a0ed26ef..6bd921fd 100644 --- a/frontend/src/app/_pages/experiment/experiment.component.html +++ b/frontend/src/app/_pages/experiment/experiment.component.html @@ -57,7 +57,7 @@
- +
diff --git a/frontend/src/app/_pages/experiment/experiment.component.ts b/frontend/src/app/_pages/experiment/experiment.component.ts index 5822eedf..20a3afb0 100644 --- a/frontend/src/app/_pages/experiment/experiment.component.ts +++ b/frontend/src/app/_pages/experiment/experiment.component.ts @@ -171,11 +171,13 @@ export class ExperimentComponent implements AfterViewInit { this.modelsService.getModelById(predictor.modelId).subscribe((response) => { let model = response; - this.folderModel.formModel.newModel = model; + this.folderModel.selectFile(model); + //this.folderModel.formModel.newModel = model; this.step3 = true; let numOfEpochsArray = Array.from({ length: model.epochs }, (_, i) => i + 1); setTimeout(() => { this.linechartComponent.update(numOfEpochsArray, predictor.metricsAcc, predictor.metricsLoss, predictor.metricsMae, predictor.metricsMse, predictor.metricsValAcc, predictor.metricsValLoss, predictor.metricsValMae, predictor.metricsValMse); + this.goToPage(3); }) }); }); @@ -189,6 +191,7 @@ export class ExperimentComponent implements AfterViewInit { this.dataset = response; this.folderDataset.forExperiment = this.experiment; this.folderDataset.selectFile(this.dataset); + this.goToPage(1); }); }); } @@ -258,6 +261,9 @@ export class ExperimentComponent implements AfterViewInit { this.step2 = true; setTimeout(() => { this.folderModel.updateExperiment(); + this.folderModel.selectFile(undefined); + this.folderModel.selectTab(TabType.NewFile); + this.goToPage(2); }); } @@ -276,9 +282,6 @@ export class ExperimentComponent implements AfterViewInit { setTimeout(() => { this.columnTable.loadDataset(d); }); - - this.folderModel.selectFile(undefined); - this.folderModel.selectTab(TabType.NewFile); // REFRESH GRAFIKA (4. KORAKA) URADITI } -- cgit v1.2.3