diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-09-27 13:45:45 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-09-27 13:45:45 +0200 |
commit | 56e81e56ad181129c9f36b75e5ca076162b7cac7 (patch) | |
tree | 91755fc69118132a0a6d77f38fe2d7509b29c6a3 /pages | |
parent | ec6f3e51bb7f33594c7d0151fc3bf1f09db4115a (diff) |
chore: cleanup some dependencies
Diffstat (limited to 'pages')
-rw-r--r-- | pages/index.tsx | 12 |
1 files changed, 5 insertions, 7 deletions
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(',') + ')' |