From 00e7294f4174608680c5784c2a65a04289a51dcc Mon Sep 17 00:00:00 2001 From: Tobias Hopp Date: Wed, 16 Apr 2025 13:25:47 +0200 Subject: [PATCH] Set name to firstname and first letter of lastname and increase node size Took 3 hours 34 minutes --- frontend/src/components/CanvasGraph.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/CanvasGraph.tsx b/frontend/src/components/CanvasGraph.tsx index 499f80e..2581c87 100644 --- a/frontend/src/components/CanvasGraph.tsx +++ b/frontend/src/components/CanvasGraph.tsx @@ -35,9 +35,9 @@ interface CanvasGraphProps { } // Physics constants -const NODE_RADIUS = 30; // Node radius in pixels -const MIN_DISTANCE = 100; // Minimum distance between any two nodes -const MAX_DISTANCE = 300; // Maximum distance between connected nodes +const NODE_RADIUS = 45; // Node radius in pixels +const MIN_DISTANCE = 110; // Minimum distance between any two nodes +const MAX_DISTANCE = 500; // Maximum distance between connected nodes const REPULSION_STRENGTH = 500; // How strongly nodes repel each other when too close const ATTRACTION_STRENGTH = 0.1; // Default attraction between connected nodes const CONSTRAINT_STRENGTH = 0.2; // Strength of distance constraints @@ -573,9 +573,9 @@ const CanvasGraph: React.FC = ({ data, width, height, zoomLeve ctx.stroke(); // Draw initials - const initials = `${node.firstName.charAt(0)}${node.lastName.charAt(0)}`; + const initials = `${node.firstName} ${node.lastName.charAt(0)}.`; ctx.fillStyle = 'white'; - ctx.font = 'bold 16px sans-serif'; + ctx.font = 'bold 13px sans-serif'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(initials, pos.x, pos.y);