|
@ -193,7 +193,7 @@ function Network (container, data, options) { |
|
|
background: '#FFFFC6' |
|
|
background: '#FFFFC6' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
dragGraph: true, |
|
|
|
|
|
|
|
|
dragNetwork: true, |
|
|
dragNodes: true, |
|
|
dragNodes: true, |
|
|
zoomable: true, |
|
|
zoomable: true, |
|
|
hover: false |
|
|
hover: false |
|
@ -536,11 +536,16 @@ Network.prototype.setOptions = function (options) { |
|
|
if (options.freezeForStabilization !== undefined) {this.constants.freezeForStabilization = options.freezeForStabilization;} |
|
|
if (options.freezeForStabilization !== undefined) {this.constants.freezeForStabilization = options.freezeForStabilization;} |
|
|
if (options.configurePhysics !== undefined){this.constants.configurePhysics = options.configurePhysics;} |
|
|
if (options.configurePhysics !== undefined){this.constants.configurePhysics = options.configurePhysics;} |
|
|
if (options.stabilizationIterations !== undefined) {this.constants.stabilizationIterations = options.stabilizationIterations;} |
|
|
if (options.stabilizationIterations !== undefined) {this.constants.stabilizationIterations = options.stabilizationIterations;} |
|
|
if (options.dragGraph !== undefined) {this.constants.dragGraph = options.dragGraph;} |
|
|
|
|
|
|
|
|
if (options.dragNetwork !== undefined) {this.constants.dragNetwork = options.dragNetwork;} |
|
|
if (options.dragNodes !== undefined) {this.constants.dragNodes = options.dragNodes;} |
|
|
if (options.dragNodes !== undefined) {this.constants.dragNodes = options.dragNodes;} |
|
|
if (options.zoomable !== undefined) {this.constants.zoomable = options.zoomable;} |
|
|
if (options.zoomable !== undefined) {this.constants.zoomable = options.zoomable;} |
|
|
if (options.hover !== undefined) {this.constants.hover = options.hover;} |
|
|
if (options.hover !== undefined) {this.constants.hover = options.hover;} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: deprecated since version 3.0.0. Cleanup some day
|
|
|
|
|
|
if (options.dragGraph !== undefined) { |
|
|
|
|
|
throw new Error('Option dragGraph is renamed to dragNetwork'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (options.labels !== undefined) { |
|
|
if (options.labels !== undefined) { |
|
|
for (prop in options.labels) { |
|
|
for (prop in options.labels) { |
|
|
if (options.labels.hasOwnProperty(prop)) { |
|
|
if (options.labels.hasOwnProperty(prop)) { |
|
@ -994,7 +999,7 @@ Network.prototype._handleOnDrag = function(event) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
if (this.constants.dragGraph == true) { |
|
|
|
|
|
|
|
|
if (this.constants.dragNetwork == true) { |
|
|
// move the network
|
|
|
// move the network
|
|
|
var diffX = pointer.x - this.drag.pointer.x; |
|
|
var diffX = pointer.x - this.drag.pointer.x; |
|
|
var diffY = pointer.y - this.drag.pointer.y; |
|
|
var diffY = pointer.y - this.drag.pointer.y; |
|
|