diff --git a/src/views/GroupEvolution/component/groupGraph.vue b/src/views/GroupEvolution/component/groupGraph.vue index da35adb..e6b868e 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 = () => { @@ -173,6 +175,7 @@ const clusterAnalyze = () => { group.smoothPath = false //拟合平滑曲线(耗性能) }) graphVis.autoGroupLayout(graphVis.nodes) + // graphVis.selectedEdge(graphVis.links[0]) } const createGraph = () => { @@ -205,7 +208,6 @@ const updateChart = (newGraphData) => { } graphVis.clearAll() graphVis.addGraph({ ...toRaw(newGraphData) }) - graphVis.zoomFit() // 重新运行力导向布局 clusterAnalyze() runForceLayout({ strength: -500, ajustCluster: true }, "simulation", true)