@@ -50,22 +50,8 @@ var graph = new Graph();
graph.scale({bg_height});
graph.vertex = function(x, y, radius, color, parity, cur) \{
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg parity' + parity + '"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
-
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) \{
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg parity' + parity + '"></li>', ''];
}
graph.render(data);
@@ -44,22 +44,8 @@
graph.scale({bg_height});
graph.vertex = function(x, y, radius, color, parity, cur) \{
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg parity' + parity + '"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
-
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) \{
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg parity' + parity + '"></li>', ''];
}
graph.render(data);
@@ -63,22 +63,8 @@ var graph = new Graph();
graph.scale({bg_height});
graph.vertex = function(x, y, radius, color, parity, cur) \{
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
-
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) \{
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg"></li>', ''];
}
graph.render(data);
@@ -44,21 +44,8 @@ var graph = new Graph();
graph.scale({bg_height});
graph.vertex = function(x, y, radius, color, parity, cur) \{
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg parity' + parity + '"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) \{
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg parity' + parity + '"></li>', ''];
}
graph.render(data);
@@ -92,6 +92,21 @@ Graph.prototype = {
},
+ vertex: function(x, y, radius, color, parity, cur) {
+ this.ctx.beginPath();
+ this.setColor(color, 0.25, 0.75);
+ this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
+ this.ctx.fill();
+
+ var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
+ var item = document.querySelector('[data-node="' + cur.node + '"]');
+ if (item) {
+ item.style.paddingLeft = left + 'px';
+ }
+
+ return ['', ''];
+ },
+
render: function(data) {
var backgrounds = '';
@@ -1821,22 +1821,8 @@ Overviews
graph.scale(39);
graph.vertex = function(x, y, radius, color, parity, cur) {
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg parity' + parity + '"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
-
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) {
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg parity' + parity + '"></li>', ''];
}
graph.render(data);
@@ -307,22 +307,8 @@ Some tests for hgweb in an empty reposit
graph.scale(39);
graph.vertex = function(x, y, radius, color, parity, cur) {
-
- this.ctx.beginPath();
- color = this.setColor(color, 0.25, 0.75);
- this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
- this.ctx.fill();
-
- var bg = '<li class="bg"></li>';
- var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
-
- var item = document.querySelector('[data-node="' + cur.node + '"]');
- if (item) {
- item.style.paddingLeft = left + 'px';
- }
-
- return [bg, ''];
-
+ Graph.prototype.vertex.apply(this, arguments);
+ return ['<li class="bg"></li>', ''];
}
graph.render(data);