Home Reference Source Repository

References

Function Summary

Static Public Function Summary
public

createTree(config: {id: string}): {id: string, children: Array}

creates a new tree root plain data object suitable for use in state

version 1.0.0
public

createTreeNode(config: {id: string, data: *}): {id: string, children: Array}

creates a new tree node plain data object suitable for use in state

version 1.0.0
public

deleteTreeNode(config: {tree: object, id: string}})

deletes a tree node specified by id from a tree all children of the deleted node will be deleted as well

version 1.0.0
public

findTreeNode(config: {tree: object, id: string}): {id: string, children: Array}

searches a tree for a tree node specified by id

version 1.0.0
public

insertTreeNode(config: {parent: object, node: object, offset: number})

inserts a tree node into a tree as a child of the specified parent using the specified offset

version 1.0.0
public

printTree(config: {tree: object, showData: boolean, showChildCount: boolean, linear: boolean}})

prints the tree to the console

version 1.0.0
public

walkTreeBFS(config: function(node: {id: string, children: Array}))

walk through the tree using a breadth-first search (BFS) and call visitor function for each tree node

version 1.0.0
public

walkTreeDFS(config: function(node: {id: string, children: Array}))

walk through the tree using a depth-first search (DFS) and call visitor function for each tree node

version 1.0.0