summaryrefslogtreecommitdiff
path: root/pages/index.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-09-27 13:45:45 +0200
committerThomas F. K. Jorna <[email protected]>2021-09-27 13:45:45 +0200
commit56e81e56ad181129c9f36b75e5ca076162b7cac7 (patch)
tree91755fc69118132a0a6d77f38fe2d7509b29c6a3 /pages/index.tsx
parentec6f3e51bb7f33594c7d0151fc3bf1f09db4115a (diff)
chore: cleanup some dependencies
Diffstat (limited to 'pages/index.tsx')
-rw-r--r--pages/index.tsx12
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(',') +
')'