fix:流程图支持相同两个节点间多条线
This commit is contained in:
parent
80c8cfdd85
commit
e690a10951
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue