From 8fcba8d775eb3169bbede911c268e5e469645115 Mon Sep 17 00:00:00 2001 From: William Jeynes Date: Fri, 24 Apr 2026 17:14:06 +0100 Subject: [PATCH] Cleanup tooltips --- graphviz/frontend/src/App2.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/graphviz/frontend/src/App2.tsx b/graphviz/frontend/src/App2.tsx index bb2bca5..2119a57 100644 --- a/graphviz/frontend/src/App2.tsx +++ b/graphviz/frontend/src/App2.tsx @@ -239,9 +239,10 @@ export function App2() { highlightedNodeIds.has(sourceId) && highlightedNodeIds.has(targetId); - return bothHighlighted ? "orange" : "white"; + return bothHighlighted ? "orange" : "rgba(0,0,0,0)"; }} linkWidth={2.5} + onNodeClick={(node) => setSelectedNode(node)} nodeCanvasObject={(node, ctx) => { const label = node.label; @@ -290,8 +291,17 @@ export function App2() { node.__bckgPos = { x, y }; }} nodePointerAreaPaint={(node, color, ctx) => { + let isHighlighted = false; + + if (parsedInputDate && node.avgDate) { + const diffMonths = monthsDiff(parsedInputDate, node.avgDate); + isHighlighted = diffMonths <= 6; + } + if (!isHighlighted) return; + const dims = node.__bckgDimensions; const pos = node.__bckgPos; + if (!dims || !pos) return; ctx.fillStyle = color;