GitGraph Class

class GitGraph

Represents a GitGraph diagram

addItem(ItemInterface ...$item)

Add item(s)

Parameters:
  • ...$item (ItemInterface) – The item(s)

Returns:

A new instance of GitGraph with the item(s) added

Return type:

GitGraph

render(array $attributes = [])

Renders the diagram

Parameters:
  • $attributes (array) –

    HTML attributes for the <pre> tag as name=>value pairs

    Note

    The mermaid class is added

Returns:

Mermaid diagram code in a <pre> tag

Return type:

string

withComment(string $comment)

Add a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of GitGraph with the comment

Return type:

GitGraph

withItem(ItemInterface ...$item)

Set items column(s)

Parameters:
  • ...$item (ItemInterface) – The item(s)

Returns:

A new instance of GitGraph with the item(s)

Return type:

GitGraph