From f5830d08ef46c0715cb765b113fa86917452ffd4 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 24 Jul 2021 16:11:38 +0200 Subject: got rid of nodehover timeout --- pages/index.tsx | 9 +++------ 1 file 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(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) }, } -- cgit v1.2.3