|
@ -24,7 +24,7 @@ import InteractionHandler from './modules/InteractionHandler'; |
|
|
import SelectionHandler from "./modules/SelectionHandler"; |
|
|
import SelectionHandler from "./modules/SelectionHandler"; |
|
|
import LayoutEngine from "./modules/LayoutEngine"; |
|
|
import LayoutEngine from "./modules/LayoutEngine"; |
|
|
import ManipulationSystem from "./modules/ManipulationSystem"; |
|
|
import ManipulationSystem from "./modules/ManipulationSystem"; |
|
|
import ConfigurationSystem from "./../shared/ConfigurationSystem"; |
|
|
|
|
|
|
|
|
import Configurator from "./../shared/Configurator"; |
|
|
import Validator from "./../shared/Validator"; |
|
|
import Validator from "./../shared/Validator"; |
|
|
import {printStyle} from "./../shared/Validator"; |
|
|
import {printStyle} from "./../shared/Validator"; |
|
|
import {allOptions, configureOptions} from './options.js'; |
|
|
import {allOptions, configureOptions} from './options.js'; |
|
@ -123,7 +123,7 @@ function Network(container, data, options) { |
|
|
this.canvas._create(); |
|
|
this.canvas._create(); |
|
|
|
|
|
|
|
|
// setup configuration system
|
|
|
// setup configuration system
|
|
|
this.configurationSystem = new ConfigurationSystem(this, this.body.container, configureOptions, this.canvas.pixelRatio); |
|
|
|
|
|
|
|
|
this.configurator = new Configurator(this, this.body.container, configureOptions, this.canvas.pixelRatio); |
|
|
|
|
|
|
|
|
// apply options
|
|
|
// apply options
|
|
|
this.setOptions(options); |
|
|
this.setOptions(options); |
|
@ -173,10 +173,10 @@ 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.configurationSystem.setOptions(options.configure); |
|
|
|
|
|
|
|
|
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.configurationSystem.options.enabled === true) { |
|
|
|
|
|
|
|
|
if (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); |
|
@ -193,7 +193,7 @@ Network.prototype.setOptions = function (options) { |
|
|
util.deepExtend(networkOptions.global, this.canvas.options); |
|
|
util.deepExtend(networkOptions.global, this.canvas.options); |
|
|
util.deepExtend(networkOptions.global, this.options); |
|
|
util.deepExtend(networkOptions.global, this.options); |
|
|
|
|
|
|
|
|
this.configurationSystem.setModuleOptions(networkOptions); |
|
|
|
|
|
|
|
|
this.configurator.setModuleOptions(networkOptions); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// handle network global options
|
|
|
// handle network global options
|
|
@ -355,7 +355,7 @@ Network.prototype.destroy = function () { |
|
|
delete this.manipulation; |
|
|
delete this.manipulation; |
|
|
delete this.nodesHandler; |
|
|
delete this.nodesHandler; |
|
|
delete this.edgesHandler; |
|
|
delete this.edgesHandler; |
|
|
delete this.configurationSystem; |
|
|
|
|
|
|
|
|
delete this.configurator; |
|
|
delete this.images; |
|
|
delete this.images; |
|
|
|
|
|
|
|
|
// delete emitter bindings
|
|
|
// delete emitter bindings
|
|
|