Constructor
new GraphBuilderNode(graphBuilder, x, y, tmp, color)
Constructs a node with the provided x and y coordinates and color and is associated with
the provided GraphBuilder
Parameters:
Name | Type | Description |
---|---|---|
graphBuilder |
GraphBuilder | The GraphBuilder |
x |
Number | The x-coordinate of the node |
y |
Number | The y-coordinate of the node |
tmp |
Boolean | Whether the node is temporary (i.e. result of incomplete action) |
color |
String | The color of the node |
- Source:
Methods
addChild(n, l)
Adds a child to the node.
Creates the child relationship as well as the parent relationship
for the added node.
Parameters:
Name | Type | Description |
---|---|---|
n |
GraphBuilderNode | The node to add as child |
l |
jQuery.selection | The line SVG element between parent and child |
- Source:
getChildren() → {Array.<GraphBuilderNode>}
Returns the children of the node.
- Source:
Returns:
The children
- Type
- Array.<GraphBuilderNode>
getCircle() → {jQuery.selection}
Returns the circle SVG element associated with the node
- Source:
Returns:
A jQuery selection of the circle
- Type
- jQuery.selection
getCoords() → {Array.<Number>}
Returns the coordinates as a two element array
- Source:
Returns:
Array containing coordinates
- Type
- Array.<Number>
getId() → {Number}
Returns the globally unique ID of this node
- Source:
Returns:
this node's globally unique ID
- Type
- Number
getLines() → {Array.<Line>}
Returns all Lines associated with the node
- Source:
Returns:
The lines
- Type
- Array.<Line>
removeChild(n)
Removes a child from the node.
Parameters:
Name | Type | Description |
---|---|---|
n |
GraphBuilderNode | The node to remove |
- Source:
setCircleRadius(radius)
Sets the radius of the circle SVG element associated with this node
Parameters:
Name | Type | Description |
---|---|---|
radius |
Number | The new radius for the circle |
- Source: