GraphManager

Manages registered node types and the creation of graph nodes.

Constructor

new L3D.GraphManager()

Methods

createNode(type, options) → nullable GraphNode

Create a node of the given registered type.

Parameters
type String

The registered type name of the node to create.

options Object

Optional configuration options for the node.

Returns
GraphNode

The new node, or null if one couldn't be created.

getNodeClass(type, The)

Returns a registered node type with the given name.

Parameters
type String

The registered type name of the node

The Class

registered node class.

registerNodeType(type, nodeClass, skipUpdate)

Register a node class.

Parameters
type String

The name of the node type, used to create the node with createNode.

nodeClass String

The class of the node.

skipUpdate bool

If true, updateCategoryMap won't be called.

unregisterNodeType(type)

Removes a node type from the system.

Parameters
type

can be either a string node type name, or a GraphNode class

updateCategoryMap() → Map

Updates the category map for registered nodes, used by the Editor for node menus. Categories can be hierarchical, so each item in the category map can either be a GraphNode class, or another Map. The category map is stored in the categoryMap property.

Returns
Map

The resulting categoryMap.