jsplumb with Angular 2/4/5

347 views
Skip to first unread message

Manu Sharma

unread,
Mar 17, 2018, 10:37:38 PM3/17/18
to jsPlumb
Hi,

I am trying to use jsPlumb for my applicaiton written in Angular 4. Is there any example or documentation for jsPlumb with angular 2+ that i can go through and get an idea features that i can use with jsPlumb ? The official website has some documentation but its with toolkit edition and not commnity edition . Kinldy help me.

Thanks
Manu

Saurabh Bhardwaj

unread,
May 25, 2018, 6:37:32 AM5/25/18
to jsPlumb
Install JS Plumb from NPM.
Import the min file in your cli file.
Declare a global variable in your component declare var jsPlumb: any;
ngInit to intialize the plumb instance and your ready to go. as shown below

 jsPlumb.ready(function() {
      currentContext.plumbConfig.PlumbInstance = jsPlumb.getInstance({
        Connector: [
          "Flowchart",
          { gap: 1, cornerRadius: 3, alwaysRespectStubs: false }
        ],
        DragOptions: { cursor: "move", zIndex: 2000 },
        PaintStyle: { strokeStyle: color, strokeWidth: 4, lineWidth: 3 },
        EndpointStyle: { radius: 1, fillStyle: "transparent" },
        Container: "botGraph"
      });      
    });

Thanks
Saurabh
Reply all
Reply to author
Forward
0 new messages