Skip to content
Snippets Groups Projects
Commit cda562d5 authored by Julian Späth's avatar Julian Späth
Browse files

Merge branch 'pretty-tables' into 'master'

Pretty tables

See merge request covid-19/frontend!74
parents 538cc694 2ba5b86e
No related branches found
No related tags found
No related merge requests found
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
"space-tab-mixed-disabled": true, "space-tab-mixed-disabled": true,
"style-disabled": true, "style-disabled": true,
"attr-no-duplication": true, "attr-no-duplication": true,
"tagname-lowercase": true "tagname-lowercase": false
} }
...@@ -201,9 +201,9 @@ ...@@ -201,9 +201,9 @@
} }
}, },
"@angular/animations": { "@angular/animations": {
"version": "9.0.7", "version": "9.1.1",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-9.0.7.tgz", "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-9.1.1.tgz",
"integrity": "sha512-74gY7onajmmnksy5E0/32bFv3B9NuWxV64kqD15YjGrh8AWe1BHt5enQI+rJ2tO8m2DKnwZsctis6k0Kcy+YKQ==" "integrity": "sha512-IvKv8sV0ymbzDEX2ZLW+F6nOTQqDYallHexuzRVT9txvNE8TNHyySvLcyC5dTmX9fj9LA72NZ6nFyhxq0LFvtQ=="
}, },
"@angular/cdk": { "@angular/cdk": {
"version": "9.2.0", "version": "9.2.0",
...@@ -9147,6 +9147,16 @@ ...@@ -9147,6 +9147,16 @@
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
"dev": true "dev": true
}, },
"primeicons": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/primeicons/-/primeicons-2.0.0.tgz",
"integrity": "sha512-GJTCeMSQU8UU1GqbsaDrg/IH+b/vSinJQl52NVpdJ7sShYLZA8Eq6jLF48Ye3N/dQloGrE07i7XsZvxQ9pNbqg=="
},
"primeng": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/primeng/-/primeng-9.0.5.tgz",
"integrity": "sha512-juugoXZaU7TyGyTSFx0PNjObqM+/RTY/arJ/LwyH/0KaIv0V+Oqfvnx8btJ96kLOZ+h0xLWXLuAbxsTXe9EX6w=="
},
"private": { "private": {
"version": "0.1.8", "version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "~9.0.2", "@angular/animations": "^9.1.1",
"@angular/cdk": "^9.2.0", "@angular/cdk": "^9.2.0",
"@angular/common": "~9.0.2", "@angular/common": "~9.0.2",
"@angular/compiler": "~9.0.2", "@angular/compiler": "~9.0.2",
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
"bulma": "^0.8.1", "bulma": "^0.8.1",
"bulma-toast": "^1.5.4", "bulma-toast": "^1.5.4",
"html2canvas": "^1.0.0-rc.5", "html2canvas": "^1.0.0-rc.5",
"primeicons": "^2.0.0",
"primeng": "^9.0.5",
"python": "0.0.4", "python": "0.0.4",
"python-shell": "^1.0.8", "python-shell": "^1.0.8",
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
......
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {NgSelectModule} from '@ng-select/ng-select'; import {NgSelectModule} from '@ng-select/ng-select';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {HttpClientModule} from '@angular/common/http';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {TableModule} from 'primeng/table';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {AppRoutingModule} from './app-routing.module';
import {ExplorerPageComponent} from './pages/explorer-page/explorer-page.component'; import {ExplorerPageComponent} from './pages/explorer-page/explorer-page.component';
import {AboutPageComponent} from './pages/about-page/about-page.component'; import {AboutPageComponent} from './pages/about-page/about-page.component';
import {HomePageComponent} from './pages/home-page/home-page.component'; import {HomePageComponent} from './pages/home-page/home-page.component';
import {HttpClientModule} from '@angular/common/http';
import {QueryComponent} from './components/query/query.component'; import {QueryComponent} from './components/query/query.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {LaunchAnalysisComponent} from './components/launch-analysis/launch-analysis.component'; import {LaunchAnalysisComponent} from './components/launch-analysis/launch-analysis.component';
import {SelectDatasetComponent} from './components/select-dataset/select-dataset.component'; import {SelectDatasetComponent} from './components/select-dataset/select-dataset.component';
import {AnalysisWindowComponent} from './components/analysis-window/analysis-window.component'; import {AnalysisWindowComponent} from './components/analysis-window/analysis-window.component';
import {TaskListComponent} from './components/task-list/task-list.component'; import {TaskListComponent} from './components/task-list/task-list.component';
import {ToggleComponent} from './components/toggle/toggle.component';
import {AnalysisService} from './analysis.service'; import {AnalysisService} from './analysis.service';
import { ToggleComponent } from './components/toggle/toggle.component';
@NgModule({ @NgModule({
...@@ -42,6 +43,7 @@ import { ToggleComponent } from './components/toggle/toggle.component'; ...@@ -42,6 +43,7 @@ import { ToggleComponent } from './components/toggle/toggle.component';
CommonModule, CommonModule,
HttpClientModule, HttpClientModule,
BrowserAnimationsModule, BrowserAnimationsModule,
TableModule,
], ],
providers: [AnalysisService], providers: [AnalysisService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
......
...@@ -138,24 +138,36 @@ ...@@ -138,24 +138,36 @@
<span>Download</span> <span>Download</span>
</a> </a>
</div> </div>
<table class="table is-striped" *ngIf="tableDrugs.length > 0"> <p-table *ngIf="tableDrugs.length > 0" [value]="tableDrugs">
<thead> <ng-template pTemplate="header">
<tr> <tr>
<td>ID</td> <th [pSortableColumn]="'drugId'">
<td>Name</td> ID
<td>Status</td> <p-sortIcon [field]="'drugId'"></p-sortIcon>
<td *ngIf="tableHasScores">Score</td> </th>
</tr> <th [pSortableColumn]="'name'">
</thead> Name
<tbody> <p-sortIcon [field]="'name'"></p-sortIcon>
<tr *ngFor="let e of tableDrugs"> </th>
<td><a href="https://www.drugbank.ca/drugs/{{ e.drugId }}" target="_blank">{{ e.drugId }}</a></td> <th [pSortableColumn]="'status'">
<td>{{e.name}}</td> Status
<td>{{e.status}}</td> <p-sortIcon [field]="'status'"></p-sortIcon>
<td *ngIf="tableHasScores">{{e.score}}</td> </th>
</tr> <th *ngIf="tableHasScores" [pSortableColumn]="'score'">
</tbody> Score
</table> <p-sortIcon [field]="'score'"></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-e>
<tr>
<td><a href="https://www.drugbank.ca/drugs/{{ e.drugId }}" target="_blank">{{ e.drugId }}</a></td>
<td>{{e.name}}</td>
<td>{{e.status}}</td>
<td *ngIf="tableHasScores">{{e.score || ''}}</td>
</tr>
</ng-template>
</p-table>
<div *ngIf="tableProteins.length > 0"> <div *ngIf="tableProteins.length > 0">
<h4 class="is-4"> <h4 class="is-4">
...@@ -167,22 +179,31 @@ ...@@ -167,22 +179,31 @@
<span>Download</span> <span>Download</span>
</a> </a>
</div> </div>
<table class="table is-striped" *ngIf="tableProteins.length > 0"> <p-table *ngIf="tableProteins.length > 0" [value]="tableProteins">
<thead> <ng-template pTemplate="header">
<tr> <tr>
<td>AC</td> <th [pSortableColumn]="'proteinAc'">
<td>Gene</td> AC
<td *ngIf="tableHasScores">Score</td> <p-sortIcon [field]="'proteinAc'"></p-sortIcon>
</th>
<th [pSortableColumn]="'name'">
Gene
<p-sortIcon [field]="'name'"></p-sortIcon>
</th>
<th *ngIf="tableHasScores" [pSortableColumn]="'score'">
Score
<p-sortIcon [field]="'score'"></p-sortIcon>
</th>
</tr> </tr>
</thead> </ng-template>
<tbody> <ng-template pTemplate="body" let-e>
<tr *ngFor="let e of tableProteins"> <tr>
<td><a href="https://www.uniprot.org/uniprot/{{ e.proteinAc }}" target="_blank">{{ e.proteinAc }}</a></td> <td><a href="https://www.uniprot.org/uniprot/{{ e.proteinAc }}" target="_blank">{{ e.proteinAc }}</a></td>
<td>{{e.name}}</td> <td>{{e.name}}</td>
<td *ngIf="tableHasScores">{{e.score}}</td> <td *ngIf="tableHasScores">{{e.score || ''}}</td>
</tr> </tr>
</tbody> </ng-template>
</table> </p-table>
<div *ngIf="tableViralProteins.length > 0"> <div *ngIf="tableViralProteins.length > 0">
<h4 class="is-4"> <h4 class="is-4">
...@@ -194,22 +215,31 @@ ...@@ -194,22 +215,31 @@
<span>Download</span> <span>Download</span>
</a> </a>
</div> </div>
<table class="table is-striped" *ngIf="tableViralProteins.length > 0"> <p-table *ngIf="tableViralProteins.length > 0" [value]="tableViralProteins">
<thead> <ng-template pTemplate="header">
<tr> <tr>
<td>Name</td> <td [pSortableColumn]="'effectName'">
<td>Virus Strain</td> Name
<td *ngIf="tableHasScores">Score</td> <p-sortIcon [field]="'effectName'"></p-sortIcon>
</td>
<td [pSortableColumn]="'virusName'">
Virus Strain
<p-sortIcon [field]="'virusName'"></p-sortIcon>
</td>
<td *ngIf="tableHasScores" [pSortableColumn]="'score'">
Score
<p-sortIcon [field]="'score'"></p-sortIcon>
</td>
</tr> </tr>
</thead> </ng-template>
<tbody> <ng-template pTemplate="body" let-e>
<tr *ngFor="let e of tableViralProteins"> <tr>
<td>{{e.effectName}}</td> <td>{{e.effectName}}</td>
<td>{{e.virusName}}</td> <td>{{e.virusName}}</td>
<td *ngIf="tableHasScores">{{e.score}}</td> <td *ngIf="tableHasScores">{{e.score || ''}}</td>
</tr> </tr>
</tbody> </ng-template>
</table> </p-table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -26,7 +26,7 @@ interface Scored { ...@@ -26,7 +26,7 @@ interface Scored {
@Component({ @Component({
selector: 'app-analysis-window', selector: 'app-analysis-window',
templateUrl: './analysis-window.component.html', templateUrl: './analysis-window.component.html',
styleUrls: ['./analysis-window.component.scss'] styleUrls: ['./analysis-window.component.scss'],
}) })
export class AnalysisWindowComponent implements OnInit, OnChanges { export class AnalysisWindowComponent implements OnInit, OnChanges {
......
...@@ -4,8 +4,11 @@ ...@@ -4,8 +4,11 @@
@import url('https://fonts.googleapis.com/css?family=Varela+Round'); @import url('https://fonts.googleapis.com/css?family=Varela+Round');
@import "~@ng-select/ng-select/themes/default.theme.css"; @import "~@ng-select/ng-select/themes/default.theme.css";
$family-sans-serif: "Varela Round", sans-serif; $family-sans-serif: "Varela Round", sans-serif;
@import "~bulma/bulma.sass"; @import "~bulma/bulma.sass";
@import "~primeng/resources/primeng.css";
@import "~primeicons/primeicons.css";
html { html {
overflow: hidden; overflow: hidden;
...@@ -117,14 +120,17 @@ div.card.network { ...@@ -117,14 +120,17 @@ div.card.network {
} }
div.network { div.network {
height: calc(100vh - 210px); height: calc(100vh - 210px);
} }
div.parent { div.parent {
position: relative; position: relative;
} }
div.image1 { div.image1 {
position: relative; position: relative;
} }
div.image2 { div.image2 {
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
...@@ -185,5 +191,11 @@ div.field.has-addons.add-remove-toggle { ...@@ -185,5 +191,11 @@ div.field.has-addons.add-remove-toggle {
border-top: 2px solid #d0d0d0; border-top: 2px solid #d0d0d0;
} }
html, body { height: 100%; } html, body {
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } height: 100%;
}
body {
margin: 0;
font-family: Roboto, "Helvetica Neue", sans-serif;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment