From ba32f0dee330fcbc82842f4d19e9e3df791131a7 Mon Sep 17 00:00:00 2001 From: "Hartung, Michael" <michael.hartung@uni-hamburg.de> Date: Thu, 20 Oct 2022 16:51:29 +0200 Subject: [PATCH] reverse selection --- .../explorer-page.component.html | 32 ++++++++++--------- src/app/services/analysis/analysis.service.ts | 10 ++++-- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index 0687ed35..82cf9555 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -1,6 +1,5 @@ <div id="appWindow" (window:resize)="onResize($event)"> <div class="is-hidden-mobile fullheight" id="appContainer"> - <app-license-agreement></app-license-agreement> <app-launch-analysis @@ -10,7 +9,6 @@ > </app-launch-analysis> - <app-add-expressed-proteins [(show)]="showThresholdDialog" [selectedTissue]="networkHandler.activeNetwork.currentViewSelectedTissue" @@ -190,9 +188,15 @@ </div> </div> - <app-quick-drug-target *ngIf="drugstoneConfig.config.showConnectGenes" (taskEvent)="emitTaskEvent($event)"></app-quick-drug-target> + <app-quick-drug-target + *ngIf="drugstoneConfig.config.showConnectGenes" + (taskEvent)="emitTaskEvent($event)" + ></app-quick-drug-target> - <app-quick-drug *ngIf="drugstoneConfig.config.showSimpleAnalysis" (taskEvent)="emitTaskEvent($event)"></app-quick-drug> + <app-quick-drug + *ngIf="drugstoneConfig.config.showSimpleAnalysis" + (taskEvent)="emitTaskEvent($event)" + ></app-quick-drug> <div *ngIf="drugstoneConfig.config.showAdvAnalysis" @@ -465,17 +469,18 @@ </i> </div> - <footer class="card-footer"> - <!-- <a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary" - tooltipPosition="top" pTooltip="Invert the current selection."> + <a + (click)="analysis.invertSelection(networkHandler.activeNetwork.currentViewNodes)" + class="card-footer-item text-primary" + tooltipPosition="top" + pTooltip="Invert the current selection." + > <span class="icon"> <i class="fa fa-sync"></i> </span> - <span> - Invert - </span> - </a> --> + <span> Invert </span> + </a> <a *ngIf="analysis.getSelection().length" (click)="analysis.resetSelection()" @@ -510,10 +515,7 @@ ></app-analysis-panel> </div> <!-- explorer network --> - <app-network - networkType="explorer" - [nodeData]="nodeData" - ></app-network> + <app-network networkType="explorer" [nodeData]="nodeData"></app-network> </div> <!-- End network block --> diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts index f39a5613..40ac700e 100644 --- a/src/app/services/analysis/analysis.service.ts +++ b/src/app/services/analysis/analysis.service.ts @@ -177,16 +177,20 @@ export class AnalysisService { public invertSelection(nodes) { const newSelection = []; nodes.forEach((node: Node) => { + if (node.drugstoneType !== 'protein') { + // only consider proteins + return + } const wrapper = getWrapperFromNode(node); if (!this.inSelection(wrapper)) { newSelection.push(wrapper); } }); - this.selectedItems.clear(); + this.resetSelection() for (const wrapper of newSelection) { - this.selectedItems.set(wrapper.nodeId, wrapper); + this.selectedItems.set(wrapper.id, wrapper); } - this.selectListSubject.next({items: newSelection, selected: null}); + this.selectListSubject.next({items: newSelection, selected: true}); } resetSelection() { -- GitLab