summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-24 16:11:38 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-24 16:11:38 +0200
commitf5830d08ef46c0715cb765b113fa86917452ffd4 (patch)
tree8ac14dd4a168f614a19b2d6568a425f2b71d5f25
parentbbd3b007497925bbc8b3f6fa5f7fc0d948d7540f (diff)
got rid of nodehover timeout
-rw-r--r--pages/index.tsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index 5bcbe94..23a8f5c 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -803,13 +803,13 @@ export const Graph = function (props: GraphProps) {
const [opacity, setOpacity] = useState<number>(1)
const [fadeIn, cancel] = useAnimation((x) => setOpacity(x), {
duration: physics.animationSpeed,
- algorithm: physics.algorithms[physics.algorithmName],
+ algorithm: physics.algorithms[physics.algorithmName] ?? Easing.Cubic.InOut,
})
const [fadeOut, fadeOutCancel] = useAnimation(
(x) => setOpacity(Math.min(opacity, -1 * (x - 1))),
{
duration: physics.animationSpeed,
- algorithm: physics.algorithms[physics.algorithmName],
+ algorithm: physics.algorithms[physics.algorithmName] ?? Easing.Cubic.InOut,
},
)
@@ -1000,10 +1000,7 @@ export const Graph = function (props: GraphProps) {
if (!physics.hover) {
return
}
- const timer = setTimeout(() => {
- setHoverNode(node)
- }, 30)
- return () => clearTimeout(timer)
+ setHoverNode(node)
},
}