Browse Source

- fixed minor bugs

flowchartTest
Alex de Mulder 9 years ago
parent
commit
a1d4b27ef3
4 changed files with 31749 additions and 31766 deletions
  1. +31737
    -31745
      dist/vis.js
  2. +10
    -18
      lib/network/Network.js
  3. +1
    -2
      lib/network/modules/NodesHandler.js
  4. +1
    -1
      test/network_unittests.html

+ 31737
- 31745
dist/vis.js
File diff suppressed because it is too large
View File


+ 10
- 18
lib/network/Network.js View File

@ -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];
} }

+ 1
- 2
lib/network/modules/NodesHandler.js View File

@ -247,11 +247,10 @@ class NodesHandler {
else { else {
dataChanged = true; dataChanged = true;
// create node // create node
node = this.create(properties);
node = this.create(data);
nodes[id] = node; nodes[id] = node;
} }
} }
if (dataChanged === true) { if (dataChanged === true) {
this.body.emitter.emit("_dataChanged"); this.body.emitter.emit("_dataChanged");
} }

+ 1
- 1
test/network_unittests.html View File

@ -117,7 +117,7 @@
{name:"deleteSelected", arguments: null, funcFirst:drawQuick}, {name:"deleteSelected", arguments: null, funcFirst:drawQuick},
{name:"disableEditMode", arguments: null}, {name:"disableEditMode", arguments: null},
{name:"getPositions", arguments: [[1]]}, {name:"getPositions", arguments: [[1]]},
{name:"storePositions", arguments: null},
{name:"storePositions", arguments: null, funcFirst:drawQuick},
{name:"getBoundingBox", arguments: [1]}, {name:"getBoundingBox", arguments: [1]},
{name:"getConnectedNodes", arguments: [1]}, {name:"getConnectedNodes", arguments: [1]},
{name:"getConnectedEdges", arguments: [1]}, {name:"getConnectedEdges", arguments: [1]},

Loading…
Cancel
Save