Question

How can I recreate/redraw a connection in jsplumb that has two different image endpoints?

For example:

  instance.connect({source:"source", target:"target", anchors:["Bottom", "Top"], 
endpoint:[ "Image" , {url:"nameofpicture.jpg"} ], connector: "Flowchart"});

this works for one image(the image is the same on the source and target element)

instance.connect({source:"source", target:"target", anchors:["Bottom", "Top"], 
endpoints:["Dot","Rectangle"], connector: "Flowchart"});

this works and connects two elements with different endpoints (not of the same scope)

instance.connect({source:"source", target:"target", anchors:["Bottom", "Top"],
 endpoints:["Image",{url:"nameofpicture1.jpg"},"Image", {url:"nameofpicture2.jpg"}], connector: "Flowchart"});

so the conclusion would be that something like this would work, but it doesn't..

Is there a way to access the source's and target's Image endpoint (parameter) url? Maybe something like this: connectionname.endpoints[0].endpoint.type('url')??

Was it helpful?

Solution

Try it like this:

endpoints: [ ['Image', {src:'nameofpicture1.png'}], ['Image', {src:'nameofpicture2.png'}] ]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top