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