Skip to content

Commit c95eab8

Browse files
benelogclaude
andcommitted
연결 그래프를 둥근 원형 레이아웃으로 개선
forceRadial, forceX/Y를 추가하고 charge/link distance를 조정하여 Obsidian 그래프 뷰와 유사한 원형 배치가 되도록 변경 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 326d36a commit c95eab8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

obsidian-site-action/layouts/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ <h2>Pages <span class="page-count">({page_count})</span></h2>
5959
const nodeRadius = d => 3 + (d.count / maxCount) * 10;
6060
const nodeColor = d3.scaleSequential(d3.interpolateBlues).domain([0, maxCount]);
6161

62+
const size = Math.min(width, height);
63+
6264
const simulation = d3.forceSimulation(data.nodes)
63-
.force('link', d3.forceLink(data.links).id(d => d.id).distance(60))
64-
.force('charge', d3.forceManyBody().strength(-80))
65-
.force('center', d3.forceCenter(width / 2, height / 2))
65+
.force('link', d3.forceLink(data.links).id(d => d.id).distance(40))
66+
.force('charge', d3.forceManyBody().strength(-40))
67+
.force('x', d3.forceX(width / 2).strength(0.1))
68+
.force('y', d3.forceY(height / 2).strength(0.1))
69+
.force('radial', d3.forceRadial(size * 0.3, width / 2, height / 2).strength(0.15))
6670
.force('collision', d3.forceCollide().radius(d => nodeRadius(d) + 2));
6771

6872
const link = g.append('g')

0 commit comments

Comments
 (0)