Skip to content

Commit 577adb5

Browse files
committed
UI: Modify graph's wrapper component (#1879)
* Make the wrapper component use the new graph. * Show the graph when at least one trial is completed. Signed-off-by: Elena Zioga <[email protected]>
1 parent c5ab5f7 commit 577adb5

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,21 @@
1313
<ng-container *ngIf="pageLoading; else content">
1414
<lib-loading-spinner></lib-loading-spinner>
1515
</ng-container>
16-
1716
<!--the tabs-->
1817
</div>
1918
</div>
2019

2120
<ng-template #content>
22-
<app-trials-graph
21+
<app-trials-graph-echarts
2322
*ngIf="showGraph; else emptyGraph"
2423
[experimentTrialsCsv]="experimentTrialsCsv"
25-
[hoveredTrial]="hoveredTrial"
24+
[experiment]="experimentDetails"
2625
class="graph"
27-
></app-trials-graph>
26+
></app-trials-graph-echarts>
2827

2928
<ng-template #emptyGraph>
3029
<lib-panel icon="info" color="primary" class="panel">
31-
Couldn't find information for the underlying Trials.
30+
Couldn't find any successful Trial.
3231
</lib-panel>
3332
</ng-template>
3433

pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy {
110110
const data = transformStringResponses(response);
111111
this.columns = data.types;
112112
this.details = this.parseTrialsDetails(data.details);
113-
this.showGraph = true;
113+
this.showGraph = this.showGraphF(response);
114114
});
115115
this.backendService
116116
.getExperiment(this.name, this.namespace)
@@ -184,7 +184,7 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy {
184184
const data = transformStringResponses(trials);
185185
this.columns = data.types;
186186
this.details = this.parseTrialsDetails(data.details);
187-
this.showGraph = trials.split(/\r\n|\r|\n/).length > 1;
187+
this.showGraph = this.showGraphF(trials);
188188
});
189189
}),
190190
);
@@ -253,4 +253,10 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy {
253253
return StatusEnum.CREATED;
254254
}
255255
}
256+
257+
private showGraphF(response: string): boolean {
258+
if (!response.includes(',,') && response.includes('\n')) {
259+
return true;
260+
}
261+
}
256262
}

pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-details/experiment-details.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { TrialsTableModule } from './trials-table/trials-table.module';
1515
import { ExperimentOverviewModule } from './overview/experiment-overview.module';
1616
import { ExperimentDetailsTabModule } from './details/experiment-details-tab.module';
1717
import { ExperimentYamlModule } from './yaml/experiment-yaml.module';
18+
import { TrialsGraphEchartsModule } from './trials-graph-echarts/trials-graph-echarts.module';
1819

1920
@NgModule({
2021
declarations: [ExperimentDetailsComponent],
@@ -31,6 +32,7 @@ import { ExperimentYamlModule } from './yaml/experiment-yaml.module';
3132
MatProgressSpinnerModule,
3233
ExperimentYamlModule,
3334
TitleActionsToolbarModule,
35+
TrialsGraphEchartsModule
3436
],
3537
exports: [ExperimentDetailsComponent],
3638
})

0 commit comments

Comments
 (0)