summaryrefslogtreecommitdiff
path: root/pages/index.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-28 17:57:04 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-28 17:57:04 +0200
commitf9aac2c130dbec61c9466ae4b932aa9b4158d309 (patch)
tree8ea38cca9d5e966955194b650274d3b61416a219 /pages/index.tsx
parent173963d752bc8ea9c18d4165c0bcf88097c69cbe (diff)
added some more tweaks
Diffstat (limited to 'pages/index.tsx')
-rw-r--r--pages/index.tsx11
1 files changed, 8 insertions, 3 deletions
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)