diff --git a/dist/vis.js b/dist/vis.js index cb85c454..a8095a0e 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -5,7 +5,7 @@ * A dynamic, browser-based visualization library. * * @version 0.6.0-SNAPSHOT - * @date 2014-02-25 + * @date 2014-02-26 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com @@ -14920,16 +14920,19 @@ var SelectionMixin = { var node = this._getNodeAt(pointer); if (node != null) { this._selectObject(node,false); + this.emit("clickNode", this.getSelection()); } else { var edge = this._getEdgeAt(pointer); if (edge != null) { this._selectObject(edge,false); + this.emit("clickEdge", this.getSelection()); } else { this._unselectAll(); } } + this.emit("click", this.getSelection()); this._redraw(); }, @@ -14942,12 +14945,20 @@ var SelectionMixin = { */ _handleDoubleTap : function(pointer) { var node = this._getNodeAt(pointer); + var selection = this.getSelection(); if (node != null && node !== undefined) { // we reset the areaCenter here so the opening of the node will occur this.areaCenter = {"x" : this._canvasToX(pointer.x), "y" : this._canvasToY(pointer.y)}; this.openCluster(node); + this.emit("doubleClickNode", selection); } + else { + if (this._getSelectedEdgeCount() == 1) { + this.emit("doubleClickEdge", selection); + } + } + this.emit("doubleClick", selection); }, diff --git a/docs/graph.html b/docs/graph.html index bf2594e5..e8d4e4ba 100644 --- a/docs/graph.html +++ b/docs/graph.html @@ -1857,9 +1857,80 @@ graph.off('select', onSelect);
nodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgesnodes
: an array with the ids of the selected nodesedges
: an array with the ids of the selected edgeswidth
: the new width of the canvasheight
: the new height of the canvas