JSplumb double bonds
Asked Answered
H

1

8

I would like make a double bonds with two div using librairy jsPlumb Javascript. I can make a connection, but not a double bonds.

Do you know how to make a double bond ?

For a simple link between two DIV:

jsPlumb.ready(function() {
   jsPlumb.importDefaults({
       ConnectorZIndex:5
   });
   var jsP = jsPlumb.getInstance({
       PaintStyle:{ lineWidth:2, strokeStyle:"#000", outlineColor:"black", outlineWidth:1 },
       Connector: "Straight",
       Endpoint: "Blank"
   });
   var e0 = jsP.addEndpoint("firstLink", {
           anchor: ["Center"]
   });
   var e1 = jsP.addEndpoint("lastLink", {
           anchor: ["Center"]
   });
   jsP.connect({ source:e0, target:e1});

For a double link in two DIV, I test this, but it doesn't work:

       var e0 = jsP.addEndpoint("firstLink", {
           anchor: ["Center"]
       });
      var e1 = jsP.addEndpoint("lastLink", {
           anchor: ["Center"]

       });
      var e2 = jsP.addEndpoint("firstLink", {
           anchor: ["Center"]
       });
      var e3 = jsP.addEndpoint("lastLink", {
           anchor: ["Left"]

       });
      jsP.connect({ source:e0, target:e1});
      jsP.connect({ source:e2, target:e3});

Somebody have a solution ?

Hoy answered 19/12, 2012 at 8:0 Comment(0)
D
1

"Left" is not a valid anchor location in jsPlumb. Try "LeftMiddle", "TopLeft" or "BottomLeft". "LeftMiddle" is probably the one you're looking for.

Druce answered 19/12, 2012 at 8:56 Comment(1)
This is almost what I want. The spacing between the link is to bigger. Can I determinate a spacing. For example, 5px between two connection ?Hoy

© 2022 - 2024 — McMap. All rights reserved.