From fcd3a49506908aff4e8552650ee6249ddf42a1ca Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Fri, 23 Jul 2021 18:00:31 +0200 Subject: sexier scrollbar --- pages/index.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'pages') diff --git a/pages/index.tsx b/pages/index.tsx index 89c0553..0e1c413 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -97,6 +97,7 @@ const initialPhysics = { highlight: true, highlightNodeSize: 2, highlightLinkSize: 2, + orphans: false, } export default function Home() { @@ -326,7 +327,21 @@ export const Tweaks = function (props: TweakProps) { - + ( + + )} + > @@ -490,7 +505,7 @@ export const Tweaks = function (props: TweakProps) { setPhysics({ ...physics, particleWidth: value })} + onChange={(value) => setPhysics({ ...physics, particlesWidth: value })} /> { const links = linksByNodeId[node.id as string] ?? [] + if (physics.orphans && links.length === 0) { + return false + } return ( scope.nodeIds.includes(node.id as string) || links.some((link) => { -- cgit v1.2.3