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';