UNPKG

cytoscape-d3-force

Version:
15 lines (10 loc) 425 B
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;