forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (39 loc) · 1.22 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
require('./-preamble');
var window = require( './window' );
var is = require( './is' );
var Core = require( './core' );
var extension = require( './extension' );
var registerJquery = require( './jquery-plugin' );
var Stylesheet = require( './stylesheet' );
var Thread = require( './thread' );
var Fabric = require( './fabric' );
var cytoscape = function( options ){ // jshint ignore:line
// if no options specified, use default
if( options === undefined ){
options = {};
}
// create instance
if( is.plainObject( options ) ){
return new Core( options );
}
// allow for registration of extensions
else if( is.string( options ) ){
return extension.apply( extension, arguments );
}
};
// replaced by build system
cytoscape.version = require('./version.json');
// try to register w/ jquery
if( window && window.jQuery ){
registerJquery( window.jQuery, cytoscape );
}
// expose register api
cytoscape.registerJquery = function( jQuery ){
registerJquery( jQuery, cytoscape );
};
// expose public apis (mostly for extensions)
cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet;
cytoscape.thread = cytoscape.Thread = Thread;
cytoscape.fabric = cytoscape.Fabric = Fabric;
module.exports = cytoscape;