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

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed May 3, 2017
2 parents 8de2766 + 3e8b4c9 commit 7d2c839
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 70 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitgraph.js",
"version": "1.11.0",
"version": "1.11.1",
"main": [
"./build/gitgraph.js",
"./build/gitgraph.css"
Expand Down
34 changes: 18 additions & 16 deletions build/gitgraph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* GitGraph v1.11.0
* GitGraph v1.11.1
* https://github.com/nicoespeon/gitgraph.js
* ==========================================================
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
Expand Down Expand Up @@ -515,7 +515,7 @@
this.height = 0;
this.width = 0;
this.commits = [];
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"join"|"end")}
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"joint"|"end")}

// Column number calculation for auto-color & auto-offset
if (typeof options.column === "number") {
Expand Down Expand Up @@ -767,23 +767,25 @@
var point = {
x: commit.x,
y: commit.y,
type: "join"
type: "joint"
};

if (!isFirstBranch && isPathBeginning) {
this.pushPath(this.startPoint);

// Trace path from parent branch if it has commits already
if (this.parentBranch.commits.length > 0) {
// Add a path joint to startpoint + template spacing
// So that line will not go through commit of other branches
if (_isVertical(this.parent)) {
this.pushPath({
x: this.startPoint.x - this.parentBranch.offsetX + this.offsetX - this.template.commit.spacingX,
y: this.startPoint.y - this.parentBranch.offsetY + this.offsetY - this.template.commit.spacingY,
type: "join"
x: commit.x,
y: this.startPoint.y - this.template.commit.spacingY,
type: "joint"
});
} else {
this.pushPath({
x: this.startPoint.x - this.template.commit.spacingX,
y: commit.y,
type: "joint"
});

var parent = _clone(this.startPoint);
parent.type = "join";
this.parentBranch.pushPath(parent);
}
} else if (isPathBeginning) {
point.type = "start";
Expand Down Expand Up @@ -942,7 +944,7 @@
var endOfBranch = {
x: this.offsetX + this.template.commit.spacingX * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetX,
y: this.offsetY + this.template.commit.spacingY * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetY,
type: "join"
type: "joint"
};
this.pushPath(_clone(endOfBranch));

Expand Down Expand Up @@ -1004,13 +1006,13 @@
} else if (lastPoint.x === point.x && lastPoint.y === point.y) {
if (lastPoint.type !== "start" && point.type === "end") {
lastPoint.type = "end";
} else if (point.type === "join") {
} else if (point.type === "joint") {

} else {
this.path.push(point);
}
} else {
if (point.type === "join") {
if (point.type === "joint") {
if ((point.x - lastPoint.x) * this.template.commit.spacingX < 0) {
this.path.push(point);
} else if ((point.y - lastPoint.y) * this.template.commit.spacingY < 0) {
Expand Down
4 changes: 2 additions & 2 deletions build/gitgraph.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/Branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ <h5>This:</h5>

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


Expand Down Expand Up @@ -757,7 +757,7 @@ <h5>This:</h5>

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


Expand Down Expand Up @@ -1059,7 +1059,7 @@ <h5>This:</h5>

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


Expand Down Expand Up @@ -1322,7 +1322,7 @@ <h6>Properties</h6>

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


Expand Down Expand Up @@ -1437,7 +1437,7 @@ <h5>This:</h5>

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


Expand Down Expand Up @@ -1831,7 +1831,7 @@ <h6>Properties</h6>

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


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

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
8 changes: 4 additions & 4 deletions docs/Commit.html
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ <h6>Properties</h6>

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


Expand Down Expand Up @@ -1490,7 +1490,7 @@ <h5>This:</h5>

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


Expand Down Expand Up @@ -1575,7 +1575,7 @@ <h5>This:</h5>

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


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

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/GitGraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
<br class="clear">

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 2 additions & 2 deletions docs/Tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h6>Properties</h6>

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


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

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions docs/Template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ <h6>Properties</h6>

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


Expand Down Expand Up @@ -1329,7 +1329,7 @@ <h5>Parameters:</h5>

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


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

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
34 changes: 18 additions & 16 deletions docs/gitgraph.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ <h1 class="page-title">Source: gitgraph.js</h1>
this.height = 0;
this.width = 0;
this.commits = [];
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"join"|"end")}
this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"joint"|"end")}

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

if (!isFirstBranch &amp;&amp; isPathBeginning) {
this.pushPath(this.startPoint);

// Trace path from parent branch if it has commits already
if (this.parentBranch.commits.length > 0) {
// Add a path joint to startpoint + template spacing
// So that line will not go through commit of other branches
if (_isVertical(this.parent)) {
this.pushPath({
x: this.startPoint.x - this.parentBranch.offsetX + this.offsetX - this.template.commit.spacingX,
y: this.startPoint.y - this.parentBranch.offsetY + this.offsetY - this.template.commit.spacingY,
type: "join"
x: commit.x,
y: this.startPoint.y - this.template.commit.spacingY,
type: "joint"
});
} else {
this.pushPath({
x: this.startPoint.x - this.template.commit.spacingX,
y: commit.y,
type: "joint"
});

var parent = _clone(this.startPoint);
parent.type = "join";
this.parentBranch.pushPath(parent);
}
} else if (isPathBeginning) {
point.type = "start";
Expand Down Expand Up @@ -960,7 +962,7 @@ <h1 class="page-title">Source: gitgraph.js</h1>
var endOfBranch = {
x: this.offsetX + this.template.commit.spacingX * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetX,
y: this.offsetY + this.template.commit.spacingY * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetY,
type: "join"
type: "joint"
};
this.pushPath(_clone(endOfBranch));

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

} else {
this.path.push(point);
}
} else {
if (point.type === "join") {
if (point.type === "joint") {
if ((point.x - lastPoint.x) * this.template.commit.spacingX &lt; 0) {
this.path.push(point);
} else if ((point.y - lastPoint.y) * this.template.commit.spacingY &lt; 0) {
Expand Down Expand Up @@ -1874,7 +1876,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
<br class="clear">

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
<br class="clear">

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
<br class="clear">

<footer>
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)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitgraph.js",
"version": "1.11.0",
"version": "1.11.1",
"author": "Nicolas Carlo <nicolascarlo.espeon@gmail.com>",
"description": "A JavaScript library to draw pretty git graphs in the browser",
"contributors": [
Expand Down
Loading

0 comments on commit 7d2c839

Please sign in to comment.