From 0bc0760f89812d9f09579b6a8d221f03fa3d6897 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 8 Jun 2012 02:31:22 +0200 Subject: [PATCH] links: freeze nodes on hover --- html/force.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/html/force.js b/html/force.js index db217dd..9d0c5e4 100644 --- a/html/force.js +++ b/html/force.js @@ -300,6 +300,14 @@ function update() { var linkEnter = link.enter().append("g") .attr("class", "link") + .on("mouseover", function(d) { + d.source.fixed |= 2 + d.target.fixed |= 2 + }) + .on("mouseout", function(d) { + d.source.fixed &= 1 + d.target.fixed &= 1 + }) linkEnter.append("line")