##// END OF EJS Templates
graph: remove unused stuff, simplify
Aras Pranckevicius -
r2921:58222452 beta
parent child Browse files
Show More
@@ -35,14 +35,9 b' function BranchRenderer() {'
35 35 this.max_column = 1;
36 36 this.line_width = 2.5;
37 37 this.dot_radius = 5.5;
38 this.bg = [0, 4];
39 this.cell = [2, 0];
40 this.revlink = '';
41 38
42 39 this.scale = function(height) {
43 40 this.box_size = Math.floor(height/1.2);
44 this.cell_height = this.box_size;
45 this.bg_height = height;
46 41 }
47 42
48 43 this.setColor = function(color, bg, fg) {
@@ -58,10 +53,10 b' function BranchRenderer() {'
58 53 this.ctx.fillStyle = s;
59 54 }
60 55
61 this.render = function(data,pad) {
56 this.render = function(data,width) {
62 57 var idx = 1;
63 58 var rela = document.getElementById('graph');
64 var pad = pad;
59 var pad = width;
65 60 var scale = 22;
66 61
67 62 for (var i in data) {
@@ -73,9 +68,6 b' function BranchRenderer() {'
73 68 var next = document.getElementById("chg_"+(idx+1));
74 69 var extra = 0;
75 70
76 this.cell[1] += row.clientWidth;
77 this.bg[1] += this.bg_height;
78
79 71 cur = data[i];
80 72 nodeid = cur[0];
81 73 node = cur[1];
@@ -102,7 +94,7 b' function BranchRenderer() {'
102 94 this.setColor(color, 0.0, 0.65);
103 95
104 96
105 x = pad-((this.cell[0] + this.box_size * start - 1) + this.bg_height-2);
97 x = pad-(this.box_size * start - 1 + scale);
106 98
107 99 this.ctx.lineWidth=this.line_width;
108 100 this.ctx.beginPath();
@@ -111,12 +103,12 b' function BranchRenderer() {'
111 103
112 104 if (start == end)
113 105 {
114 x = pad-((1 + this.box_size * end) + this.bg_height-2);
106 x = pad-((1 + this.box_size * end) + scale-2);
115 107 this.ctx.lineTo(x,nextY+extra,3);
116 108 }
117 109 else
118 110 {
119 var x2 = pad-((1 + this.box_size * end) + this.bg_height-2);
111 var x2 = pad-((1 + this.box_size * end) + scale-2);
120 112 var ymid = (rowY+nextY) / 2;
121 113 this.ctx.bezierCurveTo (x,ymid,x2,ymid,x2,nextY);
122 114 }
@@ -128,7 +120,7 b' function BranchRenderer() {'
128 120
129 121 radius = this.dot_radius;
130 122
131 x = pad-(Math.round(this.cell[0] * scale/2 * column + radius) + 15 - (column*4));
123 x = pad-(Math.round(scale * column + radius) + 15 - (column*4));
132 124
133 125 this.ctx.beginPath();
134 126 this.setColor(color, 0.25, 0.75);
General Comments 0
You need to be logged in to leave comments. Login now