Class: Commit

Commit

new Commit(options)

Commit

This:
Parameters:
Name Type Description
options Object

Commit options

Properties
Name Type Argument Default Description
parent GitGraph

GitGraph constructor

x Number

Position X (dot)

y Number

Position Y (dot)

color String

Master color (dot & message)

arrowDisplay Boolean

Add a arrow under commit dot

author String <optional>
this.parent.author

Author name & email

date String <optional>

Date of commit, default is now

detail String <optional>

DOM Element of detail part

sha1 String <optional>

Sha1, default is a random short sha1

parentCommit Commit <optional>

Parent commit

type String <optional>
("mergeCommit"|null)

Type of commit

tag String <optional>

Tag of the commit

tagColor String <optional>
options.color

Color of the tag

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

Font of the tag

displayTagBox String <optional>
true

If true, display a box around the tag

dotColor String <optional>
options.color

Specific dot color

dotSize Number <optional>
this.template.commit.dot.size

Dot size

dotStrokeWidth Number <optional>
this.template.commit.dot.strokeWidth

Dot stroke width

dotStrokeColor Number <optional>
this.template.commit.dot.strokeColor
message String <optional>
"He doesn't like George Michael! Boooo!"

Commit message

messageColor String <optional>
options.color

Specific message color

messageFont String <optional>
this.template.commit.message.font

Font of the message

messageDisplay Boolean <optional>
this.template.commit.message.display

Commit message display policy

messageAuthorDisplay Boolean <optional>
this.template.commit.message.displayAuthor

Commit message author policy

messageBranchDisplay Boolean <optional>
this.template.commit.message.displayBranch

Commit message author policy

messageHashDisplay Boolean <optional>
this.template.commit.message.displayHash

Commit message hash policy

labelColor String <optional>
options.color

Specific label color

labelFont String <optional>
this.template.branch.labelFont

Font used for labels

tooltipDisplay Boolean <optional>
true

Tooltip message display policy

onClick commitCallback <optional>

OnClick event for the commit dot

representedObject Object <optional>

Any object which is related to this commit. Can be used in onClick or the formatter. Useful to bind the commit to external objects such as database id etc.

Source:

Methods

arrow()

Render a arrow before commit

This:
Source:

render()

Render the commit

This:
Source: