GroupData

matrix. GroupData

The data model of a group.

Constructor

new GroupData()

Source:

Members

isGroup

Source:

This property is true.

Methods

addChild()

Source:

Add a child to this group.

Fires:
  • event:childAdded
  • event:treeChanged

addGroup()

Source:

Adds a group to this group.

addPort()

Source:

Adds a port to this group.

deleteChild()

Source:

Removed a child node.

Fires:
  • event:childRemoved
  • event:treeChanged

deleteGroup()

Source:

Removes a group from this group.

deletePort()

Source:

Removes a port from this group.

forEach(cb)

Source:

Iterates all children of this group.

Parameters:
Name Type Description
cb function

The callback function to invoke with each child node.

forEachAsync() → {function}

Source:

Call a function for each child node asynchronously. Will subscribe to new children being added and call the callback. The callback function may return a subscription which is removed once the corresponding child node is removed from this group.

Returns:
  • A subscription. Call this function to unsubscribe.
Type
function

forEachNode(cb, sorter)

Source:

Iterates all children of this group and all their children recursively. Will descend into group nodes if the callback returns either undefined or a trueish value.

Parameters:
Name Type Description
cb function

A callback function to be called for each node in this subtree. The arguments are the node and the path description. The path description is an Array of objects with 3 properties parent, index and length. Parent is the parent node, index the index of the node in the list of children and length is the number of siblings.

sorter function

An optional sort function. Will be used as an argument to Array.prototype.sort for each list of child nodes.