chore(graph): increase linkDistance

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2024-08-16 17:18:56 -04:00
parent 84f7d31672
commit 847354cf18
No known key found for this signature in database
GPG Key ID: 18974753009D2BFA
2 changed files with 4 additions and 7 deletions

View File

@ -45,9 +45,9 @@ const defaultOptions: GraphOptions = {
zoom: true, zoom: true,
depth: -1, depth: -1,
scale: 1, scale: 1,
repelForce: 0.5, repelForce: 1.5,
centerForce: 0.1, centerForce: 0.3,
linkDistance: 30, linkDistance: 90,
fontSize: 12, fontSize: 12,
opacityScale: 1, opacityScale: 1,
showTags: true, showTags: true,

View File

@ -158,10 +158,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
.id((d: any) => d.id) .id((d: any) => d.id)
.distance(linkDistance), .distance(linkDistance),
) )
.force( .force("collide", d3.forceCollide<NodeData>((n) => nodeRadius(n)).iterations(3))
"collide",
d3.forceCollide((n) => nodeRadius(n)),
)
const width = graph.offsetWidth const width = graph.offsetWidth
const height = Math.max(graph.offsetHeight, 250) const height = Math.max(graph.offsetHeight, 250)