Skip to content

Commit

Permalink
Natura sort the annotation data type in the side window #3
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Mar 12, 2022
1 parent e287bd2 commit ffe37ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/app/main/apps/annotation/services/annotation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export class AnnotationService {
this.annotationNodes = this._buildAnnotationTree(this.annotations);
this.dataSource.data = this.annotationNodes;
this.onAnnotationTreeChanged.next(this.annotationNodes);

console.log(this.annotationNodes)
});
}

Expand Down
15 changes: 1 addition & 14 deletions src/app/main/apps/snp/snp-detail/snp-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SnpDetailComponent implements OnInit, OnDestroy {
if (!snpRow) {
return
}
this.rows = this.columnsToRows(snpRow);
this.rows = snpRow;

});
}
Expand All @@ -45,19 +45,6 @@ export class SnpDetailComponent implements OnInit, OnDestroy {
this._unsubscribeAll.complete();
}

columnsToRows(snpRow) {
const rows = [...Object.keys(snpRow)].map((name) => {
const detail = this.annotationService.findDetailByName(name);
return {
name: name,
label: detail.label ? detail.label : name,
valueType: detail.value_type,
value: snpRow[name]
}
});

return rows;
}

mapGOids(valueType, value) {
if (!value) {
Expand Down
12 changes: 10 additions & 2 deletions src/app/main/apps/snp/snp-table/snp-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,16 @@ export class SnpTableComponent implements OnInit {
}

selectSnp(row) {
this.snpService.onSnpChanged.next(row);

const details = this.snpPage.source.map((key) => {
const detail = this.annotationService.findDetailByName(key);
return {
name: key,
label: detail.label ? detail.label : key,
valueType: detail.value_type,
value: row[key]
}
});
this.snpService.onSnpChanged.next(details);
this.noctuaMenuService.openRightDrawer();

}
Expand Down

0 comments on commit ffe37ba

Please sign in to comment.