@@ -12,30 +12,10 @@ module GithubChart
1212 ##
1313 # Convert stats into SVG
1414 class Chart
15- private
16-
1715 CUBE_SIZE = 12
1816 X_PAD = 27
1917 Y_PAD = 20
2018
21- def render_svg
22- grid = matrix
23- chart = SVGPlot . new ( width : ( CUBE_SIZE * grid . column_size ) + X_PAD ,
24- height : ( CUBE_SIZE * grid . row_size ) + Y_PAD )
25- svg_add_points grid , chart
26- svg_add_weekdays chart
27- svg_add_months chart
28- chart . to_s
29- end
30-
31- def render_svg_square
32- grid = matrix . minor ( 0 , 7 , -7 , 7 )
33- chart = SVGPlot . new ( width : ( CUBE_SIZE * grid . column_size ) - 2 ,
34- height : ( CUBE_SIZE * grid . row_size ) - 2 )
35- svg_add_points grid , chart , 0 , 0
36- chart . to_s
37- end
38-
3919 ##
4020 # Define shared label style
4121
@@ -57,6 +37,26 @@ def render_svg_square
5737
5838 SVG_MONTH_STYLE = SVG_SHARED_STYLE . dup . merge ( 'font-size' : '10px' ) . freeze
5939
40+ private
41+
42+ def render_svg
43+ grid = matrix
44+ chart = SVGPlot . new ( width : ( CUBE_SIZE * grid . column_size ) + X_PAD ,
45+ height : ( CUBE_SIZE * grid . row_size ) + Y_PAD )
46+ svg_add_points grid , chart
47+ svg_add_weekdays chart
48+ svg_add_months chart
49+ chart . to_s
50+ end
51+
52+ def render_svg_square
53+ grid = matrix . minor ( 0 , 7 , -7 , 7 )
54+ chart = SVGPlot . new ( width : ( CUBE_SIZE * grid . column_size ) - 2 ,
55+ height : ( CUBE_SIZE * grid . row_size ) - 2 )
56+ svg_add_points grid , chart , 0 , 0
57+ chart . to_s
58+ end
59+
6060 def svg_point_style ( point )
6161 {
6262 fill : @colors [ @stats . quartile ( point . score ) ] ,
0 commit comments