ixfx
    Preparing search index...

    Functions

    add
    addValue
    asDynamicTraversable

    Projects node as a dynamic traversable. Dynamic in the sense that it creates the traversable project for nodes on demand. A consequence is that node identities are not stable.

    breadthFirst

    Breadth-first iteration of the children of node

    children

    Iterate over direct children of root, yielding TreeNode instances. Use childrenValues to iterate over child values

    childrenLength
    childrenValues

    Iterate over the value ofdirect children of root. Use children if you want to iterate over TreeNode instances instead.

    compare

    Compares two nodes.

    computeMaxDepth

    Computes the maximum depth of the tree. That is, how many steps down from node it can go. If a tree is: root -> childA -> subChildB

    createNode

    Creates a TreeNode instance with a given value and parent. Parent node, if specified, has its childrenStore property changed to include new child.

    depthFirst

    Depth-first iteration of the children of node

    findAnyChildByValue
    findChildByValue

    Returns the first immediate child of parent that matches value.

    findParentsValue

    Returns the first parent that has a given value.

    followValue
    fromPlainObject
    getRoot
    hasAnyChild

    Returns true if prospectiveChild is some child node of parent, anywhere in the tree structure.

    hasAnyParent

    Returns true if prospectiveParent is any ancestor parent of child.

    hasChild
    hasParent

    Returns true if prospectiveParent is the immediate parent of child.

    nodeDepth

    Returns the depth of node. A root node (ie. with no parents) has a depth of 0.

    parents

    Iterate over all parents of root. First result is the immediate parent.

    parentsValues

    Yields the node value of each parent of child. undefined values are not returned.

    queryByValue

    Yield all immediate children of parent that match value.

    queryParentsValue

    Yields all parents of child that have a given value. Use findParentsValue to find the first match only.

    remove

    Removes child from the tree structure it is in. It removes child from its parent. Any sub-children of child still remain connected.

    root

    Creates the root for a tree, with an optional value. Use rootWrapped if you want a more object-oriented mode of access.

    rootWrapped

    Creates a tree, returning it as a WrappedNode for object-oriented access. Use root alternatively.

    setChildren
    stripParentage

    Converts TreeNode to SimplifiedNode, removing the 'parent' fields. This can be useful because if you have the whole tree, the parent field is redundant and because it makes circular references can make dumping to console etc more troublesome.

    throwTreeTest

    Throws an exception if root fails tree validation

    toStringDeep
    treeTest

    Validates the tree from root downwards.

    value
    wrap

    Wraps node n for a more object-oriented means of access. It will wrap child nodes on demand. For this reason, WrappedNode object identity is not stable