Skip to content
This repository was archived by the owner on Jul 13, 2024. It is now read-only.

Commit 7d2c839

Browse files
committed
Merge develop into master
2 parents 8de2766 + 3e8b4c9 commit 7d2c839

13 files changed

+76
-70
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitgraph.js",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"main": [
55
"./build/gitgraph.js",
66
"./build/gitgraph.css"

build/gitgraph.js

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ==========================================================
2-
* GitGraph v1.11.0
2+
* GitGraph v1.11.1
33
* https://github.com/nicoespeon/gitgraph.js
44
* ==========================================================
55
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
@@ -515,7 +515,7 @@
515515
this.height = 0;
516516
this.width = 0;
517517
this.commits = [];
518-
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"join"|"end")}
518+
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"joint"|"end")}
519519

520520
// Column number calculation for auto-color & auto-offset
521521
if (typeof options.column === "number") {
@@ -767,23 +767,25 @@
767767
var point = {
768768
x: commit.x,
769769
y: commit.y,
770-
type: "join"
770+
type: "joint"
771771
};
772772

773773
if (!isFirstBranch && isPathBeginning) {
774774
this.pushPath(this.startPoint);
775-
776-
// Trace path from parent branch if it has commits already
777-
if (this.parentBranch.commits.length > 0) {
775+
// Add a path joint to startpoint + template spacing
776+
// So that line will not go through commit of other branches
777+
if (_isVertical(this.parent)) {
778778
this.pushPath({
779-
x: this.startPoint.x - this.parentBranch.offsetX + this.offsetX - this.template.commit.spacingX,
780-
y: this.startPoint.y - this.parentBranch.offsetY + this.offsetY - this.template.commit.spacingY,
781-
type: "join"
779+
x: commit.x,
780+
y: this.startPoint.y - this.template.commit.spacingY,
781+
type: "joint"
782+
});
783+
} else {
784+
this.pushPath({
785+
x: this.startPoint.x - this.template.commit.spacingX,
786+
y: commit.y,
787+
type: "joint"
782788
});
783-
784-
var parent = _clone(this.startPoint);
785-
parent.type = "join";
786-
this.parentBranch.pushPath(parent);
787789
}
788790
} else if (isPathBeginning) {
789791
point.type = "start";
@@ -942,7 +944,7 @@
942944
var endOfBranch = {
943945
x: this.offsetX + this.template.commit.spacingX * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetX,
944946
y: this.offsetY + this.template.commit.spacingY * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetY,
945-
type: "join"
947+
type: "joint"
946948
};
947949
this.pushPath(_clone(endOfBranch));
948950

@@ -1004,13 +1006,13 @@
10041006
} else if (lastPoint.x === point.x && lastPoint.y === point.y) {
10051007
if (lastPoint.type !== "start" && point.type === "end") {
10061008
lastPoint.type = "end";
1007-
} else if (point.type === "join") {
1009+
} else if (point.type === "joint") {
10081010

10091011
} else {
10101012
this.path.push(point);
10111013
}
10121014
} else {
1013-
if (point.type === "join") {
1015+
if (point.type === "joint") {
10141016
if ((point.x - lastPoint.x) * this.template.commit.spacingX < 0) {
10151017
this.path.push(point);
10161018
} else if ((point.y - lastPoint.y) * this.template.commit.spacingY < 0) {

build/gitgraph.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Branch.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ <h5>This:</h5>
672672

673673
<dt class="tag-source">Source:</dt>
674674
<dd class="tag-source"><ul class="dummy"><li>
675-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line965">line 965</a>
675+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line967">line 967</a>
676676
</li></ul></dd>
677677

678678

@@ -757,7 +757,7 @@ <h5>This:</h5>
757757

758758
<dt class="tag-source">Source:</dt>
759759
<dd class="tag-source"><ul class="dummy"><li>
760-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line843">line 843</a>
760+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line845">line 845</a>
761761
</li></ul></dd>
762762

763763

@@ -1059,7 +1059,7 @@ <h5>This:</h5>
10591059

10601060
<dt class="tag-source">Source:</dt>
10611061
<dd class="tag-source"><ul class="dummy"><li>
1062-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line852">line 852</a>
1062+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line854">line 854</a>
10631063
</li></ul></dd>
10641064

10651065

@@ -1322,7 +1322,7 @@ <h6>Properties</h6>
13221322

13231323
<dt class="tag-source">Source:</dt>
13241324
<dd class="tag-source"><ul class="dummy"><li>
1325-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line868">line 868</a>
1325+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line870">line 870</a>
13261326
</li></ul></dd>
13271327

13281328

@@ -1437,7 +1437,7 @@ <h5>This:</h5>
14371437

14381438
<dt class="tag-source">Source:</dt>
14391439
<dd class="tag-source"><ul class="dummy"><li>
1440-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line990">line 990</a>
1440+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line992">line 992</a>
14411441
</li></ul></dd>
14421442

14431443

@@ -1831,7 +1831,7 @@ <h6>Properties</h6>
18311831

18321832
<dt class="tag-source">Source:</dt>
18331833
<dd class="tag-source"><ul class="dummy"><li>
1834-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line819">line 819</a>
1834+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line821">line 821</a>
18351835
</li></ul></dd>
18361836

18371837

@@ -1886,7 +1886,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
18861886
<br class="clear">
18871887

18881888
<footer>
1889-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
1889+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
18901890
</footer>
18911891

18921892
<script> prettyPrint(); </script>

docs/Commit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ <h6>Properties</h6>
13871387

13881388
<dt class="tag-source">Source:</dt>
13891389
<dd class="tag-source"><ul class="dummy"><li>
1390-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1065">line 1065</a>
1390+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1067">line 1067</a>
13911391
</li></ul></dd>
13921392

13931393

@@ -1490,7 +1490,7 @@ <h5>This:</h5>
14901490

14911491
<dt class="tag-source">Source:</dt>
14921492
<dd class="tag-source"><ul class="dummy"><li>
1493-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1225">line 1225</a>
1493+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1227">line 1227</a>
14941494
</li></ul></dd>
14951495

14961496

@@ -1575,7 +1575,7 @@ <h5>This:</h5>
15751575

15761576
<dt class="tag-source">Source:</dt>
15771577
<dd class="tag-source"><ul class="dummy"><li>
1578-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1114">line 1114</a>
1578+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1116">line 1116</a>
15791579
</li></ul></dd>
15801580

15811581

@@ -1623,7 +1623,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
16231623
<br class="clear">
16241624

16251625
<footer>
1626-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
1626+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
16271627
</footer>
16281628

16291629
<script> prettyPrint(); </script>

docs/GitGraph.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
20612061
<br class="clear">
20622062

20632063
<footer>
2064-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
2064+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
20652065
</footer>
20662066

20672067
<script> prettyPrint(); </script>

docs/Tag.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ <h6>Properties</h6>
294294

295295
<dt class="tag-source">Source:</dt>
296296
<dd class="tag-source"><ul class="dummy"><li>
297-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1313">line 1313</a>
297+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1315">line 1315</a>
298298
</li></ul></dd>
299299

300300

@@ -374,7 +374,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
374374
<br class="clear">
375375

376376
<footer>
377-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
377+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
378378
</footer>
379379

380380
<script> prettyPrint(); </script>

docs/Template.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ <h6>Properties</h6>
11801180

11811181
<dt class="tag-source">Source:</dt>
11821182
<dd class="tag-source"><ul class="dummy"><li>
1183-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1388">line 1388</a>
1183+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1390">line 1390</a>
11841184
</li></ul></dd>
11851185

11861186

@@ -1329,7 +1329,7 @@ <h5>Parameters:</h5>
13291329

13301330
<dt class="tag-source">Source:</dt>
13311331
<dd class="tag-source"><ul class="dummy"><li>
1332-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1476">line 1476</a>
1332+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1478">line 1478</a>
13331333
</li></ul></dd>
13341334

13351335

@@ -1399,7 +1399,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
13991399
<br class="clear">
14001400

14011401
<footer>
1402-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
1402+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
14031403
</footer>
14041404

14051405
<script> prettyPrint(); </script>

docs/gitgraph.js.html

+18-16
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ <h1 class="page-title">Source: gitgraph.js</h1>
533533
this.height = 0;
534534
this.width = 0;
535535
this.commits = [];
536-
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"join"|"end")}
536+
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"joint"|"end")}
537537

538538
// Column number calculation for auto-color &amp; auto-offset
539539
if (typeof options.column === "number") {
@@ -785,23 +785,25 @@ <h1 class="page-title">Source: gitgraph.js</h1>
785785
var point = {
786786
x: commit.x,
787787
y: commit.y,
788-
type: "join"
788+
type: "joint"
789789
};
790790

791791
if (!isFirstBranch &amp;&amp; isPathBeginning) {
792792
this.pushPath(this.startPoint);
793-
794-
// Trace path from parent branch if it has commits already
795-
if (this.parentBranch.commits.length > 0) {
793+
// Add a path joint to startpoint + template spacing
794+
// So that line will not go through commit of other branches
795+
if (_isVertical(this.parent)) {
796796
this.pushPath({
797-
x: this.startPoint.x - this.parentBranch.offsetX + this.offsetX - this.template.commit.spacingX,
798-
y: this.startPoint.y - this.parentBranch.offsetY + this.offsetY - this.template.commit.spacingY,
799-
type: "join"
797+
x: commit.x,
798+
y: this.startPoint.y - this.template.commit.spacingY,
799+
type: "joint"
800+
});
801+
} else {
802+
this.pushPath({
803+
x: this.startPoint.x - this.template.commit.spacingX,
804+
y: commit.y,
805+
type: "joint"
800806
});
801-
802-
var parent = _clone(this.startPoint);
803-
parent.type = "join";
804-
this.parentBranch.pushPath(parent);
805807
}
806808
} else if (isPathBeginning) {
807809
point.type = "start";
@@ -960,7 +962,7 @@ <h1 class="page-title">Source: gitgraph.js</h1>
960962
var endOfBranch = {
961963
x: this.offsetX + this.template.commit.spacingX * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetX,
962964
y: this.offsetY + this.template.commit.spacingY * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetY,
963-
type: "join"
965+
type: "joint"
964966
};
965967
this.pushPath(_clone(endOfBranch));
966968

@@ -1022,13 +1024,13 @@ <h1 class="page-title">Source: gitgraph.js</h1>
10221024
} else if (lastPoint.x === point.x &amp;&amp; lastPoint.y === point.y) {
10231025
if (lastPoint.type !== "start" &amp;&amp; point.type === "end") {
10241026
lastPoint.type = "end";
1025-
} else if (point.type === "join") {
1027+
} else if (point.type === "joint") {
10261028

10271029
} else {
10281030
this.path.push(point);
10291031
}
10301032
} else {
1031-
if (point.type === "join") {
1033+
if (point.type === "joint") {
10321034
if ((point.x - lastPoint.x) * this.template.commit.spacingX &lt; 0) {
10331035
this.path.push(point);
10341036
} else if ((point.y - lastPoint.y) * this.template.commit.spacingY &lt; 0) {
@@ -1874,7 +1876,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
18741876
<br class="clear">
18751877

18761878
<footer>
1877-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
1879+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
18781880
</footer>
18791881

18801882
<script> prettyPrint(); </script>

docs/global.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
15141514
<br class="clear">
15151515

15161516
<footer>
1517-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
1517+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
15181518
</footer>
15191519

15201520
<script> prettyPrint(); </script>

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
115115
<br class="clear">
116116

117117
<footer>
118-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Apr 21 2017 21:01:23 GMT+0200 (CEST)
118+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 03 2017 23:49:53 GMT+0200 (CEST)
119119
</footer>
120120

121121
<script> prettyPrint(); </script>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitgraph.js",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"author": "Nicolas Carlo <[email protected]>",
55
"description": "A JavaScript library to draw pretty git graphs in the browser",
66
"contributors": [

0 commit comments

Comments
 (0)