[BUGFIX] select node from nodelist in forcegrap

This commit is contained in:
Martin Geno 2017-03-24 11:40:11 +01:00 committed by Xaver Maierhofer
parent 4b2c5e9157
commit 94627fc611

View File

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