[BUGFIX] Highlighting in forcegraph

This commit is contained in:
Geno 2017-10-31 10:19:22 +01:00 committed by Xaver Maierhofer
parent 519f37cd14
commit a0378348b5
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8

View File

@ -32,7 +32,7 @@ define(['helper'], function (helper) {
} }
function drawHighlightNode(d) { 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.arc(d.x, d.y, NODE_RADIUS * 1.5, 0, 2 * Math.PI);
ctx.fillStyle = highlightColor; ctx.fillStyle = highlightColor;
ctx.fill(); ctx.fill();
@ -41,7 +41,7 @@ define(['helper'], function (helper) {
} }
function drawHighlightLink(d, to) { 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.lineTo(to[0], to[1]);
ctx.strokeStyle = highlightColor; ctx.strokeStyle = highlightColor;
ctx.lineWidth = LINE_RADIUS * 2; ctx.lineWidth = LINE_RADIUS * 2;