summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorSato Hiroyuki <sathiroyuki@gmail.com>2013-01-30 22:20:00 +0900
committerSato Hiroyuki <sathiroyuki@gmail.com>2013-01-30 23:48:00 +0900
commit59b6de93cebe4aaa8cca121e6147fd7c83786f17 (patch)
treea7f78a0fc11773da64d17f9403e48997159fcad5 /vendor
parent7ba4f2dcfaa85fb89e15d9caa21bf75ad976389f (diff)
downloadgitlab-ce-59b6de93cebe4aaa8cca121e6147fd7c83786f17.tar.gz
Improve overlap of lines in network graph
Diffstat (limited to 'vendor')
-rw-r--r--vendor/assets/javascripts/branch-graph.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js
index 93849c79e80..76494196e43 100644
--- a/vendor/assets/javascripts/branch-graph.js
+++ b/vendor/assets/javascripts/branch-graph.js
@@ -103,8 +103,9 @@
for (i = 0; i < this.commitCount; i++) {
var x = offsetX + 20 * this.commits[i].time
- , y = offsetY + 20 * this.commits[i].space
- , c;
+ , y = offsetY + 10 * this.commits[i].space
+ , c
+ , ps;
// Draw dot
r.circle(x, y, 3).attr({
@@ -115,9 +116,11 @@
// Draw lines
for (var j = 0, jj = this.commits[i].parents.length; j < jj; j++) {
c = this.preparedCommits[this.commits[i].parents[j][0]];
+ ps = this.commits[i].parent_spaces[j];
if (c) {
var cx = offsetX + 20 * c.time
- , cy = offsetY + 20 * c.space;
+ , cy = offsetY + 10 * c.space
+ , psy = offsetY + 10 * ps;
if (c.space == this.commits[i].space) {
r.path([
"M", x, y,
@@ -128,13 +131,25 @@
});
} else if (c.space < this.commits[i].space) {
- r.path(["M", x - 5, y + .0001, "l-5-2,0,4,5,-2C", x - 5, y, x - 17, y + 2, x - 20, y - 5, "L", cx, y - 5, cx, cy])
+ r.path([
+ "M", x - 5, y,
+ "l-5-2,0,4,5,-2",
+ "L", x - 10, y,
+ "L", x - 15, psy,
+ "L", cx + 5, psy,
+ "L", cx, cy])
.attr({
stroke: this.colors[this.commits[i].space],
"stroke-width": 2
});
} else {
- r.path(["M", x - 3, y + 6, "l-4,3,4,2,0,-5L", x - 10, y + 20, "L", x - 10, cy, cx, cy])
+ r.path([
+ "M", x - 3, y + 6,
+ "l-4,3,4,2,0,-5",
+ "L", x - 5, y + 10,
+ "L", x - 10, psy,
+ "L", cx + 5, psy,
+ "L", cx, cy])
.attr({
stroke: this.colors[c.space],
"stroke-width": 2