Skip to content
Snippets Groups Projects
Commit df7fe6b2 authored by Mhaned Oubounyt's avatar Mhaned Oubounyt
Browse files

Merge branch 'selection' into 'master'

Selection

See merge request covid-19/frontend!21
parents 89b884b2 519c6207
No related branches found
No related tags found
No related merge requests found
...@@ -182,6 +182,8 @@ ...@@ -182,6 +182,8 @@
</header> </header>
<div *ngIf="showDetails" class="card-content"> <div *ngIf="showDetails" class="card-content">
<div class="content"> <div class="content">
<!-- <h2>Summary</h2>-->
<p>Hold down the CTRL button to select multiple proteins.</p>
<figure class="image"> <figure class="image">
<!-- <img src="assets/boxplot.png" alt="Boxplots">--> <!-- <img src="assets/boxplot.png" alt="Boxplots">-->
</figure> </figure>
......
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild, Output, EventEmitter} from '@angular/core'; import {AfterViewInit, Component, ElementRef, OnInit, ViewChild, Output, EventEmitter, HostListener} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Edge, Effect, getDatasetFilename, Protein, ProteinNetwork} from '../protein-network'; import {Edge, Effect, getDatasetFilename, Protein, ProteinNetwork} from '../protein-network';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
...@@ -7,6 +7,8 @@ import {AnalysisService} from '../../analysis.service'; ...@@ -7,6 +7,8 @@ import {AnalysisService} from '../../analysis.service';
declare var vis: any; declare var vis: any;
@Component({ @Component({
selector: 'app-explorer-page', selector: 'app-explorer-page',
templateUrl: './explorer-page.component.html', templateUrl: './explorer-page.component.html',
...@@ -19,6 +21,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -19,6 +21,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
public geneNames: Array<string> = []; public geneNames: Array<string> = [];
public proteinNames: Array<string> = []; public proteinNames: Array<string> = [];
public proteinAcs: Array<string> = []; public proteinAcs: Array<string> = [];
public watcher = 0;
public viralProteinCheckboxes: Array<{ checked: boolean; data: Effect }> = []; public viralProteinCheckboxes: Array<{ checked: boolean; data: Effect }> = [];
...@@ -48,6 +51,28 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -48,6 +51,28 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
@ViewChild('network', {static: false}) networkEl: ElementRef; @ViewChild('network', {static: false}) networkEl: ElementRef;
@HostListener('window:keydown', ['$event'])
handleKeyboardEvent1(event: KeyboardEvent) {
if (event.ctrlKey) {
this.watcher = 1;
// console.log(this.watcher);
}
}
@HostListener('window:keyup', ['$event'])
handleKeyboardEvent(event: KeyboardEvent) {
if (event.ctrlKey) {
this.watcher = 0;
// console.log(this.watcher);
}
}
constructor(private http: HttpClient, constructor(private http: HttpClient,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
...@@ -205,6 +230,20 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -205,6 +230,20 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
if (id[0].startsWith('pg_')) { if (id[0].startsWith('pg_')) {
const protein = this.proteinData.getProtein(id[0].substr(3)); const protein = this.proteinData.getProtein(id[0].substr(3));
this.openSummary(protein, false); this.openSummary(protein, false);
// tslint:disable-next-line:no-console
console.log(this.currentProteinAc);
if (this.watcher === 1 ) {
if (this.inSelection(protein.proteinAc) === true) {
// tslint:disable-next-line:no-console
console.log(this.removeFromSelection(protein.proteinAc));
} else {
// tslint:disable-next-line:no-console
console.log(this.addToSelection(protein.proteinAc));
// console.log(this.removeFromSelection(this.currentProteinAc));
// tslint:disable-next-line:no-console
console.log(this.analysis.getCount());
}
}
} else { } else {
this.closeSummary(); this.closeSummary();
} }
......
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