cytoscape-cola
Version:
The Cola.js physics simulation layout for Cytoscape.js
15 lines (10 loc) • 417 B
JavaScript
const impl = require('./cola');
// registers the extension on a cytoscape lib ref
let register = function( cytoscape ){
if( !cytoscape ){ return; } // can't register if cytoscape unspecified
cytoscape( 'layout', 'cola', impl ); // register with cytoscape.js
};
if( typeof cytoscape !== 'undefined' ){ // expose to global cytoscape (i.e. window.cytoscape)
register( cytoscape );
}
module.exports = register;