diff --git a/lib/forcegraph.js b/lib/forcegraph.js index 30843cc..43592de 100644 --- a/lib/forcegraph.js +++ b/lib/forcegraph.js @@ -200,13 +200,12 @@ define(['d3-selection', 'd3-force', 'd3-zoom', 'd3-drag', 'utils/math', 'forcegr }; self.gotoNode = function gotoNode(d) { - draw.setHighlight({ type: 'node', o: d }); - for (var i = 0; i < intNodes.length; i++) { var n = intNodes[i]; - if (n.o.node !== d) { + if (n.o.node.nodeinfo.node_id !== d.nodeinfo.node_id) { continue; } + draw.setHighlight({ type: 'node', o: n.o.node }); transform.k = (ZOOM_MAX + 1) / 2; moveTo(n.x, n.y); break;