From 85ab218bc2beb6e0630585676b9a94b9c8887e99 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Fri, 8 Jan 2021 11:58:57 +0100 Subject: [PATCH] Update node.ts --- src/app/cartography/widgets/node.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/cartography/widgets/node.ts b/src/app/cartography/widgets/node.ts index de604d4b..27d798d4 100644 --- a/src/app/cartography/widgets/node.ts +++ b/src/app/cartography/widgets/node.ts @@ -103,8 +103,12 @@ export class NodeWidget implements Widget { if (n.height > 64) return 64; return n.height; }) - .attr('x', (n: MapNode) => 0) - .attr('y', (n: MapNode) => 0) + .attr('x', (n: MapNode) => { + return 0 + }) + .attr('y', (n: MapNode) => { + return 0 + }) .on('mouseover', function(this, n: MapNode) { select(this).attr('class', 'over'); }) @@ -113,6 +117,7 @@ export class NodeWidget implements Widget { }); node_body_merge.attr('transform', (n: MapNode) => { + if (!n.width) return `translate(${n.x - 30},${n.y - 30})` return `translate(${n.x},${n.y})`; });