Trees
Term.Trees.Tree
Term.Trees.Tree
Term.Trees.Tree
Term.Trees.make_hierarchy_dict
Term.Trees.print_key
Term.Trees.print_node
Term.Trees.style_T
Term.Trees.style_guides
Term.Trees.Tree
— TypeTree
Renderable 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 withAbstractTree
guides
: if a symbol, the name of preset tree guides types. Otherwise an instance ofAbstractTrees.TreeCharSet
theme
:Theme
used to set tree style.printkeys
: Iftrue
print keys. Iffalse
don'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)::Tree
Construct 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)::AbstractDict
Recursively 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.