Class: RenderGraph

RenderGraph()

new RenderGraph()

Manages the rendering graph.

Source:

Methods

getInputsForNode(node) → {Array.<GraphNode>}

Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.

Parameters:
Name Type Description
node GraphNode

the node to get the inputs for.

Source:
Returns:

An array of GraphNodes which are connected to the node.

Type
Array.<GraphNode>

getNamedInputsForNode(node) → {Array.<Object>}

Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {"source":sourceNode, "type":"name", "name":inputName, "destination":destinationNode}.

Parameters:
Name Type Description
node GraphNode

the node to get the named inputs for.

Source:
Returns:

An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.

Type
Array.<Object>

getOutputsForNode(node) → {Array.<GraphNode>}

Get a list of nodes which are connected to the output of the passed node.

Parameters:
Name Type Description
node GraphNode

the node to get the outputs for.

Source:
Returns:

An array of the nodes which are connected to the output.

Type
Array.<GraphNode>

getZIndexInputsForNode(node) → {Array.<Object>}

Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {"source":sourceNode, "type":"zIndex", "zIndex":0, "destination":destinationNode}.

Parameters:
Name Type Description
node GraphNode

the node to get the z-index refernced inputs for.

Source:
Returns:

An array of objects representing the nodes and connection type, which are connected by z-Index for the node.

Type
Array.<Object>

isInputAvailable(node, inputName)

Check if a named input on a node is available to connect too.

Parameters:
Name Type Description
node GraphNode

the node to check.

inputName String

the named input to check.

Source:

registerConnection(sourceNode, destinationNode, targetopt) → {boolean}

Register a connection between two nodes.

Parameters:
Name Type Attributes Description
sourceNode GraphNode

the node to connect from.

destinationNode GraphNode

the node to connect to.

target String | number <optional>

the target port of the conenction, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.

Source:
Returns:

Will return true if connection succeeds otherwise will throw a ConnectException.

Type
boolean

unregisterConnection(sourceNode, destinationNode) → {boolean}

Remove a connection between two nodes.

Parameters:
Name Type Description
sourceNode GraphNode

the node to unregsiter connection from.

destinationNode GraphNode

the node to register connection to.

Source:
Returns:

Will return true if removing connection succeeds, or false if there was no connectionsction to remove.

Type
boolean