|
@ -122,9 +122,6 @@ function Network(container, data, options) { |
|
|
// create the DOM elements
|
|
|
// create the DOM elements
|
|
|
this.canvas._create(); |
|
|
this.canvas._create(); |
|
|
|
|
|
|
|
|
// setup configuration system
|
|
|
|
|
|
this.configurator = new Configurator(this, this.body.container, configureOptions, this.canvas.pixelRatio); |
|
|
|
|
|
|
|
|
|
|
|
// apply options
|
|
|
// apply options
|
|
|
this.setOptions(options); |
|
|
this.setOptions(options); |
|
|
|
|
|
|
|
@ -177,15 +174,21 @@ Network.prototype.setOptions = function (options) { |
|
|
//this.view.setOptions(options.view);
|
|
|
//this.view.setOptions(options.view);
|
|
|
//this.clustering.setOptions(options.clustering);
|
|
|
//this.clustering.setOptions(options.clustering);
|
|
|
|
|
|
|
|
|
this.configurator.setOptions(options.configure); |
|
|
|
|
|
|
|
|
if ('configure' in options) { |
|
|
|
|
|
if (!this.configurator) { |
|
|
|
|
|
this.configurator = new Configurator(this, this.body.container, configureOptions, this.canvas.pixelRatio); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.configurator.setOptions(options.configure); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// if the configuration system is enabled, copy all options and put them into the config system
|
|
|
// if the configuration system is enabled, copy all options and put them into the config system
|
|
|
if (this.configurator.options.enabled === true) { |
|
|
|
|
|
|
|
|
if (this.configurator && this.configurator.options.enabled === true) { |
|
|
let networkOptions = {nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}}; |
|
|
let networkOptions = {nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}}; |
|
|
util.deepExtend(networkOptions.nodes, this.nodesHandler.options); |
|
|
util.deepExtend(networkOptions.nodes, this.nodesHandler.options); |
|
|
util.deepExtend(networkOptions.edges, this.edgesHandler.options); |
|
|
util.deepExtend(networkOptions.edges, this.edgesHandler.options); |
|
|
util.deepExtend(networkOptions.layout, this.layoutEngine.options); |
|
|
util.deepExtend(networkOptions.layout, this.layoutEngine.options); |
|
|
// load the selectionHandler and rendere default options in to the interaction group
|
|
|
|
|
|
|
|
|
// load the selectionHandler and render default options in to the interaction group
|
|
|
util.deepExtend(networkOptions.interaction, this.selectionHandler.options); |
|
|
util.deepExtend(networkOptions.interaction, this.selectionHandler.options); |
|
|
util.deepExtend(networkOptions.interaction, this.renderer.options); |
|
|
util.deepExtend(networkOptions.interaction, this.renderer.options); |
|
|
|
|
|
|
|
|