From 1c00b6c649f67904fdc3fd2687a81c98b7726902 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sun, 18 Jul 2021 02:03:35 +0200 Subject: labels only when hovering in 3d --- app/components/graph/graph.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/components/graph') diff --git a/app/components/graph/graph.tsx b/app/components/graph/graph.tsx index 7db642e..5925e42 100644 --- a/app/components/graph/graph.tsx +++ b/app/components/graph/graph.tsx @@ -309,13 +309,16 @@ onLinkHover={handleLinkHover} nodeThreeObject={ !physics.labels ? undefined : ((node) => { + if (highlightNodes.has(node)) { console.log(node.title) const sprite = new SpriteText(node.title.substring(0, 30)); console.log("didnt crash here 2") sprite.color = "#ffffff"; sprite.textHeight = 8; return sprite; - })} + } else { return undefined }; + }) + } nodeThreeObjectExtend={true} /> )} -- cgit v1.2.3