Commit 6579ba3e7733d061c77d56cdd7aa98b7c38a94d6

Authored by Dmitriy Zaporozhets
1 parent ddaa1f1f

Increase graphs height

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