example of extending Connection object in jsPlumb -


could provide example of extending/subclassing connection object? bit of information found in docs was:

getdefaultconnectiontype

returns default connection type. used when wants subclass connection , have jsplumb return instances of subclass. make call in class’s constructor:

jsplumb.getdefaultconnectiontype().apply(this, arguments);

returns

the default connection function used jsplumb.

this sounds little vague me. ideally i'd able use subclass this:

jsplumb.addendpoint(element, {     connector: ["myconnector", { curviness: 65 }] } 

thanks!

ok apparently don't understand difference between connection , connector, anyways, extending connection works fine this:

var myconnection = function (params) {     params.label = "bingo!";     jsplumb.getdefaultconnectiontype().apply(this, arguments); };   jsplumb.defaults.connectiontype = myconnection; 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -