From f9aac2c130dbec61c9466ae4b932aa9b4158d309 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Wed, 28 Jul 2021 17:57:04 +0200
Subject: added some more tweaks

---
 pages/index.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index db925da..e330b91 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -360,11 +360,16 @@ export const Graph = function (props: GraphProps) {
         fg.d3Force('y', null)
         threeDim ? fg.d3Force('z', null) : null
       }
-
+      physics.centering
+        ? fg.d3Force('center', d3.forceCenter().strength(physics.centeringStrength))
+        : fg.d3Force('center', null)
       physics.linkStrength && fg.d3Force('link').strength(physics.linkStrength)
       physics.linkIts && fg.d3Force('link').iterations(physics.linkIts)
       physics.charge && fg.d3Force('charge').strength(physics.charge)
-      fg.d3Force('collide', physics.collision ? d3.forceCollide().radius(20) : null)
+      fg.d3Force(
+        'collide',
+        physics.collision ? d3.forceCollide().radius(physics.collisionStrength) : null,
+      )
     })()
   })
 
@@ -585,7 +590,7 @@ export const Graph = function (props: GraphProps) {
       }))
     },
     onNodeHover: (node) => {
-      if (!physics.hover) {
+      if (!physics.highlight) {
         return
       }
       setHoverNode(node)
-- 
cgit v1.2.3