Commit 6579ba3e7733d061c77d56cdd7aa98b7c38a94d6

Authored by Dmitriy Zaporozhets
1 parent ddaa1f1f

Increase graphs height

app/assets/javascripts/stat_graph_contributors_graph.js.coffee
1 class window.ContributorsGraph 1 class window.ContributorsGraph
2 MARGIN: 2 MARGIN:
3 top: 20 3 top: 20
4 - right: 20  
5 - bottom: 30 4 + right: 20
  5 + bottom: 30
6 left: 50 6 left: 50
7 x_domain: null 7 x_domain: null
8 y_domain: null 8 y_domain: null
@@ -38,7 +38,7 @@ class window.ContributorsGraph @@ -38,7 +38,7 @@ class window.ContributorsGraph
38 @y = d3.scale.linear().range([height, 0]).nice() 38 @y = d3.scale.linear().range([height, 0]).nice()
39 draw_x_axis: -> 39 draw_x_axis: ->
40 @svg.append("g").attr("class", "x axis").attr("transform", "translate(0, #{@height})") 40 @svg.append("g").attr("class", "x axis").attr("transform", "translate(0, #{@height})")
41 - .call(@x_axis); 41 + .call(@x_axis)
42 draw_y_axis: -> 42 draw_y_axis: ->
43 @svg.append("g").attr("class", "y axis").call(@y_axis) 43 @svg.append("g").attr("class", "y axis").call(@y_axis)
44 set_data: (data) -> 44 set_data: (data) ->
@@ -51,7 +51,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph @@ -51,7 +51,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph
51 else 51 else
52 @width = 870 52 @width = 870
53 53
54 - @height = 125 54 + @height = 200
55 @x = null 55 @x = null
56 @y = null 56 @y = null
57 @x_axis = null 57 @x_axis = null
@@ -61,7 +61,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph @@ -61,7 +61,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph
61 @brush = null 61 @brush = null
62 @x_max_domain = null 62 @x_max_domain = null
63 process_dates: (data) -> 63 process_dates: (data) ->
64 - dates = @get_dates(data) 64 + dates = @get_dates(data)
65 @parse_dates(data) 65 @parse_dates(data)
66 ContributorsGraph.set_dates(dates) 66 ContributorsGraph.set_dates(dates)
67 get_dates: (data) -> 67 get_dates: (data) ->
@@ -87,14 +87,16 @@ class window.ContributorsMasterGraph extends ContributorsGraph @@ -87,14 +87,16 @@ class window.ContributorsMasterGraph extends ContributorsGraph
87 @area = d3.svg.area().x((d) -> 87 @area = d3.svg.area().x((d) ->
88 x(d.date) 88 x(d.date)
89 ).y0(@height).y1((d) -> 89 ).y0(@height).y1((d) ->
90 - y(d.commits = d.commits ? d.additions ? d.deletions) 90 + xa = d.commits = d.commits ? d.additions ? d.deletions
  91 + console.log(xa)
  92 + y(xa)
91 ).interpolate("basis") 93 ).interpolate("basis")
92 create_brush: -> 94 create_brush: ->
93 @brush = d3.svg.brush().x(@x).on("brushend", @update_content) 95 @brush = d3.svg.brush().x(@x).on("brushend", @update_content)
94 draw_path: (data) -> 96 draw_path: (data) ->
95 @svg.append("path").datum(data).attr("class", "area").attr("d", @area) 97 @svg.append("path").datum(data).attr("class", "area").attr("d", @area)
96 add_brush: -> 98 add_brush: ->
97 - @svg.append("g").attr("class", "selection").call(@brush).selectAll("rect").attr("height", @height); 99 + @svg.append("g").attr("class", "selection").call(@brush).selectAll("rect").attr("height", @height)
98 update_content: => 100 update_content: =>
99 ContributorsGraph.set_x_domain(if @brush.empty() then @x_max_domain else @brush.extent()) 101 ContributorsGraph.set_x_domain(if @brush.empty() then @x_max_domain else @brush.extent())
100 $("#brush_change").trigger('change') 102 $("#brush_change").trigger('change')
@@ -126,8 +128,8 @@ class window.ContributorsAuthorGraph extends ContributorsGraph @@ -126,8 +128,8 @@ class window.ContributorsAuthorGraph extends ContributorsGraph
126 @width = 490 128 @width = 490
127 else 129 else
128 @width = 380 130 @width = 380
129 -  
130 - @height = 130 131 +
  132 + @height = 200
131 @x = null 133 @x = null
132 @y = null 134 @y = null
133 @x_axis = null 135 @x_axis = null