Skip to content
Snippets Groups Projects
Commit be74b364 authored by ge54hev's avatar ge54hev
Browse files

selection by ctrl

parent 8ed9293e
Branches
Tags
No related merge requests found
......@@ -166,7 +166,7 @@
<!-- </header>-->
<div *ngIf="showDetails" class="card-content">
<div class="content">
<h2>Summary</h2>
<!-- <h2>Summary</h2>-->
<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 {Effect, Protein, ProteinNetwork} from '../protein-network';
import {HttpClient} from '@angular/common/http';
......@@ -19,6 +19,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 }> = [];
......@@ -40,6 +41,32 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
public queryItems = [];
public showAnalysisDialog = false;
@HostListener('window:keydown', ['$event'])
handleKeyboardEvent1(event: KeyboardEvent) {
if (event.keyCode == 17)
{
this.watcher = 1;
console.log(this.watcher);
}
}
@HostListener('window:keyup', ['$event'])
handleKeyboardEvent(event: KeyboardEvent) {
if (event.keyCode == 17)
{
this.watcher = 0;
console.log(this.watcher);
}
}
@ViewChild('network', {static: false}) networkEl: ElementRef;
constructor(private http: HttpClient,
......@@ -189,11 +216,22 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
const id: Array<string> = properties.nodes;
// TODO use groupID
console.log(id);
if (id.length > 0) {
console.log(this.watcher);
if (id.length > 0) {
console.log('clicked node:', id);
if (id[0].startsWith('pg_')) {
const protein = this.proteinData.getProtein(id[0].substr(3));
this.openSummary(protein, false);
console.log(this.currentProteinAc);
if (this.watcher==1){
if(this.inSelection(protein.proteinAc) == true){
console.log(this.removeFromSelection(protein.proteinAc));
} else{
console.log(this.addToSelection(protein.proteinAc));
// console.log(this.removeFromSelection(this.currentProteinAc));
console.log(this.analysis.getCount());
}
}
} else {
this.closeSummary();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment