Permalink
Browse files

Add a dynamic graph size for the detail layout.

  • Loading branch information...
1 parent c3d526f commit 745c2e774c05783fc34a1518b231882b95f6f387 @arcusfelis committed Dec 24, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/gexf_xref.erl
View
@@ -359,21 +359,28 @@ get_function_circle_position(PointCount) ->
get_module_exp_circle_position(PointCount) ->
- Gen = ellipint:cached_point_generator(1.7, 1, PointCount, 0),
+ {W,H,_,_} = ellipse_dimentions(PointCount),
+ Gen = ellipint:cached_point_generator(W, H, PointCount, 0),
fun(Num) ->
{X, Y} = Gen(Num),
gexf:position(X, Y, 0)
end.
get_module_loc_circle_position(PointCount) ->
- Gen = ellipint:cached_point_generator(1.4, 0.7, PointCount, 0.05),
+ {_,_,W,H} = ellipse_dimentions(PointCount),
+ Gen = ellipint:cached_point_generator(W, H, PointCount, 0.05),
fun(Num) ->
{X, Y} = Gen(Num),
gexf:position(X, Y, 0)
end.
+%% `{LargeCircleWidth, LargeCircleHeight, SmallCircleWidth, SmallCircleHeight}'.
+ellipse_dimentions(PointCount) when PointCount < 10 -> {0.6, 0.3, 0.3, 0.15};
+ellipse_dimentions(_PointCount) -> {1.7, 1, 1.4, 0.7}.
+
+
get_random_sparse_circle_position(PointCount) ->
RandomOffset = crypto:rand_uniform(0, 45),
get_sparse_circle_position(PointCount, RandomOffset).

0 comments on commit 745c2e7

Please sign in to comment.