chartDemo.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. ;(function() {
  2. window.jsPlumbDemo = {
  3. init : function() {
  4. var fillColor = "gray";
  5. // notice the 'curviness' argument to this Bezier curve. the curves on this page are far smoother
  6. // than the curves on the first demo, which use the default curviness value.
  7. jsPlumb.Defaults.Connector = [ "Bezier", { curviness:50 } ];
  8. jsPlumb.Defaults.DragOptions = { cursor: "pointer", zIndex:2000 };
  9. jsPlumb.Defaults.PaintStyle = { strokeStyle:"gray", lineWidth:2 };
  10. jsPlumb.Defaults.EndpointStyle = { radius:9, fillStyle:"gray" };
  11. jsPlumb.Defaults.Anchors = [ "BottomCenter", "TopCenter" ];
  12. // declare some common values:
  13. var arrowCommon = { foldback:0.7, fillStyle:fillColor, width:14 };
  14. // use three-arg spec to create two different arrows with the common values:
  15. var overlays = [
  16. [ "Arrow", { location:0.7 }, arrowCommon ],
  17. [ "Arrow", { location:0.3, direction:-1 }, arrowCommon ]
  18. ];
  19. jsPlumb.connect({source:"window3", target:"window6", overlays:overlays});
  20. jsPlumb.connect({source:"window1", target:"window2", overlays:overlays});
  21. jsPlumb.connect({source:"window1", target:"window3", overlays:overlays});
  22. jsPlumb.connect({source:"window2", target:"window4", overlays:overlays});
  23. jsPlumb.connect({source:"window2", target:"window5", overlays:overlays});
  24. }
  25. };
  26. })();