JsPlumb change endpoint position
1 answer
One way to set the anchor position of the endpoint is to use the default jsPlumb values:
jsPlumb.importDefaults({
PaintStyle : {lineWidth:1,strokeStyle:color2},
Connector: ["Straight"],
Anchor:"Continuous" // dymamically nearest position will be considered for endpoint
//OR
Anchor:["Top","Bottom"] // only top or bottom center whichever is near will be considered as endpoints
//OR
Anchor:["Left","Right"] // similarly left or right center will be considered
});
You can also declare at connection time as:
jsPlumb.connect({
source:someDiv,
target:someOtherDiv,
anchors:["Bottom", "Continuous"] // Bottom nearest point will be considered
});
For makeTarget and makeSource, declare it as:
jsPlumb.makeSource(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});
Or, when adding an endpoint, declare as:
jsPlumb.addEndpoint(someDiv, {
anchor:"Continuous",
paintStyle:{ fillStyle:"red" }
});
+4
source to share