|
|
@ -5,7 +5,7 @@ |
|
|
|
* A dynamic, browser-based visualization library. |
|
|
|
* |
|
|
|
* @version 1.0.2-SNAPSHOT |
|
|
|
* @date 2014-05-23 |
|
|
|
* @date 2014-05-27 |
|
|
|
* |
|
|
|
* @license |
|
|
|
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
|
|
|
@ -15735,7 +15735,9 @@ function Graph (container, data, options) { |
|
|
|
border: '#666', |
|
|
|
background: '#FFFFC6' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
moveable: true, |
|
|
|
zoomable: true |
|
|
|
}; |
|
|
|
this.editMode = this.constants.dataManipulation.initiallyVisible; |
|
|
|
|
|
|
@ -16075,7 +16077,8 @@ Graph.prototype.setOptions = function (options) { |
|
|
|
if (options.freezeForStabilization !== undefined) {this.constants.freezeForStabilization = options.freezeForStabilization;} |
|
|
|
if (options.configurePhysics !== undefined){this.constants.configurePhysics = options.configurePhysics;} |
|
|
|
if (options.stabilizationIterations !== undefined) {this.constants.stabilizationIterations = options.stabilizationIterations;} |
|
|
|
|
|
|
|
if (options.moveable !== undefined) {this.constants.moveable = options.moveable;} |
|
|
|
if (options.zoomable !== undefined) {this.constants.zoomable = options.zoomable;} |
|
|
|
|
|
|
|
|
|
|
|
if (options.labels !== undefined) { |
|
|
@ -16524,16 +16527,18 @@ Graph.prototype._handleOnDrag = function(event) { |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
// move the graph
|
|
|
|
var diffX = pointer.x - this.drag.pointer.x; |
|
|
|
var diffY = pointer.y - this.drag.pointer.y; |
|
|
|
|
|
|
|
this._setTranslation( |
|
|
|
this.drag.translation.x + diffX, |
|
|
|
this.drag.translation.y + diffY); |
|
|
|
this._redraw(); |
|
|
|
this.moving = true; |
|
|
|
this.start(); |
|
|
|
if (this.constants.moveable == true) { |
|
|
|
// move the graph
|
|
|
|
var diffX = pointer.x - this.drag.pointer.x; |
|
|
|
var diffY = pointer.y - this.drag.pointer.y; |
|
|
|
|
|
|
|
this._setTranslation( |
|
|
|
this.drag.translation.x + diffX, |
|
|
|
this.drag.translation.y + diffY); |
|
|
|
this._redraw(); |
|
|
|
this.moving = true; |
|
|
|
this.start(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
@ -16621,37 +16626,38 @@ Graph.prototype._onPinch = function (event) { |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Graph.prototype._zoom = function(scale, pointer) { |
|
|
|
var scaleOld = this._getScale(); |
|
|
|
if (scale < 0.00001) { |
|
|
|
scale = 0.00001; |
|
|
|
} |
|
|
|
if (scale > 10) { |
|
|
|
scale = 10; |
|
|
|
} |
|
|
|
// + this.frame.canvas.clientHeight / 2
|
|
|
|
var translation = this._getTranslation(); |
|
|
|
|
|
|
|
var scaleFrac = scale / scaleOld; |
|
|
|
var tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac; |
|
|
|
var ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac; |
|
|
|
if (this.constants.zoomable == true) { |
|
|
|
var scaleOld = this._getScale(); |
|
|
|
if (scale < 0.00001) { |
|
|
|
scale = 0.00001; |
|
|
|
} |
|
|
|
if (scale > 10) { |
|
|
|
scale = 10; |
|
|
|
} |
|
|
|
// + this.frame.canvas.clientHeight / 2
|
|
|
|
var translation = this._getTranslation(); |
|
|
|
|
|
|
|
this.areaCenter = {"x" : this._canvasToX(pointer.x), |
|
|
|
"y" : this._canvasToY(pointer.y)}; |
|
|
|
var scaleFrac = scale / scaleOld; |
|
|
|
var tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac; |
|
|
|
var ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac; |
|
|
|
|
|
|
|
this._setScale(scale); |
|
|
|
this._setTranslation(tx, ty); |
|
|
|
this.updateClustersDefault(); |
|
|
|
this._redraw(); |
|
|
|
this.areaCenter = {"x" : this._canvasToX(pointer.x), |
|
|
|
"y" : this._canvasToY(pointer.y)}; |
|
|
|
|
|
|
|
if (scaleOld < scale) { |
|
|
|
this.emit("zoom", {direction:"+"}); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.emit("zoom", {direction:"-"}); |
|
|
|
} |
|
|
|
this._setScale(scale); |
|
|
|
this._setTranslation(tx, ty); |
|
|
|
this.updateClustersDefault(); |
|
|
|
this._redraw(); |
|
|
|
|
|
|
|
if (scaleOld < scale) { |
|
|
|
this.emit("zoom", {direction:"+"}); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.emit("zoom", {direction:"-"}); |
|
|
|
} |
|
|
|
|
|
|
|
return scale; |
|
|
|
return scale; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -17745,6 +17751,7 @@ Graph.prototype.storePosition = function() { |
|
|
|
*/ |
|
|
|
var vis = { |
|
|
|
util: util, |
|
|
|
moment: moment, |
|
|
|
|
|
|
|
DataSet: DataSet, |
|
|
|
DataView: DataView, |
|
|
|