increased max length for self loop names

This commit is contained in:
David Mosbach 2023-05-25 14:52:41 +02:00
parent 47dbbd56aa
commit 21398a35c8

View File

@ -411,7 +411,7 @@ const Graph = ForceGraph()
}
const maxTextLength = (source !== target) ? Math.sqrt(Math.pow(edgeVector.x, 2) + Math.pow(edgeVector.y, 2)) - LABEL_NODE_MARGIN
: 1.5 * Math.sqrt(4 * source.val);
: 1.5 * Math.sqrt(4 * source.val + 100 * curvature);
var textAngle = Math.atan2(edgeVector.y, edgeVector.x);
// maintain label vertical orientation for legibility
@ -460,6 +460,8 @@ const Graph = ForceGraph()
ctx.arc(node.x, node.y, 2*node.val, 0, 2 * Math.PI, false);
ctx.fill();
if (! (node.stateData && node.stateData.abbreviation)) return;
ctx.fillStyle = 'white';
ctx.font = '4px Sans-Serif';
ctx.textAlign = 'center';