BasicTreePlots

Contents

    Index

      BasicTreePlots.distanceMethod
      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)

      source
      BasicTreePlots.labelMethod
      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)

      source
      BasicTreePlots.ladderizeMethod
      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 value
      • agg::Function: aggregating function, takes collection of outputs from fun and returns scaler output
      • tree: tree object that fulfills AbstractTrees interface. 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
      source