summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-30 22:22:37 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-30 22:22:37 -0800
commitd46cb3fd1c8aa423df72fabcdd504d39d91317e2 (patch)
tree90afae1b1189b4770ed0bef92419b42a48e44038 /vendor
parent8c50707dd4c9c0ca21f373ebd9fea30eb1b606b4 (diff)
parent59b6de93cebe4aaa8cca121e6147fd7c83786f17 (diff)
downloadgitlab-ce-d46cb3fd1c8aa423df72fabcdd504d39d91317e2.tar.gz
Merge pull request #2847 from hiroponz/improve-overlap-lines
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 cdaa8dd8d37..69bddd78d63 100644
--- a/vendor/assets/javascripts/branch-graph.js
+++ b/vendor/assets/javascripts/branch-graph.js
@@ -104,8 +104,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({
@@ -116,9 +117,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,
@@ -129,13 +132,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