Commit 50437e69 authored by Maximilian Lapie's avatar Maximilian Lapie

Merge branch 'maximilian/newGraph' into 'master'

when hovering over a cytonode, non-connected edges are now also transparent

See merge request !10
parents 2f82beb0 9722e69a
......@@ -92,8 +92,12 @@ export class Graph2D {
highlightNode = (e) => {
this.selectedNodeId = parseInt(e.target._private.data.id);
this.selectedNodeColor = e.target._private.data.color;
let selectedNode = this.cy.getElementById(this.selectedNodeId);
this.cy.getElementById(this.selectedNodeId).style("backgroundColor", "yellow");
this.hoverTimeout = setTimeout(() => this.graph2d.notNeighbors([this.selectedNodeId]).map(id => this.cy.getElementById(id).style("opacity", "0.2")), 2000);
this.hoverTimeout = setTimeout(() => {
this.cy.elements().map(element => element.style("opacity", "0.2"));
selectedNode.closedNeighborhood().map(element => element.style("opacity", "1"));
}, 2000);
const associatedSearchRows = [...document.getElementsByTagName("tr")].filter(row => {
if ("data-id" in row.attributes) {
return parseInt(row.attributes["data-id"].value) === this.selectedNodeId;
......@@ -116,7 +120,7 @@ export class Graph2D {
let highlightedNode = this.cy.getElementById(this.selectedNodeId);
highlightedNode.style("backgroundColor", this.selectedNodeColor);
clearTimeout(this.hoverTimeout);
this.cy.nodes().map(node => node.style("opacity", "1"));
this.cy.elements().map(element => element.style("opacity", "1"));
const associatedSearchRows = [...document.getElementsByTagName("tr")].filter(row => {
if ("data-id" in row.attributes) {
return parseInt(row.attributes["data-id"].value) === this.selectedNodeId;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment