From 847354cf18a4f67bb6d682e1fe80ff25544a60b8 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Fri, 16 Aug 2024 17:18:56 -0400 Subject: [PATCH] chore(graph): increase linkDistance Signed-off-by: Aaron Pham --- quartz/components/Graph.tsx | 6 +++--- quartz/components/scripts/graph.inline.ts | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/quartz/components/Graph.tsx b/quartz/components/Graph.tsx index 0df3e3d22..ff0574a81 100644 --- a/quartz/components/Graph.tsx +++ b/quartz/components/Graph.tsx @@ -45,9 +45,9 @@ const defaultOptions: GraphOptions = { zoom: true, depth: -1, scale: 1, - repelForce: 0.5, - centerForce: 0.1, - linkDistance: 30, + repelForce: 1.5, + centerForce: 0.3, + linkDistance: 90, fontSize: 12, opacityScale: 1, showTags: true, diff --git a/quartz/components/scripts/graph.inline.ts b/quartz/components/scripts/graph.inline.ts index 3be18f946..5d49af8dc 100644 --- a/quartz/components/scripts/graph.inline.ts +++ b/quartz/components/scripts/graph.inline.ts @@ -158,10 +158,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) { .id((d: any) => d.id) .distance(linkDistance), ) - .force( - "collide", - d3.forceCollide((n) => nodeRadius(n)), - ) + .force("collide", d3.forceCollide((n) => nodeRadius(n)).iterations(3)) const width = graph.offsetWidth const height = Math.max(graph.offsetHeight, 250)