Skip to content

Commit

Permalink
feat(Vis View): ✨ Force Directed Graph: Transition to hovering node f…
Browse files Browse the repository at this point in the history
…ade-out
  • Loading branch information
SkepticMystic committed Aug 15, 2021
1 parent 5d437c0 commit f4bb083
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/Visualisations/ForceDirectedG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,20 @@ export const forceDirectedG = (

node
.on("mouseover", (event: MouseEvent, d: { index: number }) => {
node.style("opacity", (o) => {
return linked(d.index, o.index) ? 1 : 0.1;
});
link.style("opacity", function (o) {
return o.source.index === d.index || o.target.index === d.index
? 1
: 0.1;
});
node
.transition()
.duration(150)
.style("opacity", (o) => {
return linked(d.index, o.index) ? 1 : 0.2;
});
link
.transition()
.duration(150)
.style("opacity", function (o) {
return o.source.index === d.index || o.target.index === d.index
? 1
: 0.2;
});

// Highlight path from hovered node to currNode
const hoveredNode = nameFromIndex(d);
Expand Down

0 comments on commit f4bb083

Please sign in to comment.