Methods
-
<private> _assignTagOptionsToCommit(commit, options)
-
Extend given commit with proper attributes for tag from options.
Parameters:
Name Type Argument Description commitCommit optionsObject <optional>
Properties
Name Type Argument Default Description tagString <optional>
Tag of the commit
tagColorString <optional>
commit.messageColor Color of the tag
tagFontString <optional>
commit.template.commit.tag.font Font of the tag
displayTagBoxString <optional>
true If true, display a box around the tag
- Source:
-
<private> _booleanOptionOr(booleanOption, defaultOptions) → {Boolean}
-
Returns the
booleanOptionsif it's actually a boolean, returnsdefaultOptionsotherwise.Parameters:
Name Type Description booleanOption* defaultOptionsBoolean - Source:
Returns:
- Type
- Boolean
-
<private> _clone(object) → {Object}
-
Returns a copy of the given object.
Parameters:
Name Type Description objectObject - Source:
Returns:
- Type
- Object
-
<private> _drawTextBG(context, x, y, text, color, font, angle, useStroke)
-
Draw text background.
Parameters:
Name Type Description contextCanvasRenderingContext2D Canvas 2D context in which to render text.
xNumber Horizontal offset of the text.
yNumber Vertical offset of the text.
textString Text content.
colorString Text Colors.
fontString Text font.
angleNumber Angle of the text for rotation.
useStrokeBoolean Name of the triggered event.
- Source:
-
<private> _emitEvent(element, eventName, data)
-
Emit an event on the given element.
Parameters:
Name Type Argument Default Description elementHTMLElement DOM element to trigger the event on.
eventNameString Name of the triggered event.
dataObject <optional>
{} Custom data to attach to the event.
- Source:
-
<private> _getFontHeight(font) → {Number}
-
Returns the height of the given font when rendered.
Parameters:
Name Type Description fontString - Source:
Returns:
- Type
- Number
-
<private> _getLast(array) → {*}
-
Returns the last element of given array.
Parameters:
Name Type Description arrayArray - Source:
Returns:
- Type
- *
-
<private> _getParentCommitFromBranch(branch) → {Commit}
-
Returns the parent commit of current HEAD from given branch.
Parameters:
Name Type Description branchBranch - Source:
Returns:
- Type
- Commit
-
<private> _getScale(context) → {Number}
-
Returns the scaling factor of given canvas
context. Handles high-resolution displays.Parameters:
Name Type Description contextObject - Source:
Returns:
- Type
- Number
-
<private> _isHorizontal(graph) → {Boolean}
-
Returns
trueifgraphhas an horizontal orientation.Parameters:
Name Type Description graphGitGraph - Source:
Returns:
- Type
- Boolean
-
<private> _isNullOrUndefined(obj, key) → {Boolean}
-
Returns
trueif any of the properties (nested or single) ofobjspecified bykeyare undefined or set to a value of null. Modified from original source: http://stackoverflow.com/a/23809123.Parameters:
Name Type Description obj* The object whose properties are to be tested as being undefined or equal to null.
keyString The property hierarchy of
objto be tested, specified using 'dot notation' (e.g. property1.property2.property3 etc).- Source:
Returns:
- True if ANY of the properties specified by
keyis undefined or equal to null, otherwise False.
- Type
- Boolean
-
<private> _isObject(object) → {Boolean}
-
Returns
trueifobjectis an object.Parameters:
Name Type Description object* - Source:
Returns:
- Type
- Boolean
-
<private> _isVertical(graph) → {Boolean}
-
Returns
trueifgraphhas a vertical orientation.Parameters:
Name Type Description graphGitGraph - Source:
Returns:
- Type
- Boolean
Type Definitions
-
commitCallback(commit, mouseOver, event)
-
A callback for each commit
Parameters:
Name Type Description commitCommit A commit
mouseOverBoolean True, if the mouse is currently hovering over the commit
eventEvent The DOM event (e.g. a click event)
- Source:
-
commitFormatter(commit)
-
A formatter for commit
Parameters:
Name Type Description commitCommit The commit to format
- Source: