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