From 21398a35c89ea448b3a1c3fdf064af70ad03b1cc Mon Sep 17 00:00:00 2001 From: David Mosbach Date: Thu, 25 May 2023 14:52:41 +0200 Subject: [PATCH] increased max length for self loop names --- editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor.js b/editor.js index 3beeb7d..ea2d4e7 100644 --- a/editor.js +++ b/editor.js @@ -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';