bintreeviz v0.1.0 Bintreeviz.Node View Source
Bintreeviz.Node describes a single Node in the graph and contains the functions to manipulate said Nodes.
Link to this section Summary
Functions
is_leaf/1 returns true if the node has no left_child and no right_child.
new/1 takes a string label and returns a new %Node{}
new/2 takes a string label and an Keyword list containing left and right children and returns a new %Node{}
set_left_child/2 assigns the passed in node as the left_child to the node.
set_right_child/2 assigns the passed in node as the right_child to the node.
width/1 returns the width of the node. Width of the node is determined by the length of the label plus the configured padding for the nodes.
Link to this section Types
t()
View Sourcet() :: %Bintreeviz.Node{ label: String.t(), left_child: t(), offset: integer(), right_child: t(), x: non_neg_integer(), y: non_neg_integer() }
Link to this section Functions
is_leaf/1 returns true if the node has no left_child and no right_child.
new/1 takes a string label and returns a new %Node{}
new/2 takes a string label and an Keyword list containing left and right children and returns a new %Node{}
set_left_child/2 assigns the passed in node as the left_child to the node.
set_right_child/2 assigns the passed in node as the right_child to the node.
width/1 returns the width of the node. Width of the node is determined by the length of the label plus the configured padding for the nodes.