# Dendograms

Term.Dendograms.DendogramMethod
Dendogram(head, args::Vector; first_arg=nothing, pretitle=nothing)

Construct a single Dendogram.

Construct a dendogram with one head node (head) and any number of leaves.

first_arg is used to create dendograms for Expr objects and gives special status to an expression's first argument which gets printed with the head. pretitle is used to create dendograms for Expr, pretitle is insrted as three Segments (a string and an upward arrow) before the head of the dendogram.

source
Term.Dendograms.DendogramMethod
Dendogram(e::Expr; pretitle=nothing)

Create a Dendogram representation for an Expr. For expressions whose arguments are themselves Expr objects, dendograms are created recursively. In the end all dendograms are linked using link to create a single dendogram object (possibly nested).

pretitle is used to create dendograms for Expr, pretitle is insrted as three Segments (a string and an upward arrow) before the head of the dendogram.

source
Term.Dendograms.adjust_widthMethod
adjust_width(x, y)::Int

Width correction factor.

When creating a link between dendograms, the width of the spacing between branches of the dendogram line needs to be adjusted depending on the type (Leaf or Dendogram) of the line.

source
Term.Dendograms.linkMethod
link(dendos...; title="", shifttitle=false, pretitle=nothing)::Dendogram

Link a variable number of Dendogram and Leaf objects in a new Dendogram.

Create a Dendogram whose leaves are other leaves and dendograms. This is done carefully to ensure that all spacings are correct and text is aligned as much as possible.

Annoyingly, the code is very similar to that of Dendogram but different enough that it can't be refactored into single functions.

source
Term.Dendograms.replace_line_midpointMethod
replace_line_midpoint(line::String; widths=nothing)

Replace the mid character of a dendogram tree line with a vertical line for the title.

If the mid character is also the location of a branch (one of the entries in widths), then use the appropriate double branching character.

source