diff --git a/lib/forcegraph/draw.js b/lib/forcegraph/draw.js index fa18a83..6976297 100644 --- a/lib/forcegraph/draw.js +++ b/lib/forcegraph/draw.js @@ -32,7 +32,7 @@ define(['helper'], function (helper) { } function drawHighlightNode(d) { - if (highlight && highlight.type === 'node' && d.o === highlight.o) { + if (highlight && highlight.type === 'node' && d.o.node_id === highlight.o.node_id) { ctx.arc(d.x, d.y, NODE_RADIUS * 1.5, 0, 2 * Math.PI); ctx.fillStyle = highlightColor; ctx.fill(); @@ -41,7 +41,7 @@ define(['helper'], function (helper) { } function drawHighlightLink(d, to) { - if (highlight && highlight.type === 'link' && d.o === highlight.o) { + if (highlight && highlight.type === 'link' && d.o.id === highlight.o.id) { ctx.lineTo(to[0], to[1]); ctx.strokeStyle = highlightColor; ctx.lineWidth = LINE_RADIUS * 2;