##// END OF EJS Templates
graph: remove unused stuff, simplify
Aras Pranckevicius -
r2922:1f3ae369 beta
parent child Browse files
Show More
@@ -32,14 +32,9 b' function BranchRenderer() {'
32 32 this.ctx.strokeStyle = 'rgb(0, 0, 0)';
33 33 this.ctx.fillStyle = 'rgb(0, 0, 0)';
34 34 this.cur = [0, 0];
35 this.max_column = 1;
36 35 this.line_width = 2.5;
37 36 this.dot_radius = 5.5;
38 37
39 this.scale = function(height) {
40 this.box_size = Math.floor(height/1.2);
41 }
42
43 38 this.setColor = function(color, bg, fg) {
44 39 color %= colors.length;
45 40 var red = (colors[color][0] * fg) || bg;
@@ -58,9 +53,9 b' function BranchRenderer() {'
58 53 var rela = document.getElementById('graph');
59 54 var pad = width;
60 55 var scale = 22;
56 var box_size = Math.floor(scale/1.2);
61 57
62 58 for (var i in data) {
63 this.scale(scale);
64 59
65 60 var row = document.getElementById("chg_"+idx);
66 61 if (row == null)
@@ -83,18 +78,10 b' function BranchRenderer() {'
83 78 end = line[1];
84 79 color = line[2];
85 80
86 if (start > this.max_column) {
87 this.max_column = start;
88 }
89
90 if (end > this.max_column) {
91 this.max_column = end;
92 }
93
94 81 this.setColor(color, 0.0, 0.65);
95 82
96 83
97 x = pad-(this.box_size * start - 1 + scale);
84 x = pad-(box_size * start - 1 + scale);
98 85
99 86 this.ctx.lineWidth=this.line_width;
100 87 this.ctx.beginPath();
@@ -103,12 +90,12 b' function BranchRenderer() {'
103 90
104 91 if (start == end)
105 92 {
106 x = pad-((1 + this.box_size * end) + scale-2);
93 x = pad-((1 + box_size * end) + scale-2);
107 94 this.ctx.lineTo(x,nextY+extra,3);
108 95 }
109 96 else
110 97 {
111 var x2 = pad-((1 + this.box_size * end) + scale-2);
98 var x2 = pad-((1 + box_size * end) + scale-2);
112 99 var ymid = (rowY+nextY) / 2;
113 100 this.ctx.bezierCurveTo (x,ymid,x2,ymid,x2,nextY);
114 101 }
General Comments 0
You need to be logged in to leave comments. Login now