Node Class¶
- class Node¶
Represents a node in Mindmap diagram.
- __construct(?string $id = null, ?NodeShape $shape = null)¶
- Parameters:
$id (
?string) – The node id (default: auto-generate the node ID)$shape (
?NodeShape) – The node shape - see node-shape for available shapes (default: default shape)
- Returns:
A new instance of
Node- Return type:
- addNode(Node ...$node)¶
Add additional child node(s) to the node
- withComment(string $comment)¶
Add a comment to the node
- Parameters:
$comment (
string) – The comment
- Returns:
A new instance of
Nodewith a comment- Return type:
- withIcon(string $icon)¶
Add an icon to the node (https://mermaid.js.org/syntax/mindmap.html#icons)
The icon pack must be available on the page rendering the diagram
- Parameters:
$icon (
string) – The icon definition
- Returns:
A new instance of
Nodewith an icon- Return type:
- withNode(Node ...$node)¶
Add child node(s) to the node
- withStyleClass(string $styleClass)¶
Set the style class for the node
- Parameters:
$styleClass (
string) – The style class
- Returns:
A new instance of
Nodewith style class- Return type:
- withText(string $text, bool $isMarkdown = false)¶
Set the text displayed in node
If this method is not called, the node ID is used as the node text
- Parameters:
$text (
string) – The node text$isMarkdown (
bool) – Whether the text contains Markdown formatting
- Returns:
A new instance of
Nodewith the node text- Return type: