Global

Methods

<private> _assignTagOptionsToCommit(commit, options)

Extend given commit with proper attributes for tag from options.

Parameters:
Name Type Argument Description
commit Commit
options Object <optional>
Properties
Name Type Argument Default Description
tag String <optional>

Tag of the commit

tagColor String <optional>
commit.messageColor

Color of the tag

tagFont String <optional>
commit.template.commit.tag.font

Font of the tag

displayTagBox String <optional>
true

If true, display a box around the tag

Source:

<private> _booleanOptionOr(booleanOption, defaultOptions) → {Boolean}

Returns the booleanOptions if it's actually a boolean, returns defaultOptions otherwise.

Parameters:
Name Type Description
booleanOption *
defaultOptions Boolean
Source:
Returns:
Type
Boolean

<private> _clone(object) → {Object}

Returns a copy of the given object.

Parameters:
Name Type Description
object Object
Source:
Returns:
Type
Object

<private> _drawTextBG(context, x, y, text, color, font, angle, useStroke)

Draw text background.

Parameters:
Name Type Description
context CanvasRenderingContext2D

Canvas 2D context in which to render text.

x Number

Horizontal offset of the text.

y Number

Vertical offset of the text.

text String

Text content.

color String

Text Colors.

font String

Text font.

angle Number

Angle of the text for rotation.

useStroke Boolean

Name of the triggered event.

Source:

<private> _emitEvent(element, eventName, data)

Emit an event on the given element.

Parameters:
Name Type Argument Default Description
element HTMLElement

DOM element to trigger the event on.

eventName String

Name of the triggered event.

data Object <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
font String
Source:
Returns:
Type
Number

<private> _getLast(array) → {*}

Returns the last element of given array.

Parameters:
Name Type Description
array Array
Source:
Returns:
Type
*

<private> _getParentCommitFromBranch(branch) → {Commit}

Returns the parent commit of current HEAD from given branch.

Parameters:
Name Type Description
branch Branch
Source:
Returns:
Type
Commit

<private> _getScale(context) → {Number}

Returns the scaling factor of given canvas context. Handles high-resolution displays.

Parameters:
Name Type Description
context Object
Source:
Returns:
Type
Number

<private> _isHorizontal(graph) → {Boolean}

Returns true if graph has an horizontal orientation.

Parameters:
Name Type Description
graph GitGraph
Source:
Returns:
Type
Boolean

<private> _isNullOrUndefined(obj, key) → {Boolean}

Returns true if any of the properties (nested or single) of obj specified by key are 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.

key String

The property hierarchy of obj to be tested, specified using 'dot notation' (e.g. property1.property2.property3 etc).

Source:
Returns:
  • True if ANY of the properties specified by key is undefined or equal to null, otherwise False.
Type
Boolean

<private> _isObject(object) → {Boolean}

Returns true if object is an object.

Parameters:
Name Type Description
object *
Source:
Returns:
Type
Boolean

<private> _isVertical(graph) → {Boolean}

Returns true if graph has a vertical orientation.

Parameters:
Name Type Description
graph GitGraph
Source:
Returns:
Type
Boolean

Type Definitions

commitCallback(commit, mouseOver, event)

A callback for each commit

Parameters:
Name Type Description
commit Commit

A commit

mouseOver Boolean

True, if the mouse is currently hovering over the commit

event Event

The DOM event (e.g. a click event)

Source:

commitFormatter(commit)

A formatter for commit

Parameters:
Name Type Description
commit Commit

The commit to format

Source: