From 5ce3f1d1d9e4e1dd4ce6624240749572304a0062 Mon Sep 17 00:00:00 2001 From: Michael Hartung <michi@Michaels-MacBook-Pro.local> Date: Tue, 27 Jul 2021 12:36:41 +0200 Subject: [PATCH] gradient node attribute map to always recreate gradient e.g. for seed highlighting --- .../analysis-panel/analysis-panel.component.ts | 11 +++++++++-- src/app/services/analysis/analysis.service.ts | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/components/analysis-panel/analysis-panel.component.ts b/src/app/components/analysis-panel/analysis-panel.component.ts index 93639024..1387e48c 100644 --- a/src/app/components/analysis-panel/analysis-panel.component.ts +++ b/src/app/components/analysis-panel/analysis-panel.component.ts @@ -115,7 +115,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { public tableProteinScoreTooltip = ''; public expressionMap: NodeAttributeMap; - public gradientMap: NodeAttributeMap; + public gradientMap: NodeAttributeMap = {}; constructor(private http: HttpClient, public analysis: AnalysisService, public netex: NetexControllerService) { } @@ -351,6 +351,12 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { } close() { + this.gradientMap = {}; + this.expressionExpanded = false; + this.expressionMap = undefined; + this.seedMap = {}; + this.highlightSeeds = false; + this.showDrugs = false; this.analysis.switchSelection('main'); this.token = null; this.tokenChange.emit(this.token); @@ -539,6 +545,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { node.x = pos[item.id].x; node.y = pos[item.id].y; const isSeed = this.highlightSeeds ? this.seedMap[node.id] : false; + const gradient = (this.gradientMap !== {}) && (this.gradientMap[item.id]) ? this.gradientMap[item.id] : 1.0; Object.assign( node, NetworkSettings.getNodeStyle( @@ -546,7 +553,7 @@ export class AnalysisPanelComponent implements OnInit, OnChanges { this.myConfig, isSeed, this.analysis.inSelection(getWrapperFromNode(item)), - 1.0 + gradient ) ) updatedNodes.push(node); diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts index cc9738a8..97b4accc 100644 --- a/src/app/services/analysis/analysis.service.ts +++ b/src/app/services/analysis/analysis.service.ts @@ -365,7 +365,7 @@ export class AnalysisService { clearInterval(this.intervalId); } // 5000 - this.intervalId = setInterval(watch, 5000000000000); + this.intervalId = setInterval(watch, 5000); } -- GitLab