Firstly, there are two nodes in the canvas, and some endpoint styles has been applied. If I drag a connection between them, all styles can be kept. That's OK. But when using jsPlumb connection method, it will import default endpoint style rather than the given styles. How can I avoid this?
1) new connection generated by user drag event from source to target.
2) using jsplumb.connect(), while the method using default endpoint styles.
some javascript code is here:
var connectorPaintStyle = {
strokeWidth: 2,
stroke: "#61B7CF",
joinstyle: "round",
outlineStroke: "white",
outlineWidth: 2
};
var conn = jsptoolkit.jspinstance.connect({
source: line.sdata.sourceId,
target: line.sdata.targetId,
anchors: line.sdata.anchors,
paintStyle: connectorPaintStyle,
connector: ["Flowchart", { stub: [2, 2], gap: 1, cornerRadius: 5, alwaysRespectStubs: true }],
});
The correct way is to use uuids array rather than source and target. I have modified the connect method code:
There is a similar question: Jsplumb add connection programatically using endpoints