aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/public
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@unity3d.com>2012-10-15 15:42:03 +0300
committerAras Pranckevicius <aras@unity3d.com>2012-10-15 15:42:03 +0300
commit5a9f26e6bc69eaf1a491bc651354d4e002b6074f (patch)
tree99bb4a6cd0bfbf9b4afe383efdc9294404456083 /rhodecode/public
parentadfd1ea7b77d7ab717f967345f01df53240f37d2 (diff)
graph: remove unused stuff, simplify
--HG-- branch : beta
Diffstat (limited to 'rhodecode/public')
-rw-r--r--rhodecode/public/js/graph.js20
1 files changed, 6 insertions, 14 deletions
diff --git a/rhodecode/public/js/graph.js b/rhodecode/public/js/graph.js
index 25c046b2..c7960017 100644
--- a/rhodecode/public/js/graph.js
+++ b/rhodecode/public/js/graph.js
@@ -35,14 +35,9 @@ function BranchRenderer() {
this.max_column = 1;
this.line_width = 2.5;
this.dot_radius = 5.5;
- this.bg = [0, 4];
- this.cell = [2, 0];
- this.revlink = '';
this.scale = function(height) {
this.box_size = Math.floor(height/1.2);
- this.cell_height = this.box_size;
- this.bg_height = height;
}
this.setColor = function(color, bg, fg) {
@@ -58,10 +53,10 @@ function BranchRenderer() {
this.ctx.fillStyle = s;
}
- this.render = function(data,pad) {
+ this.render = function(data,width) {
var idx = 1;
var rela = document.getElementById('graph');
- var pad = pad;
+ var pad = width;
var scale = 22;
for (var i in data) {
@@ -73,9 +68,6 @@ function BranchRenderer() {
var next = document.getElementById("chg_"+(idx+1));
var extra = 0;
- this.cell[1] += row.clientWidth;
- this.bg[1] += this.bg_height;
-
cur = data[i];
nodeid = cur[0];
node = cur[1];
@@ -102,7 +94,7 @@ function BranchRenderer() {
this.setColor(color, 0.0, 0.65);
- x = pad-((this.cell[0] + this.box_size * start - 1) + this.bg_height-2);
+ x = pad-(this.box_size * start - 1 + scale);
this.ctx.lineWidth=this.line_width;
this.ctx.beginPath();
@@ -111,12 +103,12 @@ function BranchRenderer() {
if (start == end)
{
- x = pad-((1 + this.box_size * end) + this.bg_height-2);
+ x = pad-((1 + this.box_size * end) + scale-2);
this.ctx.lineTo(x,nextY+extra,3);
}
else
{
- var x2 = pad-((1 + this.box_size * end) + this.bg_height-2);
+ var x2 = pad-((1 + this.box_size * end) + scale-2);
var ymid = (rowY+nextY) / 2;
this.ctx.bezierCurveTo (x,ymid,x2,ymid,x2,nextY);
}
@@ -128,7 +120,7 @@ function BranchRenderer() {
radius = this.dot_radius;
- x = pad-(Math.round(this.cell[0] * scale/2 * column + radius) + 15 - (column*4));
+ x = pad-(Math.round(scale * column + radius) + 15 - (column*4));
this.ctx.beginPath();
this.setColor(color, 0.25, 0.75);