From 56e81e56ad181129c9f36b75e5ca076162b7cac7 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 27 Sep 2021 13:45:45 +0200 Subject: chore: cleanup some dependencies --- pages/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'pages') diff --git a/pages/index.tsx b/pages/index.tsx index fa15758..5b3c35d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -766,7 +766,10 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) { ...links.flatMap((link) => [link.source, link.target]), ].map((nodeId) => [nodeId, {}]), ) - }, [centralHighlightedNode.current, filteredLinksByNodeIdRef.current]) + }, [ + JSON.stringify(centralHighlightedNode.current), + JSON.stringify(filteredLinksByNodeIdRef.current), + ]) useEffect(() => { ;(async () => { @@ -854,9 +857,6 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) { ) }, [emacsTheme]) - // FIXME: Somehow the "linksByNodeId" call causes parent nodes to be always highlighted - // Replacing this with "linksByNodeIdRef.current" should solve this, but instead leads to no - // highlighting whatsoever. const previouslyHighlightedNodes = useMemo(() => { const previouslyHighlightedLinks = filteredLinksByNodeIdRef.current[lastHoverNode.current?.id!] ?? [] @@ -1268,9 +1268,7 @@ function hexToRGBA(hex: string, opacity: number) { 'rgba(' + (hex = hex.replace('#', '')) .match(new RegExp('(.{' + hex.length / 3 + '})', 'g'))! - .map(function (l) { - return parseInt(hex.length % 2 ? l + l : l, 16) - }) + .map((l) => parseInt(hex.length % 2 ? l + l : l, 16)) .concat(isFinite(opacity) ? opacity : 1) .join(',') + ')' -- cgit v1.2.3