|
|
@ -410,8 +410,8 @@ Network.prototype._getRange = function() { |
|
|
|
node = this.nodes[nodeId]; |
|
|
|
if (minX > (node.boundingBox.left)) {minX = node.boundingBox.left;} |
|
|
|
if (maxX < (node.boundingBox.right)) {maxX = node.boundingBox.right;} |
|
|
|
if (minY > (node.boundingBox.bottom)) {minY = node.boundingBox.bottom;} |
|
|
|
if (maxY < (node.boundingBox.top)) {maxY = node.boundingBox.top;} |
|
|
|
if (minY > (node.boundingBox.bottom)) {minY = node.boundingBox.top;} // top is negative, bottom is positive
|
|
|
|
if (maxY < (node.boundingBox.top)) {maxY = node.boundingBox.bottom;} // top is negative, bottom is positive
|
|
|
|
} |
|
|
|
} |
|
|
|
if (minX == 1e9 && maxX == -1e9 && minY == 1e9 && maxY == -1e9) { |
|
|
@ -441,15 +441,9 @@ Network.prototype._findCenter = function(range) { |
|
|
|
Network.prototype.zoomExtent = function(animationOptions, initialZoom, disableStart) { |
|
|
|
this._redraw(true); |
|
|
|
|
|
|
|
if (initialZoom === undefined) { |
|
|
|
initialZoom = false; |
|
|
|
} |
|
|
|
if (disableStart === undefined) { |
|
|
|
disableStart = false; |
|
|
|
} |
|
|
|
if (animationOptions === undefined) { |
|
|
|
animationOptions = false; |
|
|
|
} |
|
|
|
if (initialZoom === undefined) {initialZoom = false;} |
|
|
|
if (disableStart === undefined) {disableStart = false;} |
|
|
|
if (animationOptions === undefined) {animationOptions = false;} |
|
|
|
|
|
|
|
var range = this._getRange(); |
|
|
|
var zoomLevel; |
|
|
@ -485,7 +479,6 @@ Network.prototype.zoomExtent = function(animationOptions, initialZoom, disableSt |
|
|
|
|
|
|
|
var xZoomLevel = this.frame.canvas.clientWidth / xDistance; |
|
|
|
var yZoomLevel = this.frame.canvas.clientHeight / yDistance; |
|
|
|
|
|
|
|
zoomLevel = (xZoomLevel <= yZoomLevel) ? xZoomLevel : yZoomLevel; |
|
|
|
} |
|
|
|
|
|
|
|