diff --git a/frontend/src/components/GraphPanel.vue b/frontend/src/components/GraphPanel.vue index 539ebff..767f8d1 100644 --- a/frontend/src/components/GraphPanel.vue +++ b/frontend/src/components/GraphPanel.vue @@ -440,6 +440,9 @@ const renderGraph = () => { .force('charge', d3.forceManyBody().strength(-400)) .force('center', d3.forceCenter(width / 2, height / 2)) .force('collide', d3.forceCollide(50)) + // 添加向中心的引力,让独立的节点群聚集到中心区域 + .force('x', d3.forceX(width / 2).strength(0.04)) + .force('y', d3.forceY(height / 2).strength(0.04)) currentSimulation = simulation