SankeyDiagram Class

class SankeyDiagram
addDataset(array ...$Dataset)

Add Dataset(s)

Each dataset is a three element array of the form array{string, string, float}. The elements are: source, target, value.

Parameters:
  • ...$Dataset (Dataset) – The Dataset(s)

Returns:

A new instance of SankeyDiagram with the Dataset(s) added

Return type:

SankeyDiagram

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 SankeyDiagram with the comment

Return type:

SankeyDiagram

withDataset(array ...$Dataset)

Set Dataset(s)

Each dataset is a three element array of the form array{string, string, float}. The elements are: source, target, value.

Parameters:
  • ...$Dataset (Dataset) – The Dataset(s)

Returns:

A new instance of SankeyDiagram with the Dataset(s)

Return type:

SankeyDiagram