diff --git a/html/admin/js/graphViewer/graph/communityNode.js b/html/admin/js/graphViewer/graph/communityNode.js index 667da7b0a1..5aef80e89a 100644 --- a/html/admin/js/graphViewer/graph/communityNode.js +++ b/html/admin/js/graphViewer/graph/communityNode.js @@ -64,14 +64,14 @@ function CommunityNode(parent, initial) { getDistance = function(def) { if (self._expanded) { - return 2 * def; + return 2 * def * Math.sqrt(nodeArray.length); } return def; }, getCharge = function(def) { if (self._expanded) { - return 8 * def; + return 4 * def * Math.sqrt(nodeArray.length); } return def; }, diff --git a/html/admin/js/graphViewer/graph/forceLayouter.js b/html/admin/js/graphViewer/graph/forceLayouter.js index 25fcbbdccc..12438ea411 100644 --- a/html/admin/js/graphViewer/graph/forceLayouter.js +++ b/html/admin/js/graphViewer/graph/forceLayouter.js @@ -52,17 +52,22 @@ function ForceLayouter(config) { gravity = config.gravity || 0.01, // 0.08 charge = config.charge || -1000, // -240 */ - defaultCharge = config.charge || -600, - defaultDistance = config.distance || 160, + defaultCharge = config.charge || -600, + defaultDistance = config.distance || 80, gravity = config.gravity || 0.08, distance = function(d) { + var res = 0; if (d.source._isCommunity) { - return d.source.getDistance(defaultDistance); + res += d.source.getDistance(defaultDistance); + } else { + res += defaultDistance; } if (d.target._isCommunity) { - return d.target.getDistance(defaultDistance); + res += d.target.getDistance(defaultDistance); + } else { + res += defaultDistance; } - return defaultDistance; + return res; }, charge = function(d) { if (d._isCommunity) {