From f2e06bc05fd85eb9c25dcd49817e776f8d28fde8 Mon Sep 17 00:00:00 2001 From: Nicolas Carlo Date: Tue, 10 Jan 2017 08:08:47 +0100 Subject: [PATCH 1/2] Drop weird tag anti-collision system for now It looks weird: https://github.com/nicoespeon/gitgraph.js/issues/132 So far, there is no real need for anti-collision. Will find a clever algorithm when this will be necessary to people. --- src/gitgraph.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gitgraph.js b/src/gitgraph.js index f079d54b..e68d7641 100644 --- a/src/gitgraph.js +++ b/src/gitgraph.js @@ -297,8 +297,6 @@ branch.render(); } - this.tagNum = 0; - // Render commits after to put them on the foreground for (var j = 0, commit; !!(commit = this.commits[j]); j++) { commit.render(); @@ -1286,15 +1284,14 @@ var textWidth = commit.context.measureText(commit.tag).width; this.width = Math.max(commit.template.commit.tag.spacingX, textWidth); - commit.parent.tagNum++; - var x = 0; var y = 0; + var tagColumn = (commit.parent.columnMax + 1); if (_isHorizontal(commit.parent)) { x = commit.x - commit.dotSize / 2; - y = ((commit.parent.columnMax + 1) * commit.template.commit.tag.spacingY) - commit.template.commit.tag.spacingY / 2 + (commit.parent.tagNum % 2) * _getFontHeight(this.font) * 1.5; + y = (tagColumn * commit.template.commit.tag.spacingY) - commit.template.commit.tag.spacingY / 2; } else { - x = ((commit.parent.columnMax + 1) * commit.template.commit.tag.spacingX) - commit.template.commit.tag.spacingX / 2 + textWidth / 2; + x = (tagColumn * commit.template.commit.tag.spacingX) - commit.template.commit.tag.spacingX / 2 + textWidth / 2; y = commit.y - commit.dotSize / 2; } From 16422a8e7c7743bf2be2d77be38c8a36248fdcfb Mon Sep 17 00:00:00 2001 From: Nicolas Carlo Date: Tue, 10 Jan 2017 08:09:23 +0100 Subject: [PATCH 2/2] Bump version and compile --- bower.json | 2 +- build/gitgraph.js | 11 ++++------- build/gitgraph.min.js | 4 ++-- docs/Branch.html | 22 +++++++++++----------- docs/Commit.html | 8 ++++---- docs/GitGraph.html | 8 ++++---- docs/Tag.html | 4 ++-- docs/Template.html | 6 +++--- docs/gitgraph.js.html | 11 ++++------- docs/global.html | 32 ++++++++++++++++---------------- docs/index.html | 2 +- package.json | 2 +- 12 files changed, 53 insertions(+), 59 deletions(-) diff --git a/bower.json b/bower.json index 06dd5fe1..f8606d1f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "gitgraph.js", - "version": "1.8.2", + "version": "1.8.3", "main": ["./build/gitgraph.js", "./build/gitgraph.css"], "ignore": [ "**/.*" diff --git a/build/gitgraph.js b/build/gitgraph.js index 4a347b2f..33a246f2 100644 --- a/build/gitgraph.js +++ b/build/gitgraph.js @@ -1,5 +1,5 @@ /* ========================================================== - * GitGraph v1.8.2 + * GitGraph v1.8.3 * https://github.com/nicoespeon/gitgraph.js * ========================================================== * Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶ @@ -307,8 +307,6 @@ branch.render(); } - this.tagNum = 0; - // Render commits after to put them on the foreground for (var j = 0, commit; !!(commit = this.commits[j]); j++) { commit.render(); @@ -1296,15 +1294,14 @@ var textWidth = commit.context.measureText(commit.tag).width; this.width = Math.max(commit.template.commit.tag.spacingX, textWidth); - commit.parent.tagNum++; - var x = 0; var y = 0; + var tagColumn = (commit.parent.columnMax + 1); if (_isHorizontal(commit.parent)) { x = commit.x - commit.dotSize / 2; - y = ((commit.parent.columnMax + 1) * commit.template.commit.tag.spacingY) - commit.template.commit.tag.spacingY / 2 + (commit.parent.tagNum % 2) * _getFontHeight(this.font) * 1.5; + y = (tagColumn * commit.template.commit.tag.spacingY) - commit.template.commit.tag.spacingY / 2; } else { - x = ((commit.parent.columnMax + 1) * commit.template.commit.tag.spacingX) - commit.template.commit.tag.spacingX / 2 + textWidth / 2; + x = (tagColumn * commit.template.commit.tag.spacingX) - commit.template.commit.tag.spacingX / 2 + textWidth / 2; y = commit.y - commit.dotSize / 2; } diff --git a/build/gitgraph.min.js b/build/gitgraph.min.js index 5b91cd8c..d3aa46cb 100644 --- a/build/gitgraph.min.js +++ b/build/gitgraph.min.js @@ -1,5 +1,5 @@ /* ========================================================== - * GitGraph v1.8.2 + * GitGraph v1.8.3 * https://github.com/nicoespeon/gitgraph.js * ========================================================== * Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶ @@ -7,4 +7,4 @@ * * GitGraph.js may be freely distributed under the MIT Licence * ========================================================== */ -!function(){"use strict";function a(a){switch(a=q(a)?a:{},this.elementId="string"==typeof a.elementId?a.elementId:"gitGraph",this.author="string"==typeof a.author?a.author:"Sergio Flores ",this.reverseArrow=k(a.reverseArrow,!1),this.template="string"==typeof a.template||q(a.template)?this.newTemplate(a.template):a.template instanceof e?a.template:this.newTemplate("metro"),this.mode=a.mode||null,"compact"===this.mode&&(this.template.commit.message.display=!1),a.orientation){case"vertical-reverse":this.template.commit.spacingY*=-1,this.orientation="vertical-reverse",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?0:a.template.branch.labelRotation,this.template.commit.tag.spacingY*=-1;break;case"horizontal":this.template.commit.message.display=!1,this.template.commit.spacingX=this.template.commit.spacingY,this.template.branch.spacingY=this.template.branch.spacingX,this.template.commit.spacingY=0,this.template.branch.spacingX=0,this.orientation="horizontal",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?-90:a.template.branch.labelRotation,this.template.commit.tag.spacingX=-this.template.commit.spacingX,this.template.commit.tag.spacingY=this.template.branch.spacingY;break;case"horizontal-reverse":this.template.commit.message.display=!1,this.template.commit.spacingX=-this.template.commit.spacingY,this.template.branch.spacingY=this.template.branch.spacingX,this.template.commit.spacingY=0,this.template.branch.spacingX=0,this.orientation="horizontal-reverse",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?90:a.template.branch.labelRotation,this.template.commit.tag.spacingX=-this.template.commit.spacingY,this.template.commit.tag.spacingY=this.template.branch.spacingY;break;default:this.orientation="vertical",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?0:a.template.branch.labelRotation}this.marginX=this.template.branch.spacingX+2*this.template.commit.dot.size,this.marginY=this.template.branch.spacingY+2*this.template.commit.dot.size,this.offsetX=0,this.offsetY=0,this.canvas=document.getElementById(this.elementId)||a.canvas,this.context=this.canvas.getContext("2d"),this.context.textBaseline="center",this.tooltip=document.createElement("div"),this.tooltip.className="gitgraph-tooltip",this.tooltip.style.position="fixed",this.tooltip.style.display="none",document.body.appendChild(this.tooltip),this.HEAD=null,this.branches=[],this.commits=[],this.columnMax=0,this.commitOffsetX=a.initCommitOffsetX||0,this.commitOffsetY=a.initCommitOffsetY||0,this.mouseMoveOptions={handleEvent:this.hover,gitgraph:this},this.canvas.addEventListener("mousemove",this.mouseMoveOptions,!1),this.mouseDownOptions={handleEvent:this.click,gitgraph:this},this.canvas.addEventListener("mousedown",this.mouseDownOptions,!1),window.onresize=this.render.bind(this)}function b(b){if(b.parent instanceof a!=!1){if(b=q(b)?b:{},this.parent=b.parent,b.parentCommit&&b.parentBranch){if(b.parentCommit.branch!==b.parentBranch)return;this.parentCommit=b.parentCommit,this.parentBranch=b.parentBranch}else b.parentCommit?(this.parentCommit=b.parentCommit,this.parentBranch=b.parentCommit.branch):b.parentBranch?(this.parentCommit=h(b.parentBranch),this.parentBranch=b.parentBranch):(this.parentCommit=null,this.parentBranch=null);this.name="string"==typeof b.name?b.name:"no-name",this.commitDefaultOptions=q(b.commitDefaultOptions)?b.commitDefaultOptions:{},this.context=this.parent.context,this.template=this.parent.template,this.lineWidth=b.lineWidth||this.template.branch.lineWidth,this.lineDash=b.lineDash||this.template.branch.lineDash,this.showLabel=k(b.showLabel,this.template.branch.showLabel),this.spacingX=this.template.branch.spacingX,this.spacingY=this.template.branch.spacingY,this.size=0,this.height=0,this.width=0,this.commits=[],this.path=[],"number"==typeof b.column?this.column=b.column:(this.column=0,this.calculColumn()),this.parent.columnMax=this.column>this.parent.columnMax?this.column:this.parent.columnMax,this.offsetX=this.column*this.spacingX,this.offsetY=this.column*this.spacingY,this.startPoint=this.parentBranch&&this.parentCommit?this.parentCommit===h(this.parentBranch)&&this.commits.length>0?{x:this.parentBranch.offsetX-this.parent.commitOffsetX+this.template.commit.spacingX,y:this.parentBranch.offsetY-this.parent.commitOffsetY+this.template.commit.spacingY,type:"start"}:{x:this.parentCommit.x,y:this.parentCommit.y,type:"start"}:null;var c=this.column%this.template.colors.length;this.color=b.color||this.template.branch.color||this.template.colors[c],this.checkout()}}function c(b){b.parent instanceof a!=!1&&(b=q(b)?b:{},this.parent=b.parent,this.template=this.parent.template,this.context=this.parent.context,this.branch=b.branch,this.author=b.author||this.parent.author,this.date=b.date||(new Date).toUTCString(),this.detail=b.detail||null,this.sha1=b.sha1||Math.random(100).toString(16).substring(3,10),this.message=b.message||"He doesn't like George Michael! Boooo!",this.arrowDisplay=b.arrowDisplay,this.messageDisplay=k(b.messageDisplay,this.template.commit.message.display),this.messageAuthorDisplay=k(b.messageAuthorDisplay,this.template.commit.message.displayAuthor),this.messageBranchDisplay=k(b.messageBranchDisplay,this.template.commit.message.displayBranch),this.messageHashDisplay=k(b.messageHashDisplay,this.template.commit.message.displayHash),this.messageColor=b.messageColor||b.color,this.messageFont=b.messageFont||this.template.commit.message.font,this.dotColor=b.dotColor||b.color,this.dotSize=b.dotSize||this.template.commit.dot.size,this.dotStrokeWidth=b.dotStrokeWidth||this.template.commit.dot.strokeWidth,this.dotStrokeColor=b.dotStrokeColor||this.template.commit.dot.strokeColor||b.color,this.type=b.type||null,this.tooltipDisplay=k(b.tooltipDisplay,!0),this.onClick=b.onClick||null,this.representedObject=b.representedObject||null,this.parentCommit=b.parentCommit,this.x=b.x,this.y=b.y,this.showLabel=b.showLabel,this.labelColor=b.labelColor||b.color,this.labelFont=b.labelFont||this.template.branch.labelFont,g(this,b),this.parent.commits.push(this))}function d(a,b){if(!q(a))throw new Error("You can't tag a commit that doesn't exist");b=q(b)?b:{},this.color=b.color||a.color,this.font=b.font||a.template.commit.tag.font;var c=a.context.font;a.context.font=this.font;var d=a.context.measureText(a.tag).width;this.width=Math.max(a.template.commit.tag.spacingX,d),a.parent.tagNum++;var e=0,f=0;return p(a.parent)?(e=a.x-a.dotSize/2,f=(a.parent.columnMax+1)*a.template.commit.tag.spacingY-a.template.commit.tag.spacingY/2+a.parent.tagNum%2*j(this.font)*1.5):(e=(a.parent.columnMax+1)*a.template.commit.tag.spacingX-a.template.commit.tag.spacingX/2+d/2,f=a.y-a.dotSize/2),l(a.context,e,f,a.tag,this.color,this.font,0,a.displayTagBox),a.context.font=c,this}function e(a){a=q(a)?a:{},a.branch=a.branch||{},a.arrow=a.arrow||{},a.commit=a.commit||{},a.commit.dot=a.commit.dot||{},a.commit.tag=a.commit.tag||{},a.commit.message=a.commit.message||{},this.colors=a.colors||["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],this.branch={},this.branch.color=a.branch.color||null,this.branch.lineWidth=a.branch.lineWidth||2,this.branch.lineDash=a.branch.lineDash||[],this.branch.showLabel=a.branch.showLabel||!1,this.branch.labelColor=a.branch.labelColor||null,this.branch.labelFont=a.branch.labelFont||"normal 8pt Calibri",this.branch.labelRotation=void 0!==a.branch.labelRotation?a.branch.labelRotation:null,this.branch.mergeStyle=a.branch.mergeStyle||"bezier",this.branch.spacingX="number"==typeof a.branch.spacingX?a.branch.spacingX:20,this.branch.spacingY=a.branch.spacingY||0,this.arrow={},this.arrow.size=a.arrow.size||null,this.arrow.color=a.arrow.color||null,this.arrow.active="number"==typeof this.arrow.size,this.arrow.offset=a.arrow.offset||2,this.commit={},this.commit.spacingX=a.commit.spacingX||0,this.commit.spacingY="number"==typeof a.commit.spacingY?a.commit.spacingY:25,this.commit.widthExtension="number"==typeof a.commit.widthExtension?a.commit.widthExtension:0,this.commit.tooltipHTMLFormatter=a.commit.tooltipHTMLFormatter||null,this.commit.shouldDisplayTooltipsInCompactMode=k(a.commit.shouldDisplayTooltipsInCompactMode,!0),this.commit.color=a.commit.color||null,this.commit.dot={},this.commit.dot.color=a.commit.dot.color||null,this.commit.dot.size=a.commit.dot.size||3,this.commit.dot.strokeWidth=a.commit.dot.strokeWidth||null,this.commit.dot.strokeColor=a.commit.dot.strokeColor||null,this.commit.tag={},this.commit.tag.color=a.commit.tag.color||this.commit.dot.color,this.commit.tag.font=a.commit.tag.font||a.commit.message.font||"normal 10pt Calibri",this.commit.tag.spacingX=this.branch.spacingX,this.commit.tag.spacingY=this.commit.spacingY,this.commit.message={},this.commit.message.display=k(a.commit.message.display,!0),this.commit.message.displayAuthor=k(a.commit.message.displayAuthor,!0),this.commit.message.displayBranch=k(a.commit.message.displayBranch,!0),this.commit.message.displayHash=k(a.commit.message.displayHash,!0),this.commit.message.color=a.commit.message.color||null,this.commit.message.font=a.commit.message.font||"normal 12pt Calibri"}function f(a){return a.slice(-1)[0]}function g(a,b){a.tag=b.tag||null,a.tagColor=b.tagColor||a.messageColor,a.tagFont=b.tagFont||a.template.commit.tag.font,a.displayTagBox=k(b.displayTagBox,!0)}function h(a){return f(a.commits)?f(a.commits):a.parentBranch?h(a.parentBranch):null}function i(a){return JSON.parse(JSON.stringify(a))}function j(a){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d=document.createTextNode("Mg");c.appendChild(d),c.setAttribute("style","font: "+a+";"),b.appendChild(c);var e=c.offsetHeight;return b.removeChild(c),e}function k(a,b){return"boolean"==typeof a?a:b}function l(a,b,c,d,e,f,g,h){a.save(),a.translate(b,c),a.rotate(g*(Math.PI/180)),a.textAlign="center",a.font=f;var i=a.measureText(d).width,k=j(f);h?(a.beginPath(),a.rect(-(i/2)-4,-(k/2)+2,i+8,k+2),a.fillStyle=e,a.fill(),a.lineWidth=2,a.strokeStyle="black",a.stroke(),a.fillStyle="black"):a.fillStyle=e,a.fillText(d,0,k/2),a.restore()}function m(a,b,c){var d;document.createEvent?(d=document.createEvent("HTMLEvents"),d.initEvent(b,!0,!0)):(d=document.createEventObject(),d.eventType=b),d.eventName=b,d.data=c||{},document.createEvent?a.dispatchEvent(d):a.fireEvent("on"+d.eventType,d)}function n(a){var b,c;return c=1,window.devicePixelRatio&&(b=a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1,c*=window.devicePixelRatio/b),c}function o(a){return"vertical"===a.orientation||"vertical-reverse"===a.orientation}function p(a){return"horizontal"===a.orientation||"horizontal-reverse"===a.orientation}function q(a){return"object"==typeof a}function r(a,b){return!b.split(".").every(function(b){return"object"==typeof a&&null!==a&&b in a?(a=a[b],!0):!1})}a.prototype.dispose=function(){this.canvas.removeEventListener("mousemove",this.mouseMoveOptions,!1),this.canvas.removeEventListener("mousedown",this.mouseDownOptions,!1)},a.prototype.branch=function(a){if("string"==typeof a){var c=a;a={},a.name=c}a=q(a)?a:{},a.parent=this,a.parentBranch=a.parentBranch||this.HEAD;var d=new b(a);return this.branches.push(d),d},a.prototype.orphanBranch=function(a){if("string"==typeof a){var c=a;a={},a.name=c}a=q(a)?a:{},a.parent=this;var d=new b(a);return this.branches.push(d),d},a.prototype.commit=function(a){return this.HEAD.commit(a),this},a.prototype.tag=function(a){return this.HEAD.tag(a),this},a.prototype.newTemplate=function(a){return"string"==typeof a?(new e).get(a):new e(a)},a.prototype.render=function(){this.scalingFactor=n(this.context);var a={x:Math.abs((this.columnMax+1)*this.template.branch.spacingX)+Math.abs(this.commitOffsetX)+2*this.marginX,y:Math.abs((this.columnMax+1)*this.template.branch.spacingY)+Math.abs(this.commitOffsetY)+2*this.marginY};this.template.commit.message.display&&(a.x+=800),a.x+=this.template.commit.widthExtension,this.canvas.style.width=a.x+"px",this.canvas.style.height=a.y+"px",this.canvas.width=a.x*this.scalingFactor,this.canvas.height=a.y*this.scalingFactor,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.translate(this.marginX,this.marginY),this.template.commit.spacingY>0&&(this.context.translate(0,this.canvas.height-2*this.marginY),this.offsetY=this.canvas.height-2*this.marginY),this.template.commit.spacingX>0&&(this.context.translate(this.canvas.width-2*this.marginX,0),this.offsetX=this.canvas.width-2*this.marginX),this.context.scale(this.scalingFactor,this.scalingFactor);for(var b,c=this.branches.length-1;b=this.branches[c];c--)b.render();this.tagNum=0;for(var d,e=0;d=this.commits[e];e++)d.render();m(this.canvas,"graph:render",{id:this.elementId})},a.prototype.applyCommits=function(a,b){function c(a){var b=document.getElementById(a),c=b.getBoundingClientRect();return{top:c.top+document.body.scrollTop,left:c.left+document.body.scrollLeft}}for(var d,e=a.offsetX||a.pageX-c(this.elementId).left,f=a.offsetY||a.pageY-c(this.elementId).top,g=0;d=this.commits[g];g++){var h=d.x+(this.offsetX+this.marginX)/this.scalingFactor-e,i=d.y+(this.offsetY+this.marginY)/this.scalingFactor-f,j=Math.sqrt(Math.pow(h,2)+Math.pow(i,2)),k=j0){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"});var r=i(this.startPoint);r.type="join",this.parentBranch.pushPath(r)}}else n&&(q.type="start");return this.pushPath(q),this.parent.commitOffsetX+=this.template.commit.spacingX*(a.showLabel?2:1),this.parent.commitOffsetY+=this.template.commit.spacingY*(a.showLabel?2:1),null!==p.detail&&o(this.parent)&&(p.detail.style.display="block","vertical-reverse"===this.parent.orientation?this.parent.commitOffsetY+=p.detail.clientHeight:this.parent.commitOffsetY-=p.detail.clientHeight),this.parent.render(),this},b.prototype.tag=function(a){"string"==typeof a&&(a={tag:a}),a=q(a)?a:{};var b=f(this.commits);return q(b)&&(g(b,a),this.parent.render()),this},b.prototype.checkout=function(){this.parent.HEAD=this},b.prototype.delete=function(){this.isDeleted=!0},b.prototype.merge=function(a,c){var d=a||this.parent.HEAD;if(d instanceof b==!1||d===this)return this;var e=this.commits[0];if(!e)return console.log(this.name+" is already up-to-date with "+d.name),this;var g="Merge branch `"+this.name+"` into `"+d.name+"`";if("object"!=typeof c){var j=c;c={},c.message="string"==typeof j?j:g}else c.message=c.message||g;c.type="mergeCommit",c.parentCommit=h(this);var k=e.parentCommit,l=h(d),m=k&&k.sha1===l.sha1;if(c.fastForward&&m){var n=p(this.parent);if(this.color=d.color,n){var o=d.path[1].y;this.path.forEach(function(a){a.y=o})}else{var q=d.path[1].x;this.path.forEach(function(a){a.x=q})}this.commits.forEach(function(a){n?a.y=k.y:a.x=k.x,a.labelColor=k.labelColor,a.messageColor=k.messageColor,a.dotColor=k.dotColor,a.dotStrokeColor=k.dotStrokeColor})}else{d.commit(c);var r=f(d.commits),s={x:this.offsetX+this.template.commit.spacingX*(r.showLabel?3:2)-this.parent.commitOffsetX,y:this.offsetY+this.template.commit.spacingY*(r.showLabel?3:2)-this.parent.commitOffsetY,type:"join"};this.pushPath(i(s));var t={x:r.x,y:r.y,type:"end"};this.pushPath(t),s.type="start",this.pushPath(s)}return this.parent.render(),this.parent.HEAD=d,this},b.prototype.calculColumn=function(){for(var a,b=[],c=0;a=this.parent.branches[c];c++)a.isDeleted||(a.column in b||(b[a.column]=0),b[a.column]++);for(this.column=0;this.column in b&&0!==b[this.column];this.column++);},b.prototype.pushPath=function(a){var b=f(this.path);b?b.x===a.x&&b.y===a.y?"start"!==b.type&&"end"===a.type?b.type="end":"join"===a.type||this.path.push(a):"join"===a.type?(a.x-b.x)*this.template.commit.spacingX<0?this.path.push(a):(a.y-b.y)*this.template.commit.spacingY<0&&this.path.push(a):this.path.push(a):this.path.push(a)},c.prototype.render=function(){var a=this.template.commit.tag.spacingX,b=(this.parent.columnMax+1)*this.template.branch.spacingX+a;if(this.showLabel)if(p(this.parent)&&this.template.branch.labelRotation%180===0){var e=this.y-this.dotSize-j(this.labelFont);l(this.context,this.x,e,this.branch.name,this.labelColor,this.labelFont,this.template.branch.labelRotation,!0)}else l(this.context,this.x+this.template.commit.spacingX,this.y+this.template.commit.spacingY,this.branch.name,this.labelColor,this.labelFont,this.template.branch.labelRotation,!0);if(this.context.beginPath(),this.context.arc(this.x,this.y,this.dotSize,0,2*Math.PI,!1),this.context.fillStyle=this.dotColor,this.context.strokeStyle=this.dotStrokeColor,this.context.lineWidth=this.dotStrokeWidth,"number"==typeof this.dotStrokeWidth&&this.context.stroke(),this.context.fill(),this.context.closePath(),this.arrowDisplay&&this.parentCommit instanceof c&&this.arrow(),null!==this.tag){var f=new d(this,{color:this.tagColor,font:this.tagFont});b+=f.width-a}if(null!==this.detail&&o(this.parent)){this.detail.width=30,this.detail.style.left=this.parent.canvas.offsetLeft+b+this.x+this.detail.width+"px";var g=this.parent.canvas.offsetTop+this.y,h=30;if("vertical-reverse"===this.parent.orientation){var i=this.parent.canvas.clientHeight-this.detail.clientHeight;this.detail.style.top=g+i-h+"px"}else this.detail.style.top=g+h+"px"}if(this.messageDisplay){var k=this.message;this.messageHashDisplay&&(k=this.sha1+" "+k),this.messageAuthorDisplay&&(k+=this.author?" - "+this.author:""),this.messageBranchDisplay&&(k=(this.branch.name?"["+this.branch.name+"] ":"")+k),this.context.font=this.messageFont,this.context.fillStyle=this.messageColor,this.context.fillText(k,b,this.y+this.dotSize/2)}},c.prototype.arrow=function(){function a(a,b){var c=d?-1:1;return Math.atan2(c*a,c*b)}var b=this.template.arrow.size,c=this.template.arrow.color||this.branch.color,d=this.parent.reverseArrow,e=a(this.parentCommit.y-this.y,this.parentCommit.x-this.x),f=this===this.branch.commits[0];if("mergeCommit"===this.type||f){var g=this.parentCommit.branch.column-this.branch.column,h=this.showLabel?2:1,i=this.template.branch.spacingX*g+this.template.commit.spacingX*h,j=(f||d)&&Math.abs(this.y-this.parentCommit.y)>Math.abs(this.template.commit.spacingY),k=this.x===this.parentCommit.x;o(this.parent)&&(j||k)&&(i=0);var l=this.template.branch.spacingY*g+this.template.commit.spacingY*h,m=(f||d)&&Math.abs(this.x-this.parentCommit.x)>Math.abs(this.template.commit.spacingX),n=this.y===this.parentCommit.y;p(this.parent)&&(m||n)&&(l=0),e=a(l,i),c=this.parentCommit.branch.color}var q=Math.PI/7,r=d?this.parentCommit.x:this.x,s=d?this.parentCommit.y:this.y,t=this.template.commit.dot.size+this.template.arrow.offset,u=t*Math.cos(e)+r,v=t*Math.sin(e)+s,w=(t+b)*Math.cos(e-q)+r,x=(t+b)*Math.sin(e-q)+s,y=(t+b/2)*Math.cos(e)+r,z=(t+b/2)*Math.sin(e)+s,A=(t+b)*Math.cos(e+q)+r,B=(t+b)*Math.sin(e+q)+s;this.context.beginPath(),this.context.fillStyle=c,this.context.moveTo(u,v),this.context.lineTo(w,x),this.context.quadraticCurveTo(y,z,A,B),this.context.lineTo(A,B),this.context.fill()},e.prototype.get=function(a){var b={};switch(a){case"blackarrow":b={branch:{color:"#000000",lineWidth:4,spacingX:50,mergeStyle:"straight",labelRotation:0},commit:{spacingY:-60,dot:{size:12,strokeColor:"#000000",strokeWidth:7},message:{color:"black"}},arrow:{size:16,offset:2.5}};break;case"metro":default:b={colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacingX:50,labelRotation:0},commit:{spacingY:-80,dot:{size:14},message:{font:"normal 14pt Arial"}}}}return new e(b)},Array.prototype.every||(Array.prototype.every=function(a,b){var c,d;if(null===this)throw new TypeError("this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError;for(arguments.length>1&&(c=b),d=0;f>d;){var g;if(d in e){g=e[d];var h=a.call(c,g,d,e);if(!h)return!1}d++}return!0}),window.GitGraph=a,window.GitGraph.Branch=b,window.GitGraph.Commit=c,window.GitGraph.Template=e}(); \ No newline at end of file +!function(){"use strict";function a(a){switch(a=q(a)?a:{},this.elementId="string"==typeof a.elementId?a.elementId:"gitGraph",this.author="string"==typeof a.author?a.author:"Sergio Flores ",this.reverseArrow=k(a.reverseArrow,!1),this.template="string"==typeof a.template||q(a.template)?this.newTemplate(a.template):a.template instanceof e?a.template:this.newTemplate("metro"),this.mode=a.mode||null,"compact"===this.mode&&(this.template.commit.message.display=!1),a.orientation){case"vertical-reverse":this.template.commit.spacingY*=-1,this.orientation="vertical-reverse",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?0:a.template.branch.labelRotation,this.template.commit.tag.spacingY*=-1;break;case"horizontal":this.template.commit.message.display=!1,this.template.commit.spacingX=this.template.commit.spacingY,this.template.branch.spacingY=this.template.branch.spacingX,this.template.commit.spacingY=0,this.template.branch.spacingX=0,this.orientation="horizontal",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?-90:a.template.branch.labelRotation,this.template.commit.tag.spacingX=-this.template.commit.spacingX,this.template.commit.tag.spacingY=this.template.branch.spacingY;break;case"horizontal-reverse":this.template.commit.message.display=!1,this.template.commit.spacingX=-this.template.commit.spacingY,this.template.branch.spacingY=this.template.branch.spacingX,this.template.commit.spacingY=0,this.template.branch.spacingX=0,this.orientation="horizontal-reverse",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?90:a.template.branch.labelRotation,this.template.commit.tag.spacingX=-this.template.commit.spacingY,this.template.commit.tag.spacingY=this.template.branch.spacingY;break;default:this.orientation="vertical",this.template.branch.labelRotation=r(a,"template.branch.labelRotation")?0:a.template.branch.labelRotation}this.marginX=this.template.branch.spacingX+2*this.template.commit.dot.size,this.marginY=this.template.branch.spacingY+2*this.template.commit.dot.size,this.offsetX=0,this.offsetY=0,this.canvas=document.getElementById(this.elementId)||a.canvas,this.context=this.canvas.getContext("2d"),this.context.textBaseline="center",this.tooltip=document.createElement("div"),this.tooltip.className="gitgraph-tooltip",this.tooltip.style.position="fixed",this.tooltip.style.display="none",document.body.appendChild(this.tooltip),this.HEAD=null,this.branches=[],this.commits=[],this.columnMax=0,this.commitOffsetX=a.initCommitOffsetX||0,this.commitOffsetY=a.initCommitOffsetY||0,this.mouseMoveOptions={handleEvent:this.hover,gitgraph:this},this.canvas.addEventListener("mousemove",this.mouseMoveOptions,!1),this.mouseDownOptions={handleEvent:this.click,gitgraph:this},this.canvas.addEventListener("mousedown",this.mouseDownOptions,!1),window.onresize=this.render.bind(this)}function b(b){if(b.parent instanceof a!=!1){if(b=q(b)?b:{},this.parent=b.parent,b.parentCommit&&b.parentBranch){if(b.parentCommit.branch!==b.parentBranch)return;this.parentCommit=b.parentCommit,this.parentBranch=b.parentBranch}else b.parentCommit?(this.parentCommit=b.parentCommit,this.parentBranch=b.parentCommit.branch):b.parentBranch?(this.parentCommit=h(b.parentBranch),this.parentBranch=b.parentBranch):(this.parentCommit=null,this.parentBranch=null);this.name="string"==typeof b.name?b.name:"no-name",this.commitDefaultOptions=q(b.commitDefaultOptions)?b.commitDefaultOptions:{},this.context=this.parent.context,this.template=this.parent.template,this.lineWidth=b.lineWidth||this.template.branch.lineWidth,this.lineDash=b.lineDash||this.template.branch.lineDash,this.showLabel=k(b.showLabel,this.template.branch.showLabel),this.spacingX=this.template.branch.spacingX,this.spacingY=this.template.branch.spacingY,this.size=0,this.height=0,this.width=0,this.commits=[],this.path=[],"number"==typeof b.column?this.column=b.column:(this.column=0,this.calculColumn()),this.parent.columnMax=this.column>this.parent.columnMax?this.column:this.parent.columnMax,this.offsetX=this.column*this.spacingX,this.offsetY=this.column*this.spacingY,this.startPoint=this.parentBranch&&this.parentCommit?this.parentCommit===h(this.parentBranch)&&this.commits.length>0?{x:this.parentBranch.offsetX-this.parent.commitOffsetX+this.template.commit.spacingX,y:this.parentBranch.offsetY-this.parent.commitOffsetY+this.template.commit.spacingY,type:"start"}:{x:this.parentCommit.x,y:this.parentCommit.y,type:"start"}:null;var c=this.column%this.template.colors.length;this.color=b.color||this.template.branch.color||this.template.colors[c],this.checkout()}}function c(b){b.parent instanceof a!=!1&&(b=q(b)?b:{},this.parent=b.parent,this.template=this.parent.template,this.context=this.parent.context,this.branch=b.branch,this.author=b.author||this.parent.author,this.date=b.date||(new Date).toUTCString(),this.detail=b.detail||null,this.sha1=b.sha1||Math.random(100).toString(16).substring(3,10),this.message=b.message||"He doesn't like George Michael! Boooo!",this.arrowDisplay=b.arrowDisplay,this.messageDisplay=k(b.messageDisplay,this.template.commit.message.display),this.messageAuthorDisplay=k(b.messageAuthorDisplay,this.template.commit.message.displayAuthor),this.messageBranchDisplay=k(b.messageBranchDisplay,this.template.commit.message.displayBranch),this.messageHashDisplay=k(b.messageHashDisplay,this.template.commit.message.displayHash),this.messageColor=b.messageColor||b.color,this.messageFont=b.messageFont||this.template.commit.message.font,this.dotColor=b.dotColor||b.color,this.dotSize=b.dotSize||this.template.commit.dot.size,this.dotStrokeWidth=b.dotStrokeWidth||this.template.commit.dot.strokeWidth,this.dotStrokeColor=b.dotStrokeColor||this.template.commit.dot.strokeColor||b.color,this.type=b.type||null,this.tooltipDisplay=k(b.tooltipDisplay,!0),this.onClick=b.onClick||null,this.representedObject=b.representedObject||null,this.parentCommit=b.parentCommit,this.x=b.x,this.y=b.y,this.showLabel=b.showLabel,this.labelColor=b.labelColor||b.color,this.labelFont=b.labelFont||this.template.branch.labelFont,g(this,b),this.parent.commits.push(this))}function d(a,b){if(!q(a))throw new Error("You can't tag a commit that doesn't exist");b=q(b)?b:{},this.color=b.color||a.color,this.font=b.font||a.template.commit.tag.font;var c=a.context.font;a.context.font=this.font;var d=a.context.measureText(a.tag).width;this.width=Math.max(a.template.commit.tag.spacingX,d);var e=0,f=0,g=a.parent.columnMax+1;return p(a.parent)?(e=a.x-a.dotSize/2,f=g*a.template.commit.tag.spacingY-a.template.commit.tag.spacingY/2):(e=g*a.template.commit.tag.spacingX-a.template.commit.tag.spacingX/2+d/2,f=a.y-a.dotSize/2),l(a.context,e,f,a.tag,this.color,this.font,0,a.displayTagBox),a.context.font=c,this}function e(a){a=q(a)?a:{},a.branch=a.branch||{},a.arrow=a.arrow||{},a.commit=a.commit||{},a.commit.dot=a.commit.dot||{},a.commit.tag=a.commit.tag||{},a.commit.message=a.commit.message||{},this.colors=a.colors||["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],this.branch={},this.branch.color=a.branch.color||null,this.branch.lineWidth=a.branch.lineWidth||2,this.branch.lineDash=a.branch.lineDash||[],this.branch.showLabel=a.branch.showLabel||!1,this.branch.labelColor=a.branch.labelColor||null,this.branch.labelFont=a.branch.labelFont||"normal 8pt Calibri",this.branch.labelRotation=void 0!==a.branch.labelRotation?a.branch.labelRotation:null,this.branch.mergeStyle=a.branch.mergeStyle||"bezier",this.branch.spacingX="number"==typeof a.branch.spacingX?a.branch.spacingX:20,this.branch.spacingY=a.branch.spacingY||0,this.arrow={},this.arrow.size=a.arrow.size||null,this.arrow.color=a.arrow.color||null,this.arrow.active="number"==typeof this.arrow.size,this.arrow.offset=a.arrow.offset||2,this.commit={},this.commit.spacingX=a.commit.spacingX||0,this.commit.spacingY="number"==typeof a.commit.spacingY?a.commit.spacingY:25,this.commit.widthExtension="number"==typeof a.commit.widthExtension?a.commit.widthExtension:0,this.commit.tooltipHTMLFormatter=a.commit.tooltipHTMLFormatter||null,this.commit.shouldDisplayTooltipsInCompactMode=k(a.commit.shouldDisplayTooltipsInCompactMode,!0),this.commit.color=a.commit.color||null,this.commit.dot={},this.commit.dot.color=a.commit.dot.color||null,this.commit.dot.size=a.commit.dot.size||3,this.commit.dot.strokeWidth=a.commit.dot.strokeWidth||null,this.commit.dot.strokeColor=a.commit.dot.strokeColor||null,this.commit.tag={},this.commit.tag.color=a.commit.tag.color||this.commit.dot.color,this.commit.tag.font=a.commit.tag.font||a.commit.message.font||"normal 10pt Calibri",this.commit.tag.spacingX=this.branch.spacingX,this.commit.tag.spacingY=this.commit.spacingY,this.commit.message={},this.commit.message.display=k(a.commit.message.display,!0),this.commit.message.displayAuthor=k(a.commit.message.displayAuthor,!0),this.commit.message.displayBranch=k(a.commit.message.displayBranch,!0),this.commit.message.displayHash=k(a.commit.message.displayHash,!0),this.commit.message.color=a.commit.message.color||null,this.commit.message.font=a.commit.message.font||"normal 12pt Calibri"}function f(a){return a.slice(-1)[0]}function g(a,b){a.tag=b.tag||null,a.tagColor=b.tagColor||a.messageColor,a.tagFont=b.tagFont||a.template.commit.tag.font,a.displayTagBox=k(b.displayTagBox,!0)}function h(a){return f(a.commits)?f(a.commits):a.parentBranch?h(a.parentBranch):null}function i(a){return JSON.parse(JSON.stringify(a))}function j(a){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d=document.createTextNode("Mg");c.appendChild(d),c.setAttribute("style","font: "+a+";"),b.appendChild(c);var e=c.offsetHeight;return b.removeChild(c),e}function k(a,b){return"boolean"==typeof a?a:b}function l(a,b,c,d,e,f,g,h){a.save(),a.translate(b,c),a.rotate(g*(Math.PI/180)),a.textAlign="center",a.font=f;var i=a.measureText(d).width,k=j(f);h?(a.beginPath(),a.rect(-(i/2)-4,-(k/2)+2,i+8,k+2),a.fillStyle=e,a.fill(),a.lineWidth=2,a.strokeStyle="black",a.stroke(),a.fillStyle="black"):a.fillStyle=e,a.fillText(d,0,k/2),a.restore()}function m(a,b,c){var d;document.createEvent?(d=document.createEvent("HTMLEvents"),d.initEvent(b,!0,!0)):(d=document.createEventObject(),d.eventType=b),d.eventName=b,d.data=c||{},document.createEvent?a.dispatchEvent(d):a.fireEvent("on"+d.eventType,d)}function n(a){var b,c;return c=1,window.devicePixelRatio&&(b=a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1,c*=window.devicePixelRatio/b),c}function o(a){return"vertical"===a.orientation||"vertical-reverse"===a.orientation}function p(a){return"horizontal"===a.orientation||"horizontal-reverse"===a.orientation}function q(a){return"object"==typeof a}function r(a,b){return!b.split(".").every(function(b){return"object"==typeof a&&null!==a&&b in a?(a=a[b],!0):!1})}a.prototype.dispose=function(){this.canvas.removeEventListener("mousemove",this.mouseMoveOptions,!1),this.canvas.removeEventListener("mousedown",this.mouseDownOptions,!1)},a.prototype.branch=function(a){if("string"==typeof a){var c=a;a={},a.name=c}a=q(a)?a:{},a.parent=this,a.parentBranch=a.parentBranch||this.HEAD;var d=new b(a);return this.branches.push(d),d},a.prototype.orphanBranch=function(a){if("string"==typeof a){var c=a;a={},a.name=c}a=q(a)?a:{},a.parent=this;var d=new b(a);return this.branches.push(d),d},a.prototype.commit=function(a){return this.HEAD.commit(a),this},a.prototype.tag=function(a){return this.HEAD.tag(a),this},a.prototype.newTemplate=function(a){return"string"==typeof a?(new e).get(a):new e(a)},a.prototype.render=function(){this.scalingFactor=n(this.context);var a={x:Math.abs((this.columnMax+1)*this.template.branch.spacingX)+Math.abs(this.commitOffsetX)+2*this.marginX,y:Math.abs((this.columnMax+1)*this.template.branch.spacingY)+Math.abs(this.commitOffsetY)+2*this.marginY};this.template.commit.message.display&&(a.x+=800),a.x+=this.template.commit.widthExtension,this.canvas.style.width=a.x+"px",this.canvas.style.height=a.y+"px",this.canvas.width=a.x*this.scalingFactor,this.canvas.height=a.y*this.scalingFactor,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.translate(this.marginX,this.marginY),this.template.commit.spacingY>0&&(this.context.translate(0,this.canvas.height-2*this.marginY),this.offsetY=this.canvas.height-2*this.marginY),this.template.commit.spacingX>0&&(this.context.translate(this.canvas.width-2*this.marginX,0),this.offsetX=this.canvas.width-2*this.marginX),this.context.scale(this.scalingFactor,this.scalingFactor);for(var b,c=this.branches.length-1;b=this.branches[c];c--)b.render();for(var d,e=0;d=this.commits[e];e++)d.render();m(this.canvas,"graph:render",{id:this.elementId})},a.prototype.applyCommits=function(a,b){function c(a){var b=document.getElementById(a),c=b.getBoundingClientRect();return{top:c.top+document.body.scrollTop,left:c.left+document.body.scrollLeft}}for(var d,e=a.offsetX||a.pageX-c(this.elementId).left,f=a.offsetY||a.pageY-c(this.elementId).top,g=0;d=this.commits[g];g++){var h=d.x+(this.offsetX+this.marginX)/this.scalingFactor-e,i=d.y+(this.offsetY+this.marginY)/this.scalingFactor-f,j=Math.sqrt(Math.pow(h,2)+Math.pow(i,2)),k=j0){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"});var r=i(this.startPoint);r.type="join",this.parentBranch.pushPath(r)}}else n&&(q.type="start");return this.pushPath(q),this.parent.commitOffsetX+=this.template.commit.spacingX*(a.showLabel?2:1),this.parent.commitOffsetY+=this.template.commit.spacingY*(a.showLabel?2:1),null!==p.detail&&o(this.parent)&&(p.detail.style.display="block","vertical-reverse"===this.parent.orientation?this.parent.commitOffsetY+=p.detail.clientHeight:this.parent.commitOffsetY-=p.detail.clientHeight),this.parent.render(),this},b.prototype.tag=function(a){"string"==typeof a&&(a={tag:a}),a=q(a)?a:{};var b=f(this.commits);return q(b)&&(g(b,a),this.parent.render()),this},b.prototype.checkout=function(){this.parent.HEAD=this},b.prototype.delete=function(){this.isDeleted=!0},b.prototype.merge=function(a,c){var d=a||this.parent.HEAD;if(d instanceof b==!1||d===this)return this;var e=this.commits[0];if(!e)return console.log(this.name+" is already up-to-date with "+d.name),this;var g="Merge branch `"+this.name+"` into `"+d.name+"`";if("object"!=typeof c){var j=c;c={},c.message="string"==typeof j?j:g}else c.message=c.message||g;c.type="mergeCommit",c.parentCommit=h(this);var k=e.parentCommit,l=h(d),m=k&&k.sha1===l.sha1;if(c.fastForward&&m){var n=p(this.parent);if(this.color=d.color,n){var o=d.path[1].y;this.path.forEach(function(a){a.y=o})}else{var q=d.path[1].x;this.path.forEach(function(a){a.x=q})}this.commits.forEach(function(a){n?a.y=k.y:a.x=k.x,a.labelColor=k.labelColor,a.messageColor=k.messageColor,a.dotColor=k.dotColor,a.dotStrokeColor=k.dotStrokeColor})}else{d.commit(c);var r=f(d.commits),s={x:this.offsetX+this.template.commit.spacingX*(r.showLabel?3:2)-this.parent.commitOffsetX,y:this.offsetY+this.template.commit.spacingY*(r.showLabel?3:2)-this.parent.commitOffsetY,type:"join"};this.pushPath(i(s));var t={x:r.x,y:r.y,type:"end"};this.pushPath(t),s.type="start",this.pushPath(s)}return this.parent.render(),this.parent.HEAD=d,this},b.prototype.calculColumn=function(){for(var a,b=[],c=0;a=this.parent.branches[c];c++)a.isDeleted||(a.column in b||(b[a.column]=0),b[a.column]++);for(this.column=0;this.column in b&&0!==b[this.column];this.column++);},b.prototype.pushPath=function(a){var b=f(this.path);b?b.x===a.x&&b.y===a.y?"start"!==b.type&&"end"===a.type?b.type="end":"join"===a.type||this.path.push(a):"join"===a.type?(a.x-b.x)*this.template.commit.spacingX<0?this.path.push(a):(a.y-b.y)*this.template.commit.spacingY<0&&this.path.push(a):this.path.push(a):this.path.push(a)},c.prototype.render=function(){var a=this.template.commit.tag.spacingX,b=(this.parent.columnMax+1)*this.template.branch.spacingX+a;if(this.showLabel)if(p(this.parent)&&this.template.branch.labelRotation%180===0){var e=this.y-this.dotSize-j(this.labelFont);l(this.context,this.x,e,this.branch.name,this.labelColor,this.labelFont,this.template.branch.labelRotation,!0)}else l(this.context,this.x+this.template.commit.spacingX,this.y+this.template.commit.spacingY,this.branch.name,this.labelColor,this.labelFont,this.template.branch.labelRotation,!0);if(this.context.beginPath(),this.context.arc(this.x,this.y,this.dotSize,0,2*Math.PI,!1),this.context.fillStyle=this.dotColor,this.context.strokeStyle=this.dotStrokeColor,this.context.lineWidth=this.dotStrokeWidth,"number"==typeof this.dotStrokeWidth&&this.context.stroke(),this.context.fill(),this.context.closePath(),this.arrowDisplay&&this.parentCommit instanceof c&&this.arrow(),null!==this.tag){var f=new d(this,{color:this.tagColor,font:this.tagFont});b+=f.width-a}if(null!==this.detail&&o(this.parent)){this.detail.width=30,this.detail.style.left=this.parent.canvas.offsetLeft+b+this.x+this.detail.width+"px";var g=this.parent.canvas.offsetTop+this.y,h=30;if("vertical-reverse"===this.parent.orientation){var i=this.parent.canvas.clientHeight-this.detail.clientHeight;this.detail.style.top=g+i-h+"px"}else this.detail.style.top=g+h+"px"}if(this.messageDisplay){var k=this.message;this.messageHashDisplay&&(k=this.sha1+" "+k),this.messageAuthorDisplay&&(k+=this.author?" - "+this.author:""),this.messageBranchDisplay&&(k=(this.branch.name?"["+this.branch.name+"] ":"")+k),this.context.font=this.messageFont,this.context.fillStyle=this.messageColor,this.context.fillText(k,b,this.y+this.dotSize/2)}},c.prototype.arrow=function(){function a(a,b){var c=d?-1:1;return Math.atan2(c*a,c*b)}var b=this.template.arrow.size,c=this.template.arrow.color||this.branch.color,d=this.parent.reverseArrow,e=a(this.parentCommit.y-this.y,this.parentCommit.x-this.x),f=this===this.branch.commits[0];if("mergeCommit"===this.type||f){var g=this.parentCommit.branch.column-this.branch.column,h=this.showLabel?2:1,i=this.template.branch.spacingX*g+this.template.commit.spacingX*h,j=(f||d)&&Math.abs(this.y-this.parentCommit.y)>Math.abs(this.template.commit.spacingY),k=this.x===this.parentCommit.x;o(this.parent)&&(j||k)&&(i=0);var l=this.template.branch.spacingY*g+this.template.commit.spacingY*h,m=(f||d)&&Math.abs(this.x-this.parentCommit.x)>Math.abs(this.template.commit.spacingX),n=this.y===this.parentCommit.y;p(this.parent)&&(m||n)&&(l=0),e=a(l,i),c=this.parentCommit.branch.color}var q=Math.PI/7,r=d?this.parentCommit.x:this.x,s=d?this.parentCommit.y:this.y,t=this.template.commit.dot.size+this.template.arrow.offset,u=t*Math.cos(e)+r,v=t*Math.sin(e)+s,w=(t+b)*Math.cos(e-q)+r,x=(t+b)*Math.sin(e-q)+s,y=(t+b/2)*Math.cos(e)+r,z=(t+b/2)*Math.sin(e)+s,A=(t+b)*Math.cos(e+q)+r,B=(t+b)*Math.sin(e+q)+s;this.context.beginPath(),this.context.fillStyle=c,this.context.moveTo(u,v),this.context.lineTo(w,x),this.context.quadraticCurveTo(y,z,A,B),this.context.lineTo(A,B),this.context.fill()},e.prototype.get=function(a){var b={};switch(a){case"blackarrow":b={branch:{color:"#000000",lineWidth:4,spacingX:50,mergeStyle:"straight",labelRotation:0},commit:{spacingY:-60,dot:{size:12,strokeColor:"#000000",strokeWidth:7},message:{color:"black"}},arrow:{size:16,offset:2.5}};break;case"metro":default:b={colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacingX:50,labelRotation:0},commit:{spacingY:-80,dot:{size:14},message:{font:"normal 14pt Arial"}}}}return new e(b)},Array.prototype.every||(Array.prototype.every=function(a,b){var c,d;if(null===this)throw new TypeError("this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError;for(arguments.length>1&&(c=b),d=0;f>d;){var g;if(d in e){g=e[d];var h=a.call(c,g,d,e);if(!h)return!1}d++}return!0}),window.GitGraph=a,window.GitGraph.Branch=b,window.GitGraph.Commit=c,window.GitGraph.Template=e}(); \ No newline at end of file diff --git a/docs/Branch.html b/docs/Branch.html index 95c974be..6e305755 100644 --- a/docs/Branch.html +++ b/docs/Branch.html @@ -351,7 +351,7 @@
Properties
Source:
@@ -492,7 +492,7 @@
Parameters:
Source:
@@ -593,7 +593,7 @@
This:
Source:
@@ -665,7 +665,7 @@
This:
Source:
@@ -860,7 +860,7 @@
Properties
Source:
@@ -939,7 +939,7 @@
This:
Source:
@@ -1187,7 +1187,7 @@
Properties
Source:
@@ -1282,7 +1282,7 @@
This:
Source:
@@ -1354,7 +1354,7 @@
This:
Source:
@@ -1648,7 +1648,7 @@
Properties
Source:
@@ -1702,7 +1702,7 @@

Index

Classes