Trees
Term.Trees.TreeTerm.Trees.TreeTerm.Trees.TreeTerm.Trees.make_hierarchy_dictTerm.Trees.print_keyTerm.Trees.print_nodeTerm.Trees.style_TTerm.Trees.style_guides
Term.Trees.Tree — TypeTreeRenderable tree.
Term.Trees.Tree — MethodTree(
tree;
guides::Union{TreeCharSet,Symbol} = :standardtree,
theme::Theme = TERM_THEME[],
printkeys::Union{Nothing,Bool} = true,
print_node_function::Function = print_node,
print_key_function::Function = print_key,
title::Union{String, Nothing}=nothing,
prefix::String = " ",
kwargs...,
)Constructor for Tree
It uses AbstractTrees.print_tree to get a string representation of tree (any object compatible with the AbstractTrees packge). Applies style to the string and creates a renderable Tree.
Arguments:
tree: anything compatible withAbstractTreeguides: if a symbol, the name of preset tree guides types. Otherwise an instance ofAbstractTrees.TreeCharSettheme:Themeused to set tree style.printkeys: Iftrueprint keys. Iffalsedon't print keys.print_node_function: Function used to print nodes.print_key_function: Function used to print keys.title: Title of the tree.prefix: Prefix to be used inAbstractTrees.print_tree
For other kwargs look at AbstractTrees.print_tree
Term.Trees.Tree — MethodTree(T::DataType)::TreeConstruct a Tree visualization of T's types hierarchy The key is in costructing the actual hierarchy tree recursively.
Term.Trees.make_hierarchy_dict — Methodmake_hierarchy_dict(x::Vector{DataType}, T::DataType, Tsubs::AbstractDict)::AbstractDictRecursively create a dictionary with the types hierarchy for T. Tsubs carries information about T's subtypes. The AbstractDict is made backwards. From the deepest levels up.
Term.Trees.print_key — Methodprint_key(io, k; kw...)Print a tree's node's key with some style.
Term.Trees.print_node — Methodprint_node(io, node)Core function to enable fancy tree printing. Styles the leaf/key of each node.
Term.Trees.style_T — MethodApply style for the type whose hierarchy Tree we are making
Term.Trees.style_guides — Methodstyle_guides(tree::String, guides::TreeCharSet, theme::Theme)Apply style to a tree's guides by inserting it into its string representation. Not ideal as it will affect the style of other elements with the same characters like Panels, but ok for no.