summaryrefslogtreecommitdiff
path: root/src/client/view/layouts.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-04-01 23:59:57 +0300
committerAlon Levy <alon@pobox.com>2015-04-02 00:35:01 +0300
commit1606347e24d57882cc987e0dd31f59fc659fd596 (patch)
tree6ca91bf46046f44953c00b7cfc5557959b6535b8 /src/client/view/layouts.js
parent598f7a1a05bfc8195f35527e7ad94f387ac6f6a8 (diff)
client/layouts/concentric: consts refactor, enlarge minimal ring distance
Diffstat (limited to 'src/client/view/layouts.js')
-rw-r--r--src/client/view/layouts.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/view/layouts.js b/src/client/view/layouts.js
index ffbe1db9..ca018ee7 100644
--- a/src/client/view/layouts.js
+++ b/src/client/view/layouts.js
@@ -1,5 +1,5 @@
-define(['jquery', 'd3', 'underscore', 'rz_core'],
-function($, d3, _, rz_core) {
+define(['consts', 'jquery', 'd3', 'underscore', 'rz_core'],
+function(consts, $, d3, _, rz_core) {
function layout__d3_force(graph) {
return d3.layout.force()
.distance(240)
@@ -97,6 +97,9 @@ function($, d3, _, rz_core) {
}
function layout__concentric() {
+ var single_width = consts.concentric_top_width,
+ ring_distance_minimum = consts.concentric_ring_distance_minimum;
+
var cx = $(document.body).innerWidth() / 2,
cy = $(document.body).innerHeight() / 2,
pi = Math.PI,
@@ -123,7 +126,7 @@ function($, d3, _, rz_core) {
node,
cos = Math.cos,
sin = Math.sin,
- ring_radius = Math.max(50, (Math.min.apply(null, this.wh) - 50) / (types.length + 1));
+ ring_radius = Math.max(ring_distance_minimum, (Math.min.apply(null, this.wh) - 50) / (types.length + 1));
function setxy(node, angle) {
node.x = node.px = cx + r * cos(angle);
@@ -140,8 +143,7 @@ function($, d3, _, rz_core) {
setxy(node, small_number_angles[nodes.length][i]);
});
} else {
- var single_width = 200,
- small_angle = Math.min(pi / 2, single_width / r),
+ var small_angle = Math.min(pi / 2, single_width / r),
small_angle_half = small_angle / 2,
large_count = Math.floor(count / 2) - 1,
pi_half = pi / 2,