|
|
@ -58,19 +58,11 @@ function Network(container, data, options) { |
|
|
|
|
|
|
|
// containers for nodes and edges
|
|
|
|
this.body = { |
|
|
|
container: container, |
|
|
|
nodes: {}, |
|
|
|
nodeIndices: [], |
|
|
|
edges: {}, |
|
|
|
edgeIndices: [], |
|
|
|
data: { |
|
|
|
nodes: null, // A DataSet or DataView
|
|
|
|
edges: null // A DataSet or DataView
|
|
|
|
}, |
|
|
|
functions: { |
|
|
|
createNode: function() {}, |
|
|
|
createEdge: function() {}, |
|
|
|
getPointer: function() {} |
|
|
|
}, |
|
|
|
emitter: { |
|
|
|
on: this.on.bind(this), |
|
|
|
off: this.off.bind(this), |
|
|
@ -91,7 +83,15 @@ function Network(container, data, options) { |
|
|
|
onRelease: function() {}, |
|
|
|
onContext: function() {} |
|
|
|
}, |
|
|
|
container: container, |
|
|
|
data: { |
|
|
|
nodes: null, // A DataSet or DataView
|
|
|
|
edges: null // A DataSet or DataView
|
|
|
|
}, |
|
|
|
functions: { |
|
|
|
createNode: function() {}, |
|
|
|
createEdge: function() {}, |
|
|
|
getPointer: function() {} |
|
|
|
}, |
|
|
|
view: { |
|
|
|
scale: 1, |
|
|
|
translation: {x: 0, y: 0} |
|
|
@ -362,14 +362,6 @@ Network.prototype.destroy = function () { |
|
|
|
delete this.configurator; |
|
|
|
delete this.images; |
|
|
|
|
|
|
|
// delete emitter bindings
|
|
|
|
delete this.body.emitter.emit; |
|
|
|
delete this.body.emitter.on; |
|
|
|
delete this.body.emitter.off; |
|
|
|
delete this.body.emitter.once; |
|
|
|
delete this.body.emitter; |
|
|
|
|
|
|
|
|
|
|
|
for (var nodeId in this.body.nodes) { |
|
|
|
delete this.body.nodes[nodeId]; |
|
|
|
} |
|
|
|