Skip to content
Snippets Groups Projects
Commit 8ed9293e authored by Julian Späth's avatar Julian Späth
Browse files

Merge branch 'keep-node-position' into 'master'

Keep node position when highlighting selection

See merge request covid-19/frontend!14
parents 29d5c542 436a3fe8
No related branches found
No related tags found
No related merge requests found
......@@ -82,14 +82,16 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.analysis.subscribe((protein, selected) => {
const nodeId = `pg_${protein.proteinAc}`;
const node = this.nodeData.nodes.get(nodeId);
const pos = this.network.getPositions([nodeId]);
node.x = pos[nodeId].x;
node.y = pos[nodeId].y;
if (selected) {
const node = this.nodeData.nodes.get(nodeId);
if (node) {
node.color = '#c42eff';
this.nodeData.nodes.update(node);
}
} else {
const node = this.nodeData.nodes.get(nodeId);
if (node) {
node.color = '#e2b600';
this.nodeData.nodes.update(node);
......
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