Update node.ts

This commit is contained in:
piotrpekala7 2020-06-05 02:32:53 +02:00
parent b8ded15ef7
commit 672d25132f

View File

@ -87,12 +87,14 @@ export class NodeWidget implements Widget {
}) })
.attr('xnode:href', (n: MapNode) => n.symbolUrl) .attr('xnode:href', (n: MapNode) => n.symbolUrl)
.attr('width', (n: MapNode) => { .attr('width', (n: MapNode) => {
if (!n.width) return 60 if (!n.width) return 60;
return n.width if (n.width > 200) return 200;
return n.width;
}) })
.attr('height', (n: MapNode) => { .attr('height', (n: MapNode) => {
if (!n.height) return 60 if (!n.height) return 60;
return n.height if (n.height > 200) return 200;
return n.height;
}) })
.attr('x', (n: MapNode) => 0) .attr('x', (n: MapNode) => 0)
.attr('y', (n: MapNode) => 0) .attr('y', (n: MapNode) => 0)