From e690a109519e8395d82137166d3eb6e48fb8551e Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 15 Jul 2025 16:36:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B5=81=E7=A8=8B=E5=9B=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9B=B8=E5=90=8C=E4=B8=A4=E4=B8=AA=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E9=97=B4=E5=A4=9A=E6=9D=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scDegra.vue | 5 +++-- src/views/template/degraD3.vue | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/scDegra.vue b/src/components/scDegra.vue index a1a538e4..fb7def1d 100644 --- a/src/components/scDegra.vue +++ b/src/components/scDegra.vue @@ -60,7 +60,7 @@ export default { if(that.g!==null){ that.updateGraph(); }else{ - that.g = new dagreD3.graphlib.Graph().setGraph({ + that.g = new dagreD3.graphlib.Graph({multigraph: true}).setGraph({ rankdir: that.rankdir, nodesep: 40, edgesep: 25, //两条线之间的距离 @@ -89,8 +89,9 @@ export default { that.edges.forEach((transition0) => { that.g.setEdge(transition0.source,transition0.target,{ label: transition0.label,// 边标签 + id: transition0.id, style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px", // 根据后台数据来改变连线的颜色 - }); + },transition0.id); }); // 创建渲染器 let render = new dagreD3.render(); diff --git a/src/views/template/degraD3.vue b/src/views/template/degraD3.vue index 8c245af7..b613ac6d 100644 --- a/src/views/template/degraD3.vue +++ b/src/views/template/degraD3.vue @@ -60,7 +60,7 @@ export default { if(that.g!==null){ that.updataGraph(); }else{ - that.g = new dagreD3.graphlib.Graph().setGraph({ + that.g = new dagreD3.graphlib.Graph({multigraph: true,}).setGraph({ rankdir: that.rankdir, nodesep: 40, edgesep: 25, //两条线之间的距离 @@ -89,8 +89,9 @@ export default { that.edges.forEach((transition0) => { that.g.setEdge(transition0.source,transition0.target,{ label: transition0.label,// 边标签 + id: transition0.id, style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px", // 根据后台数据来改变连线的颜色 - }); + }, transition0.id); }); // 创建渲染器 let render = new dagreD3.render();