bintreeviz v0.1.0 Bintreeviz View Source
Bintreeviz is a binary tree visualizer for Elixir. Its main purpose is to convert a given tree structure into a string representation.
Positioning
It supports pluggable algorithms for positioning of the individual nodes. Out-of-the-box it comeswith the Wetherell and Shannon (WS) algorithm for drawing tidy trees as described in IEEE.
Rendering
It supports pluggable renderers for outputting the positioned tree to a string format. out-of-the-box it comes with an ASCII renderer which will use a configurable charset to draw the tree.
Configuration options
The renderer takes a keyword list with configuration options:
renderer
Which renderer to use. It will default to the ASCII (Bintreeviz.Renderer.Ascii
) renderer which will render the tree using Box Drawing Characters and can be printed to stdout as shown in the examples.positioner
Which positioning algorithm to use. It defaults to Wetherell and Shannon (WS).ascii_renderer_charset
Renderer specific configuration to configure which charset to use while rendering using the ASCII renderer. Defaults toBintreeviz.Renderer.Ascii.Charset.BoxDrawingChars
. Other options are:Bintreeviz.Renderer.Ascii.Charset.SimpleDrawingChars
.
Link to this section Summary
Functions
render/1 takes the root node, positions it and then renders it into a string
Link to this section Types
render_options()
View Sourcerender_options() :: [ renderer: Bintreeviz.Renderer.t(), positioner: Bintreeviz.Positioner.t() ]
Link to this section Functions
render(root, options \\ [])
View Sourcerender(Bintreeviz.Node.t(), render_options()) :: String.t()
render/1 takes the root node, positions it and then renders it into a string