我一直在尝试通过jsplumb.connect()进行编程连接,到目前为止,我已经能够通过维护源和锚信息来连接元素。
然而,端点在分离时断开连接,而不是允许我绘制另一个连接而不从位置分离。
我正在使用的jsplumb.connect代码:
connection = plumb.connect({
source:parsed_conn_list[j].source,
target:parsed_conn_list[j].target,
anchors:parsed_conn_list[j].anchors,
reattach:true,
paintStyle:{lineWidth: 4, strokeStyle: '#000'},
connector: ["Bezier", { curviness: 70 }],
deleteEndpointsOnDetach:false,
overlays:[
[ "Arrow", { width:14, length:14, location:0.93, id:"arrow" } ]
]
});
任何帮助都会非常感激。
编辑:
大家好,这是我用来添加端点的当前工作代码,而不仅仅是添加源/目标ID:
final_source = plumb.getEndpoints(parsed_conn_list[j].source)[0]
final_target = plumb.getEndpoints(parsed_conn_list[j].target)[0]
connection = plumb.connect({
source:final_source,
target:final_target,
//anchors:parsed_conn_list[j].anchors,
reattach:true,
paintStyle:{lineWidth: 4, strokeStyle: '#000'},
connector: ["Bezier", { curviness: 70 }],
deleteEndpointsOnDetach:false,
overlays:[
[ "Arrow", { width:14, length:14, location:0.93, id:"arrow" } ]
]
});
答案 0 :(得分:1)
我喜欢这样做的方式是: