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 @@
</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>
......
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();
}
......
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