Skip to content

Commit 7402c48

Browse files
committed
feat: add pbt tab to experiment view to enable more suitable inspection of HP sweep
1 parent c6e90d6 commit 7402c48

File tree

7 files changed

+490
-0
lines changed

7 files changed

+490
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
[experimentJson]="experimentDetails"
6161
></app-experiment-yaml>
6262
</mat-tab>
63+
<mat-tab label="PBT">
64+
<app-experiment-pbt-tab
65+
[experiment]="experimentDetails"
66+
[annotationsCsv]="annotationsCsv"
67+
[experimentTrialsCsv]="experimentTrialsCsv"
68+
></app-experiment-pbt-tab>
69+
</mat-tab>
6370
</mat-tab-group>
6471
</div>
6572
</ng-template>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy {
3030
columns: string[] = [];
3131
details: string[][] = [];
3232
experimentTrialsCsv: string;
33+
annotationsCsv: string;
3334
hoveredTrial: number;
3435
experimentDetails: ExperimentK8s;
3536
showGraph: boolean;
@@ -94,6 +95,11 @@ export class ExperimentDetailsComponent implements OnInit, OnDestroy {
9495
this.details = this.parseTrialsDetails(data.details);
9596
this.showGraph = true;
9697
});
98+
this.backendService
99+
.getExperimentAnnotationsInfo(this.name, this.namespace)
100+
.subscribe(response => {
101+
this.annotationsCsv = response;
102+
});
97103
this.backendService
98104
.getExperiment(this.name, this.namespace)
99105
.subscribe((response: ExperimentK8s) => {

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
@@ -16,6 +16,7 @@ import { ExperimentOverviewModule } from './overview/experiment-overview.module'
1616
import { ExperimentDetailsTabModule } from './details/experiment-details-tab.module';
1717
import { TrialsGraphModule } from './trials-graph/trials-graph.module';
1818
import { ExperimentYamlModule } from './yaml/experiment-yaml.module';
19+
import { PbtTabModule } from './pbt/pbt-tab-loader.module';
1920

2021
@NgModule({
2122
declarations: [ExperimentDetailsComponent],
@@ -33,6 +34,7 @@ import { ExperimentYamlModule } from './yaml/experiment-yaml.module';
3334
MatProgressSpinnerModule,
3435
ExperimentYamlModule,
3536
TitleActionsToolbarModule,
37+
PbtTabModule,
3638
],
3739
exports: [ExperimentDetailsComponent],
3840
})
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
import { FormsModule } from '@angular/forms';
5+
import { MatFormFieldModule } from '@angular/material/form-field';
6+
import { MatSelectModule } from '@angular/material/select';
7+
import { MatCheckboxModule } from '@angular/material/checkbox';
8+
9+
import { PbtTabComponent } from './pbt-tab.component';
10+
11+
@NgModule({
12+
declarations: [PbtTabComponent],
13+
imports: [CommonModule, FormsModule, MatFormFieldModule, MatSelectModule, MatCheckboxModule],
14+
exports: [PbtTabComponent],
15+
})
16+
export class PbtTabModule {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div class="pbt-wrapper">
2+
3+
<div class="pbt-options-wrapper">
4+
<mat-form-field appearance="fill" class="pbt-option">
5+
<mat-label>Y-Axis</mat-label>
6+
<mat-select [(ngModel)]="selectedName" (ngModelChange)="onDropdownChange()">
7+
<mat-option *ngFor="let name of selectableNames" [value]="name">
8+
{{name}}
9+
</mat-option>
10+
</mat-select>
11+
</mat-form-field>
12+
13+
<mat-checkbox [(ngModel)]="displayTrace" (ngModelChange)="onTraceChange()">Display Seed Traces</mat-checkbox>
14+
</div>
15+
16+
<div #pbtGraph id="pbt-graph" class="d3-tab-graph"></div>
17+
18+
</div>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
:host {
2+
display: block;
3+
}
4+
5+
.pbt-wrapper {
6+
position: relative;
7+
display: flex;
8+
justify-content: center;
9+
align-items: center;
10+
flex-direction: column;
11+
}
12+
13+
.pbt-options-wrapper {
14+
display: flex;
15+
align-items: center;
16+
flex-direction: row;
17+
}
18+
19+
.pbt-option {
20+
margin: 10px
21+
}
22+
23+
.d3-tab-graph {
24+
width: 400px;
25+
text-align: center;
26+
27+
@media (min-width: 768px) {
28+
width: 700px;
29+
}
30+
31+
@media (min-width: 1024px) {
32+
width: 1000px;
33+
}
34+
35+
@media (min-width: 1400px) {
36+
width: 1300px;
37+
}
38+
39+
@media (min-width: 1650px) {
40+
width: 1600px;
41+
}
42+
43+
@media (min-width: 2000px) {
44+
width: 1900px;
45+
}
46+
47+
height: 600px;
48+
}

0 commit comments

Comments
 (0)