diff --git a/dist/vis.js b/dist/vis.js index e48df784..cb85c454 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version @@version - * @date @@date + * @version 0.6.0-SNAPSHOT + * @date 2014-02-25 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com @@ -10644,7 +10644,7 @@ Edge.prototype._drawLine = function(ctx) { ctx.lineWidth = this._getLineWidth(); var point; - if (this.from != this.to+9) { + if (this.from != this.to) { // draw line this._line(ctx); diff --git a/docs/graph.html b/docs/graph.html index 407977cb..bf2594e5 100644 --- a/docs/graph.html +++ b/docs/graph.html @@ -55,7 +55,7 @@
  • Edges
  • Groups
  • Physics
  • -
  • Data_manipulation
  • +
  • Data manipulation
  • Clustering
  • Navigation controls
  • Keyboard navigation
  • @@ -298,7 +298,8 @@ var nodes = [ true If allowedToMove is false, then the node will not move from its supplied position. If only an x position has been supplied, it is only fixed in the x-direction. - The same holds for y. If both x and y have been defined, the node will not move. + The same holds for y. If both x and y have been defined, the node will not move. + If no x or y have been supplied, this argument will not do anything. fontColor @@ -850,7 +851,8 @@ var options = { false If allowedToMove is false, then the node will not move from its supplied position. If only an x position has been supplied, it is only fixed in the x-direction. - The same holds for y. If both x and y have been defined, the node will not move. + The same holds for y. If both x and y have been defined, the node will not move. + If no x or y have been supplied, this argument will not do anything. diff --git a/examples/graph/21_data_manipulation.html b/examples/graph/21_data_manipulation.html index 4a2a9adb..59c019ae 100644 --- a/examples/graph/21_data_manipulation.html +++ b/examples/graph/21_data_manipulation.html @@ -146,6 +146,17 @@ saveButton.onclick = saveData.bind(this,data,callback); cancelButton.onclick = clearPopUp.bind(); div.style.display = 'block'; + }, + onConnect: function(data,callback) { + if (data.from == data.to) { + var r=confirm("Do you want to connect the node to itself?"); + if (r==true) { + callback(data); + } + } + else { + callback(data); + } } }; graph = new vis.Graph(container, data, options); diff --git a/src/graph/Edge.js b/src/graph/Edge.js index 0f9a3268..221c2778 100644 --- a/src/graph/Edge.js +++ b/src/graph/Edge.js @@ -231,7 +231,7 @@ Edge.prototype._drawLine = function(ctx) { ctx.lineWidth = this._getLineWidth(); var point; - if (this.from != this.to+9) { + if (this.from != this.to) { // draw line this._line(ctx);