How to use the jsplumb.bind function in jsplumb

To help you get started, we’ve selected a few jsplumb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GraphWalker / graphwalker-project / graphwalker-studio / src / main / webapp / scripts / tags / js / Studio.js View on Github external
});
                jsp.registerConnectionType('verified', {
                    paintStyle: {strokeStyle: '#325262', lineWidth: 1, dashstyle: "0 0"}
                });
                jsp.registerConnectionType('error', {
                    paintStyle: {strokeStyle: '#ffc880', lineWidth: 1, dashstyle: "0 0"}
                });

                jsp.setContainer('canvas-body');

                jsp.bind('beforeDrop', function (params) {
                    self.addEdge(params.sourceId, params.targetId);
                    return false;
                });

                jsp.bind('click', function (connection, evt) {
                    var edge = connection.getParameter('_edgeObject');
                    self.opts.selection.update(edge, evt.metaKey);
                });
            });
github GraphWalker / graphwalker-project / graphwalker-studio / src / main / webapp / scripts / tags / js / Studio.js View on Github external
]
                });

                jsp.registerConnectionType('selected', {
                    paintStyle: {strokeStyle: '#3db2e3', lineWidth: 2}
                });
                jsp.registerConnectionType('verified', {
                    paintStyle: {strokeStyle: '#325262', lineWidth: 1, dashstyle: "0 0"}
                });
                jsp.registerConnectionType('error', {
                    paintStyle: {strokeStyle: '#ffc880', lineWidth: 1, dashstyle: "0 0"}
                });

                jsp.setContainer('canvas-body');

                jsp.bind('beforeDrop', function (params) {
                    self.addEdge(params.sourceId, params.targetId);
                    return false;
                });

                jsp.bind('click', function (connection, evt) {
                    var edge = connection.getParameter('_edgeObject');
                    self.opts.selection.update(edge, evt.metaKey);
                });
            });