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 Apr 21, 2017
2 parents 9e3a51a + 69e9a36 commit 8de2766
Show file tree
Hide file tree
Showing 15 changed files with 257 additions and 61 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.10.1",
"version": "1.11.0",
"main": [
"./build/gitgraph.js",
"./build/gitgraph.css"
Expand Down
20 changes: 20 additions & 0 deletions build/gitgraph.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ declare namespace GitGraph {
*/
name?: string;

/**
* Branch line dash segments
*/
lineDash?: number[];

/**
* Default options for commits
*/
Expand Down Expand Up @@ -265,6 +270,11 @@ declare namespace GitGraph {
*/
dotStrokeColor?: string;

/**
* undefined
*/
lineDash?: number[];

/**
* Commit message
*/
Expand Down Expand Up @@ -416,6 +426,11 @@ declare namespace GitGraph {
*/
lineWidth?: number;

/**
* Branch line dash segments
*/
lineDash?: number[];

/**
* Branch merge style
*/
Expand Down Expand Up @@ -474,6 +489,11 @@ declare namespace GitGraph {
*/
strokeColor?: string;

/**
* Commit dot line dash segments
*/
lineDash?: number[];

};
message?: {

Expand Down
24 changes: 13 additions & 11 deletions build/gitgraph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* GitGraph v1.10.1
* GitGraph v1.11.0
* https://github.com/nicoespeon/gitgraph.js
* ==========================================================
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
Expand Down Expand Up @@ -472,6 +472,7 @@
* @param {Branch} [options.parentBranch = options.parentCommit.branch] - Parent branch
* @param {Commit} [options.parentCommit = _getLast(options.parentBranch.commits)] - Parent commit
* @param {string} [options.name = "no-name"] - Branch name
* @param {number[]} [options.lineDash = this.template.branch.lineDash] - Branch line dash segments
* @param {object} [options.commitDefaultOptions = {}] - Default options for commits
*
* @this Branch
Expand Down Expand Up @@ -615,19 +616,12 @@
this.context.lineWidth = this.lineWidth;
this.context.strokeStyle = this.color;

var prevLineDash;
if (this.context.setLineDash !== undefined) {
prevLineDash = this.context.getLineDash();
if (typeof this.context.setLineDash === "function") {
this.context.setLineDash(this.lineDash);
}

this.context.stroke();
this.context.closePath();

//Restore previous line dash setting, if any
if (prevLineDash !== undefined) {
this.context.setLineDash(prevLineDash);
}
};

/**
Expand Down Expand Up @@ -1059,6 +1053,7 @@
* @param {number} [options.dotSize = this.template.commit.dot.size] - Dot size
* @param {number} [options.dotStrokeWidth = this.template.commit.dot.strokeWidth] - Dot stroke width
* @param {string} [options.dotStrokeColor = this.template.commit.dot.strokeColor]
* @param {number[]} [options.lineDash = this.template.commit.dot.lineDash]
*
* @param {string} [options.message = "He doesn't like George Michael! Boooo!"] - Commit message
* @param {string} [options.messageColor = options.color] - Specific message color
Expand Down Expand Up @@ -1105,6 +1100,7 @@
this.dotSize = options.dotSize || this.template.commit.dot.size;
this.dotStrokeWidth = options.dotStrokeWidth || this.template.commit.dot.strokeWidth;
this.dotStrokeColor = options.dotStrokeColor || this.template.commit.dot.strokeColor || options.color;
this.lineDash = options.lineDash || this.template.commit.dot.lineDash;
this.type = options.type || null;
this.tooltipDisplay = _booleanOptionOr(options.tooltipDisplay, true);
this.onClick = options.onClick || null;
Expand All @@ -1131,7 +1127,6 @@

// Label
if (this.showLabel) {

/*
* For cases where we want a 0 or 180 degree label rotation in horizontal mode,
* we need to modify the position of the label to sit centrally above the commit dot.
Expand Down Expand Up @@ -1171,7 +1166,11 @@
this.context.strokeStyle = this.dotStrokeColor;
this.context.lineWidth = this.dotStrokeWidth;

if (typeof (this.dotStrokeWidth) === "number") {
if (typeof this.context.setLineDash === "function") {
this.context.setLineDash(this.lineDash);
}

if (typeof this.dotStrokeWidth === "number") {
this.context.stroke();
}

Expand Down Expand Up @@ -1372,6 +1371,7 @@
* @param {number} [options.arrow.offset] - Arrow offset
* @param {string} [options.branch.color] - Branch color
* @param {number} [options.branch.lineWidth] - Branch line width
* @param {number[]} [options.branch.lineDash] - Branch line dash segments
* @param {string} [options.branch.mergeStyle = ("bezier"|"straight")] - Branch merge style
* @param {number} [options.branch.spacingX] - Space between branches
* @param {number} [options.branch.spacingY] - Space between branches
Expand All @@ -1383,6 +1383,7 @@
* @param {number} [options.commit.dot.size] - Commit dot size
* @param {number} [options.commit.dot.strokeWidth] - Commit dot stroke width
* @param {string} [options.commit.dot.strokeColor] - Commit dot stroke color
* @param {number[]} [options.commit.dot.lineDash] - Commit dot line dash segments
* @param {string} [options.commit.message.color] - Commit message color
* @param {boolean} [options.commit.message.display] - Commit display policy
* @param {boolean} [options.commit.message.displayAuthor] - Commit message author policy
Expand Down Expand Up @@ -1456,6 +1457,7 @@
this.commit.dot.size = options.commit.dot.size || 3;
this.commit.dot.strokeWidth = options.commit.dot.strokeWidth || null;
this.commit.dot.strokeColor = options.commit.dot.strokeColor || null;
this.commit.dot.lineDash = options.commit.dot.lineDash || this.branch.lineDash;

this.commit.tag = {};
this.commit.tag.color = options.commit.tag.color || this.commit.dot.color;
Expand Down
4 changes: 2 additions & 2 deletions build/gitgraph.min.js

Large diffs are not rendered by default.

61 changes: 50 additions & 11 deletions docs/Branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,45 @@ <h6>Properties</h6>



<tr>

<td class="name"><code>lineDash</code></td>


<td class="type">


<span class="param-type">Array.&lt;number></span>



</td>


<td class="attributes">

&lt;optional><br>





</td>



<td class="default">

this.template.branch.lineDash

</td>


<td class="description last"><p>Branch line dash segments</p></td>
</tr>



<tr>

<td class="name"><code>commitDefaultOptions</code></td>
Expand Down Expand Up @@ -364,7 +403,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#line469">line 469</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line470">line 470</a>
</li></ul></dd>


Expand Down Expand Up @@ -519,7 +558,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#line559">line 559</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line560">line 560</a>
</li></ul></dd>


Expand Down Expand Up @@ -633,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#line971">line 971</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line965">line 965</a>
</li></ul></dd>


Expand Down Expand Up @@ -718,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#line849">line 849</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line843">line 843</a>
</li></ul></dd>


Expand Down Expand Up @@ -928,7 +967,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#line671">line 671</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line665">line 665</a>
</li></ul></dd>


Expand Down Expand Up @@ -1020,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#line858">line 858</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line852">line 852</a>
</li></ul></dd>


Expand Down Expand Up @@ -1283,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#line874">line 874</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line868">line 868</a>
</li></ul></dd>


Expand Down Expand Up @@ -1398,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#line996">line 996</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line990">line 990</a>
</li></ul></dd>


Expand Down Expand Up @@ -1483,7 +1522,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#line584">line 584</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line585">line 585</a>
</li></ul></dd>


Expand Down Expand Up @@ -1792,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#line825">line 825</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line819">line 819</a>
</li></ul></dd>


Expand Down Expand Up @@ -1847,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 Wed Apr 19 2017 08:51:54 GMT+0200 (CEST)
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)
</footer>

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



<tr>

<td class="name"><code>lineDash</code></td>


<td class="type">


<span class="param-type">Array.&lt;number></span>



</td>


<td class="attributes">

&lt;optional><br>





</td>



<td class="default">

this.template.commit.dot.lineDash

</td>


<td class="description last"></td>
</tr>



<tr>

<td class="name"><code>message</code></td>
Expand Down Expand Up @@ -1348,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#line1070">line 1070</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1065">line 1065</a>
</li></ul></dd>


Expand Down Expand Up @@ -1451,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#line1226">line 1226</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1225">line 1225</a>
</li></ul></dd>


Expand Down Expand Up @@ -1536,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#line1118">line 1118</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1114">line 1114</a>
</li></ul></dd>


Expand Down Expand Up @@ -1584,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 Wed Apr 19 2017 08:51:54 GMT+0200 (CEST)
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)
</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 Wed Apr 19 2017 08:51:54 GMT+0200 (CEST)
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)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit 8de2766

Please sign in to comment.