material and activeModelIndex fix

This commit is contained in:
VLE2FE
2020-08-31 16:14:47 +02:00
parent 08d5ac8366
commit 250b04e096
19 changed files with 515 additions and 5 deletions

View File

@ -20,7 +20,7 @@
<h4>
Average result: {{result.mean}}<a [routerLink]='"."' fragment="disclaimer"><sup>#</sup></a>
</h4>
<a href="javascript:" class="rb-details-toggle" rbDetailsToggle #triggerDetails="rbDetailsToggle">Details</a>
<a class="rb-details-toggle" rbDetailsToggle #triggerDetails="rbDetailsToggle">Details</a>
<div *ngIf="triggerDetails.open" class="space-below">
<p *ngFor="let prediction of result.predictions; index as i">
{{spectrumNames[i]}}: {{prediction}}<a [routerLink]='"."' fragment="disclaimer"><sup>#</sup></a>

View File

@ -99,6 +99,8 @@ export class PredictionComponent implements OnInit {
loadPrediction() {
this.loading = true;
console.log(this.activeGroup);
console.log(this.activeModelIndex);
this.api.post<any>(this.activeGroup.models[this.activeModelIndex].url, this.flattenedSpectra, data => {
this.result = {
predictions: Object.entries(omit(data, ['mean', 'std', 'label']))
@ -114,7 +116,9 @@ export class PredictionComponent implements OnInit {
}
groupChange(index) {
console.log(index);
this.activeGroup = this.d.arr.modelGroups[index];
this.activeModelIndex = 0;
this.result = undefined;
}