diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index a47fccae43e20c7900d5ed06e9bee718492ea4d7..aaaebed886c2e9d1eff538747c6a99a30b4202ae 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -182,6 +182,8 @@ </header> <div *ngIf="showDetails" class="card-content"> <div class="content"> +<!-- <h2>Summary</h2>--> + <p>Hold down the CTRL button to select multiple proteins.</p> <figure class="image"> <!-- <img src="assets/boxplot.png" alt="Boxplots">--> </figure> diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index 062f9ea7a22513a08b6cd5a8bfd94786e003defb..9be11bd6f93489343f4810875a8c33144c6bd610 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -1,4 +1,4 @@ -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 {Edge, Effect, getDatasetFilename, Protein, ProteinNetwork} from '../protein-network'; import {HttpClient} from '@angular/common/http'; @@ -7,6 +7,8 @@ import {AnalysisService} from '../../analysis.service'; declare var vis: any; + + @Component({ selector: 'app-explorer-page', templateUrl: './explorer-page.component.html', @@ -19,6 +21,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { public geneNames: Array<string> = []; public proteinNames: Array<string> = []; public proteinAcs: Array<string> = []; + public watcher = 0; public viralProteinCheckboxes: Array<{ checked: boolean; data: Effect }> = []; @@ -48,6 +51,28 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { @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, private route: ActivatedRoute, private router: Router, @@ -205,6 +230,20 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { if (id[0].startsWith('pg_')) { const protein = this.proteinData.getProtein(id[0].substr(3)); 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 { this.closeSummary(); }