shnitsel.data.tree.tree_vis#

Attributes#

Functions#

_load_static_files()

Lazily load the resource files into memory the first time they are needed

_icon(icon_name)

collapsible_section(name[, inline_details, details, ...])

_mapping_section(mapping, name, details_func[, ...])

summarize_attrs(attrs)

summarize_tree_children(children)

_obj_repr(obj, header_components, sections)

Return HTML repr of a shnitsel tools object.

datatree_child_repr(node[, end])

tree_repr(node)

tree_node_sections(node[, root])

Module Contents#

STATIC_FILES = (('shnitsel.vis.static.html', 'icons-svg-inline.html'), ('shnitsel.vis.static.css', 'style.css'))#
_load_static_files()#

Lazily load the resource files into memory the first time they are needed

_icon(icon_name)#
Parameters:

icon_name (Literal['database', 'file-text2', 'folder', 'tree_struct', 'tree_database', 'molecule', 'molecule2', 'tree', 'file_dark', 'file_bright', 'file_bright2', 'folder_open', 'folder_closed'])

Return type:

str

collapsible_section(name, inline_details='', details='', n_items=None, enabled=True, collapsed=False)#
Return type:

str

_mapping_section(mapping, name, details_func, max_items_collapse=5, enabled=True, expanded=False)#
Parameters:
  • mapping (Mapping[Hashable, Any])

  • name (str)

  • details_func (Callable)

  • max_items_collapse (int)

  • enabled (bool)

  • expanded (bool)

Return type:

str

summarize_attrs(attrs)#
Return type:

str

summarize_tree_children(children)#
Parameters:

children (Mapping[str, shnitsel.data.tree.node.TreeNode])

Return type:

str

attr_section#
root_children_section#
groups_section#
leaves_section#
_obj_repr(obj, header_components, sections)#

Return HTML repr of a shnitsel tools object.

If CSS is not injected (untrusted notebook), fallback to the plain text repr.

datatree_child_repr(node, end=False)#
Parameters:
Return type:

str

tree_repr(node)#
Parameters:

node (shnitsel.data.tree.node.TreeNode)

Return type:

str

tree_node_sections(node, root=False)#
Parameters:
Return type:

list[str]