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

Commit 8de2766

Browse files
committed
Merge develop into master
2 parents 9e3a51a + 69e9a36 commit 8de2766

15 files changed

+257
-61
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.10.1",
3+
"version": "1.11.0",
44
"main": [
55
"./build/gitgraph.js",
66
"./build/gitgraph.css"

build/gitgraph.d.ts

+20
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ declare namespace GitGraph {
8181
*/
8282
name?: string;
8383

84+
/**
85+
* Branch line dash segments
86+
*/
87+
lineDash?: number[];
88+
8489
/**
8590
* Default options for commits
8691
*/
@@ -265,6 +270,11 @@ declare namespace GitGraph {
265270
*/
266271
dotStrokeColor?: string;
267272

273+
/**
274+
* undefined
275+
*/
276+
lineDash?: number[];
277+
268278
/**
269279
* Commit message
270280
*/
@@ -416,6 +426,11 @@ declare namespace GitGraph {
416426
*/
417427
lineWidth?: number;
418428

429+
/**
430+
* Branch line dash segments
431+
*/
432+
lineDash?: number[];
433+
419434
/**
420435
* Branch merge style
421436
*/
@@ -474,6 +489,11 @@ declare namespace GitGraph {
474489
*/
475490
strokeColor?: string;
476491

492+
/**
493+
* Commit dot line dash segments
494+
*/
495+
lineDash?: number[];
496+
477497
};
478498
message?: {
479499

build/gitgraph.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ==========================================================
2-
* GitGraph v1.10.1
2+
* GitGraph v1.11.0
33
* https://github.com/nicoespeon/gitgraph.js
44
* ==========================================================
55
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
@@ -472,6 +472,7 @@
472472
* @param {Branch} [options.parentBranch = options.parentCommit.branch] - Parent branch
473473
* @param {Commit} [options.parentCommit = _getLast(options.parentBranch.commits)] - Parent commit
474474
* @param {string} [options.name = "no-name"] - Branch name
475+
* @param {number[]} [options.lineDash = this.template.branch.lineDash] - Branch line dash segments
475476
* @param {object} [options.commitDefaultOptions = {}] - Default options for commits
476477
*
477478
* @this Branch
@@ -615,19 +616,12 @@
615616
this.context.lineWidth = this.lineWidth;
616617
this.context.strokeStyle = this.color;
617618

618-
var prevLineDash;
619-
if (this.context.setLineDash !== undefined) {
620-
prevLineDash = this.context.getLineDash();
619+
if (typeof this.context.setLineDash === "function") {
621620
this.context.setLineDash(this.lineDash);
622621
}
623622

624623
this.context.stroke();
625624
this.context.closePath();
626-
627-
//Restore previous line dash setting, if any
628-
if (prevLineDash !== undefined) {
629-
this.context.setLineDash(prevLineDash);
630-
}
631625
};
632626

633627
/**
@@ -1059,6 +1053,7 @@
10591053
* @param {number} [options.dotSize = this.template.commit.dot.size] - Dot size
10601054
* @param {number} [options.dotStrokeWidth = this.template.commit.dot.strokeWidth] - Dot stroke width
10611055
* @param {string} [options.dotStrokeColor = this.template.commit.dot.strokeColor]
1056+
* @param {number[]} [options.lineDash = this.template.commit.dot.lineDash]
10621057
*
10631058
* @param {string} [options.message = "He doesn't like George Michael! Boooo!"] - Commit message
10641059
* @param {string} [options.messageColor = options.color] - Specific message color
@@ -1105,6 +1100,7 @@
11051100
this.dotSize = options.dotSize || this.template.commit.dot.size;
11061101
this.dotStrokeWidth = options.dotStrokeWidth || this.template.commit.dot.strokeWidth;
11071102
this.dotStrokeColor = options.dotStrokeColor || this.template.commit.dot.strokeColor || options.color;
1103+
this.lineDash = options.lineDash || this.template.commit.dot.lineDash;
11081104
this.type = options.type || null;
11091105
this.tooltipDisplay = _booleanOptionOr(options.tooltipDisplay, true);
11101106
this.onClick = options.onClick || null;
@@ -1131,7 +1127,6 @@
11311127

11321128
// Label
11331129
if (this.showLabel) {
1134-
11351130
/*
11361131
* For cases where we want a 0 or 180 degree label rotation in horizontal mode,
11371132
* we need to modify the position of the label to sit centrally above the commit dot.
@@ -1171,7 +1166,11 @@
11711166
this.context.strokeStyle = this.dotStrokeColor;
11721167
this.context.lineWidth = this.dotStrokeWidth;
11731168

1174-
if (typeof (this.dotStrokeWidth) === "number") {
1169+
if (typeof this.context.setLineDash === "function") {
1170+
this.context.setLineDash(this.lineDash);
1171+
}
1172+
1173+
if (typeof this.dotStrokeWidth === "number") {
11751174
this.context.stroke();
11761175
}
11771176

@@ -1372,6 +1371,7 @@
13721371
* @param {number} [options.arrow.offset] - Arrow offset
13731372
* @param {string} [options.branch.color] - Branch color
13741373
* @param {number} [options.branch.lineWidth] - Branch line width
1374+
* @param {number[]} [options.branch.lineDash] - Branch line dash segments
13751375
* @param {string} [options.branch.mergeStyle = ("bezier"|"straight")] - Branch merge style
13761376
* @param {number} [options.branch.spacingX] - Space between branches
13771377
* @param {number} [options.branch.spacingY] - Space between branches
@@ -1383,6 +1383,7 @@
13831383
* @param {number} [options.commit.dot.size] - Commit dot size
13841384
* @param {number} [options.commit.dot.strokeWidth] - Commit dot stroke width
13851385
* @param {string} [options.commit.dot.strokeColor] - Commit dot stroke color
1386+
* @param {number[]} [options.commit.dot.lineDash] - Commit dot line dash segments
13861387
* @param {string} [options.commit.message.color] - Commit message color
13871388
* @param {boolean} [options.commit.message.display] - Commit display policy
13881389
* @param {boolean} [options.commit.message.displayAuthor] - Commit message author policy
@@ -1456,6 +1457,7 @@
14561457
this.commit.dot.size = options.commit.dot.size || 3;
14571458
this.commit.dot.strokeWidth = options.commit.dot.strokeWidth || null;
14581459
this.commit.dot.strokeColor = options.commit.dot.strokeColor || null;
1460+
this.commit.dot.lineDash = options.commit.dot.lineDash || this.branch.lineDash;
14591461

14601462
this.commit.tag = {};
14611463
this.commit.tag.color = options.commit.tag.color || this.commit.dot.color;

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

+50-11
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,45 @@ <h6>Properties</h6>
282282

283283

284284

285+
<tr>
286+
287+
<td class="name"><code>lineDash</code></td>
288+
289+
290+
<td class="type">
291+
292+
293+
<span class="param-type">Array.&lt;number></span>
294+
295+
296+
297+
</td>
298+
299+
300+
<td class="attributes">
301+
302+
&lt;optional><br>
303+
304+
305+
306+
307+
308+
</td>
309+
310+
311+
312+
<td class="default">
313+
314+
this.template.branch.lineDash
315+
316+
</td>
317+
318+
319+
<td class="description last"><p>Branch line dash segments</p></td>
320+
</tr>
321+
322+
323+
285324
<tr>
286325

287326
<td class="name"><code>commitDefaultOptions</code></td>
@@ -364,7 +403,7 @@ <h6>Properties</h6>
364403

365404
<dt class="tag-source">Source:</dt>
366405
<dd class="tag-source"><ul class="dummy"><li>
367-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line469">line 469</a>
406+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line470">line 470</a>
368407
</li></ul></dd>
369408

370409

@@ -519,7 +558,7 @@ <h5>Parameters:</h5>
519558

520559
<dt class="tag-source">Source:</dt>
521560
<dd class="tag-source"><ul class="dummy"><li>
522-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line559">line 559</a>
561+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line560">line 560</a>
523562
</li></ul></dd>
524563

525564

@@ -633,7 +672,7 @@ <h5>This:</h5>
633672

634673
<dt class="tag-source">Source:</dt>
635674
<dd class="tag-source"><ul class="dummy"><li>
636-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line971">line 971</a>
675+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line965">line 965</a>
637676
</li></ul></dd>
638677

639678

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

719758
<dt class="tag-source">Source:</dt>
720759
<dd class="tag-source"><ul class="dummy"><li>
721-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line849">line 849</a>
760+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line843">line 843</a>
722761
</li></ul></dd>
723762

724763

@@ -928,7 +967,7 @@ <h6>Properties</h6>
928967

929968
<dt class="tag-source">Source:</dt>
930969
<dd class="tag-source"><ul class="dummy"><li>
931-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line671">line 671</a>
970+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line665">line 665</a>
932971
</li></ul></dd>
933972

934973

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

10211060
<dt class="tag-source">Source:</dt>
10221061
<dd class="tag-source"><ul class="dummy"><li>
1023-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line858">line 858</a>
1062+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line852">line 852</a>
10241063
</li></ul></dd>
10251064

10261065

@@ -1283,7 +1322,7 @@ <h6>Properties</h6>
12831322

12841323
<dt class="tag-source">Source:</dt>
12851324
<dd class="tag-source"><ul class="dummy"><li>
1286-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line874">line 874</a>
1325+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line868">line 868</a>
12871326
</li></ul></dd>
12881327

12891328

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

13991438
<dt class="tag-source">Source:</dt>
14001439
<dd class="tag-source"><ul class="dummy"><li>
1401-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line996">line 996</a>
1440+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line990">line 990</a>
14021441
</li></ul></dd>
14031442

14041443

@@ -1483,7 +1522,7 @@ <h5>This:</h5>
14831522

14841523
<dt class="tag-source">Source:</dt>
14851524
<dd class="tag-source"><ul class="dummy"><li>
1486-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line584">line 584</a>
1525+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line585">line 585</a>
14871526
</li></ul></dd>
14881527

14891528

@@ -1792,7 +1831,7 @@ <h6>Properties</h6>
17921831

17931832
<dt class="tag-source">Source:</dt>
17941833
<dd class="tag-source"><ul class="dummy"><li>
1795-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line825">line 825</a>
1834+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line819">line 819</a>
17961835
</li></ul></dd>
17971836

17981837

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

18491888
<footer>
1850-
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)
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)
18511890
</footer>
18521891

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

docs/Commit.html

+43-4
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,45 @@ <h6>Properties</h6>
841841

842842

843843

844+
<tr>
845+
846+
<td class="name"><code>lineDash</code></td>
847+
848+
849+
<td class="type">
850+
851+
852+
<span class="param-type">Array.&lt;number></span>
853+
854+
855+
856+
</td>
857+
858+
859+
<td class="attributes">
860+
861+
&lt;optional><br>
862+
863+
864+
865+
866+
867+
</td>
868+
869+
870+
871+
<td class="default">
872+
873+
this.template.commit.dot.lineDash
874+
875+
</td>
876+
877+
878+
<td class="description last"></td>
879+
</tr>
880+
881+
882+
844883
<tr>
845884

846885
<td class="name"><code>message</code></td>
@@ -1348,7 +1387,7 @@ <h6>Properties</h6>
13481387

13491388
<dt class="tag-source">Source:</dt>
13501389
<dd class="tag-source"><ul class="dummy"><li>
1351-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1070">line 1070</a>
1390+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1065">line 1065</a>
13521391
</li></ul></dd>
13531392

13541393

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

14521491
<dt class="tag-source">Source:</dt>
14531492
<dd class="tag-source"><ul class="dummy"><li>
1454-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1226">line 1226</a>
1493+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1225">line 1225</a>
14551494
</li></ul></dd>
14561495

14571496

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

15371576
<dt class="tag-source">Source:</dt>
15381577
<dd class="tag-source"><ul class="dummy"><li>
1539-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1118">line 1118</a>
1578+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1114">line 1114</a>
15401579
</li></ul></dd>
15411580

15421581

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

15861625
<footer>
1587-
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)
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)
15881627
</footer>
15891628

15901629
<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 Wed Apr 19 2017 08:51:54 GMT+0200 (CEST)
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)
20652065
</footer>
20662066

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

0 commit comments

Comments
 (0)