diff --git a/html/admin/js/graphViewer/graph/communityNode.js b/html/admin/js/graphViewer/graph/communityNode.js index 5aef80e89a..2b6166667b 100644 --- a/html/admin/js/graphViewer/graph/communityNode.js +++ b/html/admin/js/graphViewer/graph/communityNode.js @@ -406,14 +406,28 @@ function CommunityNode(parent, initial) { }, addDistortion = function(distFunc) { - _.each(nodeArray, function(n) { - //n.position = distFunc(n); - n.position = { - x: n.x, - y: n.y, - z: 1 - }; - }); + if (self._expanded) { + var oldFocus = distFunc.focus(); + var newFocus = [ + oldFocus[0] - self.position.x, + oldFocus[1] - self.position.y + ]; + distFunc.focus(newFocus); + _.each(nodeArray, function(n) { + n.position = distFunc(n); + n.position.x /= self.position.z; + n.position.y /= self.position.z; + n.position.z /= self.position.z; + /* + n.position = { + x: n.x, + y: n.y, + z: 1 + }; + */ + }); + distFunc.focus(oldFocus); + } }, shapeAll = function(g, shapeFunc, shapeQue, start, colourMapper) {