vendor/assets/vis/graph/graphMixins/MixinLoader.js in vis-rails-0.0.6 vs vendor/assets/vis/graph/graphMixins/MixinLoader.js in vis-rails-1.0.0
- old
+ new
@@ -9,11 +9,11 @@
* Load a mixin into the graph object
*
* @param {Object} sourceVariable | this object has to contain functions.
* @private
*/
- _loadMixin : function(sourceVariable) {
+ _loadMixin: function (sourceVariable) {
for (var mixinFunction in sourceVariable) {
if (sourceVariable.hasOwnProperty(mixinFunction)) {
Graph.prototype[mixinFunction] = sourceVariable[mixinFunction];
}
}
@@ -24,11 +24,11 @@
* removes a mixin from the graph object.
*
* @param {Object} sourceVariable | this object has to contain functions.
* @private
*/
- _clearMixin : function(sourceVariable) {
+ _clearMixin: function (sourceVariable) {
for (var mixinFunction in sourceVariable) {
if (sourceVariable.hasOwnProperty(mixinFunction)) {
Graph.prototype[mixinFunction] = undefined;
}
}
@@ -38,27 +38,25 @@
/**
* Mixin the physics system and initialize the parameters required.
*
* @private
*/
- _loadPhysicsSystem : function() {
+ _loadPhysicsSystem: function () {
this._loadMixin(physicsMixin);
this._loadSelectedForceSolver();
if (this.constants.configurePhysics == true) {
this._loadPhysicsConfiguration();
}
- },
+ },
-
-
/**
* Mixin the cluster system and initialize the parameters required.
*
* @private
*/
- _loadClusterSystem : function() {
+ _loadClusterSystem: function () {
this.clusterSession = 0;
this.hubThreshold = 5;
this._loadMixin(ClusterMixin);
},
@@ -66,53 +64,53 @@
/**
* Mixin the sector system and initialize the parameters required
*
* @private
*/
- _loadSectorSystem : function() {
- this.sectors = { },
+ _loadSectorSystem: function () {
+ this.sectors = {};
this.activeSector = ["default"];
- this.sectors["active"] = { },
- this.sectors["active"]["default"] = {"nodes":{},
- "edges":{},
- "nodeIndices":[],
- "formationScale": 1.0,
- "drawingNode": undefined };
- this.sectors["frozen"] = {},
- this.sectors["support"] = {"nodes":{},
- "edges":{},
- "nodeIndices":[],
- "formationScale": 1.0,
- "drawingNode": undefined };
+ this.sectors["active"] = {};
+ this.sectors["active"]["default"] = {"nodes": {},
+ "edges": {},
+ "nodeIndices": [],
+ "formationScale": 1.0,
+ "drawingNode": undefined };
+ this.sectors["frozen"] = {};
+ this.sectors["support"] = {"nodes": {},
+ "edges": {},
+ "nodeIndices": [],
+ "formationScale": 1.0,
+ "drawingNode": undefined };
this.nodeIndices = this.sectors["active"]["default"]["nodeIndices"]; // the node indices list is used to speed up the computation of the repulsion fields
this._loadMixin(SectorMixin);
- },
+ },
/**
* Mixin the selection system and initialize the parameters required
*
* @private
*/
- _loadSelectionSystem : function() {
- this.selectionObj = { };
+ _loadSelectionSystem: function () {
+ this.selectionObj = {nodes: {}, edges: {}};
this._loadMixin(SelectionMixin);
- },
+ },
/**
* Mixin the navigationUI (User Interface) system and initialize the parameters required
*
* @private
*/
- _loadManipulationSystem : function() {
+ _loadManipulationSystem: function () {
// reset global variables -- these are used by the selection of nodes and edges.
this.blockConnectingEdgeSelection = false;
- this.forceAppendSelection = false
+ this.forceAppendSelection = false;
if (this.constants.dataManipulation.enabled == true) {
// load the manipulator HTML elements. All styling done in css.
if (this.manipulationDiv === undefined) {
this.manipulationDiv = document.createElement('div');
@@ -168,34 +166,34 @@
this.closeDiv = undefined;
// remove the mixin functions
this._clearMixin(manipulationMixin);
}
}
- },
+ },
/**
* Mixin the navigation (User Interface) system and initialize the parameters required
*
* @private
*/
- _loadNavigationControls : function() {
+ _loadNavigationControls: function () {
this._loadMixin(NavigationMixin);
// the clean function removes the button divs, this is done to remove the bindings.
this._cleanNavigation();
if (this.constants.navigation.enabled == true) {
this._loadNavigationElements();
}
- },
+ },
/**
* Mixin the hierarchical layout system.
*
* @private
*/
- _loadHierarchySystem : function() {
+ _loadHierarchySystem: function () {
this._loadMixin(HierarchicalLayoutMixin);
}
-}
+};