From c3c43b0b84695462e3cc1d6ae288dfea80af53ad Mon Sep 17 00:00:00 2001 From: "qumeng039@126.com" <86925389+qumen@users.noreply.github.com> Date: Fri, 8 Aug 2025 09:47:19 +0800 Subject: [PATCH] 1 --- .../GroupEvolution/component/groupGraph.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/GroupEvolution/component/groupGraph.vue b/src/views/GroupEvolution/component/groupGraph.vue index 65fb13a..239d6bd 100644 --- a/src/views/GroupEvolution/component/groupGraph.vue +++ b/src/views/GroupEvolution/component/groupGraph.vue @@ -6,7 +6,7 @@ { } const runForceLayout = (layoutConfig, layoutType, isAsync) => { //执行异步布局计算 + graphVis.excuteWorkerLayout( graphVis.getGraphData(), layoutType, layoutConfig, isAsync, function () { - isPlay.value = true - graphVis.zoomFit() //布局结束缩放居中 + // isPlay.value = true + graphVis.zoomFit() //场景视图大小自适应缩放 } ) + graphVis.hideIsolatedNodes() //隐藏孤立节点 } // 根据节点的cluster属性进行分组 const clusterAnalyze = () => { @@ -171,6 +173,7 @@ const clusterAnalyze = () => { group.smoothPath = false //拟合平滑曲线(耗性能) }) graphVis.autoGroupLayout(graphVis.nodes) + // graphVis.selectedEdge(graphVis.links[0]) } const createGraph = () => { @@ -203,7 +206,6 @@ const updateChart = (newGraphData) => { } graphVis.clearAll() graphVis.addGraph({ ...toRaw(newGraphData) }) - graphVis.zoomFit() // 重新运行力导向布局 clusterAnalyze() runForceLayout({ strength: -500, ajustCluster: true }, "simulation", true)