riptable.Utils.rt_display_nested

Classes

AttributeTraversal

Attribute traversal.

BoxStyle

A rendering style that uses box draw characters and a common layout.

DictTraversal

Traversal suitable for a dictionary. Keys are tree labels, all values

DisplayNested

KeyArgsConstructor

LeftAligned

Creates a renderer for a left-aligned tree.

Style

Rendering style for trees.

Functions

_arr_info(arr)

_cat_info(arr)

_default_info(item)

_mask_flags(flagnum)

_scalar_info(item)

treedir(path[, name])

Attributes

BOX_LIGHT

class riptable.Utils.rt_display_nested.AttributeTraversal(**kwargs)

Bases: KeyArgsConstructor

Attribute traversal.

Uses an attribute of a node as its list of children.

attribute = 'children'
get_children(node)
class riptable.Utils.rt_display_nested.BoxStyle(**kwargs)

Bases: Style

A rendering style that uses box draw characters and a common layout.

gfx
horiz_len = 4
indent = 1
label_space = 1
child_head(label)

Render a node label into final output.

child_tail(line)

Render a node line that is not a label into final output.

last_child_head(label)

Like child_head() but only called for the last child.

last_child_tail(line)

Like child_tail() but only called for the last child.

class riptable.Utils.rt_display_nested.DictTraversal(**kwargs)

Bases: KeyArgsConstructor

Traversal suitable for a dictionary. Keys are tree labels, all values must be dictionaries as well.

get_children(node)
get_root(tree)
get_text(node)
class riptable.Utils.rt_display_nested.DisplayNested
property fmtend
property fmtstart
inline_svg
_build_nested_ascii(data, name=None, showpaths=False, info=False)
_build_nested_html(data, name=None)
_map_asciitree(data, structure, name=None, info=False)
_map_full_paths(data, structure, name=None, prefix='')
_map_htmltree(data, structure, name=None, html_str=[], showicon=True)
build_nested_html(data={}, name=None)
build_nested_string(data={}, name=None, showpaths=False, info=False)
class riptable.Utils.rt_display_nested.KeyArgsConstructor(**kwargs)

Bases: object

class riptable.Utils.rt_display_nested.LeftAligned(**kwargs)

Bases: KeyArgsConstructor

Creates a renderer for a left-aligned tree.

Any attributes of the resulting class instances can be set using constructor arguments.

draw

The draw style used. See Style.

traverse

Traversal method. See Traversal.

__call__(tree)

Render the tree into string suitable for console output.

Parameters:

tree – A tree.

render(node)

Renders a node. This function is used internally, as it returns a list of lines. Use __call__() instead.

class riptable.Utils.rt_display_nested.Style(**kwargs)

Bases: KeyArgsConstructor

Rendering style for trees.

label_format = '{}'
child_head(label)

Render a node label into final output.

child_tail(line)

Render a node line that is not a label into final output.

last_child_head(label)

Like child_head() but only called for the last child.

last_child_tail(line)

Like child_tail() but only called for the last child.

node_label(text)

Render a node text into a label.

riptable.Utils.rt_display_nested._arr_info(arr)
riptable.Utils.rt_display_nested._cat_info(arr)
riptable.Utils.rt_display_nested._default_info(item)
riptable.Utils.rt_display_nested._mask_flags(flagnum)
riptable.Utils.rt_display_nested._scalar_info(item)
riptable.Utils.rt_display_nested.treedir(path, name=None)
riptable.Utils.rt_display_nested.BOX_LIGHT