BasicTreePlots
Contents
Index
BasicTreePlots.distance — Method
distance(node)return scaler distance from node to parent of node. Defaults to 1
To extend treeplot to your type define method for BasicTreePlots.distance(node::YourNodeType)
BasicTreePlots.label — Method
label(node)return string typed value or description of node.
Defaults to string(nodevalue(node))
To extend treeplot to your type define method for BasicTreePlots.label(node::YourNodeType)
BasicTreePlots.ladderize — Method
ladderize!([fun::Function, agg::Function,] tree; rev=false)
ladderize([fun::Function, agg::Function,] tree; rev=false)Perform inplace sorting 'ladderization' of the children of each node in the provided tree based on user provided scaler functions fun and aggregating function agg. ladderize (without the exlamation point) performs a deepcopy of the tree before sorting the tree
Calling ladderize with no funtion arguments is equivalent to calling ladderize!(n->1, sum, t; rev) which will sort the tree by the node's count of descendents.
Args:
fun::Function: function that takes leaves of the tree and outputs scaler valueagg::Function: aggregating function, takes collection of outputs fromfunand returns scaler outputtree: tree object that fulfillsAbstractTreesinterface.AbstractTrees.children(node)should provide sortable collection children of the node.rev::Bool=false: whether to sort children of each node in acending (default) or desending order.
Examples
ladderize!(tree)tree = ladderize(tree)ladderize!(mean, tree) do leaf
leafdata_dict[name(leaf)]["fitness"]
end