-
<private> _initProps(properties) → {Edge}
-
Initialize Edge properties
Parameters:
Name |
Type |
Description |
properties |
Object
|
Properties passed in from the constructor |
- Source:
Returns:
The Edge the method was called on
-
Type
-
Edge
-
addTo(graph) → {Edge}
-
Add the Edge to a Graph. Upon adding, if the Edge contains Node string ID's, they will be looked up in the Graph and replaced with Node instances.
Parameters:
Name |
Type |
Description |
graph |
Graph
|
Graph the Edge will be added to |
- Source:
Returns:
The Edge the method was called on
-
Type
-
Edge
-
getColor() → {String}
-
Gets the color of the Edge
- Source:
Returns:
String hexadecimal representation of the Edge's color
-
Type
-
String
Example
myEdge.setColor("green");
myEdge.getColor(); // returns "008000"
-
getNodes() → {Array}
-
Get the nodes of the Edge
- Source:
Returns:
Array of two Nodes that represent the ends of the Edge
-
Type
-
Array
-
setColor(color) → {Edge}
-
Set the color of the Edge
Parameters:
Name |
Type |
Description |
color |
Number
|
String
|
Hexadecimal or CSS-style string representation of a color |
- Source:
Returns:
The Edge the method was called on
-
Type
-
Edge
Examples
myEdge.setColor(0x00ffbb);
myEdge.setColor("rgb(250,0,0)");
myEdge.setColor("green");
-
setNodes(nodes) → {Edge}
-
Set the nodes of the Edge
Parameters:
Name |
Type |
Description |
nodes |
Array
|
Array of two Nodes |
- Source:
Returns:
The Edge the method was called on
-
Type
-
Edge