holoviews.core.tree module#

class holoviews.core.tree.AttrTree(items=None, identifier=None, parent=None, dir_mode='default')[source]#

Bases: object

An AttrTree offers convenient, multi-level attribute access for collections of objects. AttrTree objects may also be combined together using the update method or merge classmethod. Here is an example of adding a ViewableElement to an AttrTree and accessing it:

>>> t = AttrTree()
>>> t.Example.Path = 1
>>> t.Example.Path
1
filter(path_filters)[source]#

Filters the loaded AttrTree using the supplied path_filters.

property fixed#

If fixed, no new paths can be created via attribute access

get(identifier, default=None)[source]#

Get a node of the AttrTree using its path string.

Parameters#

identifier

Path string of the node to return

default

Value to return if no node is found

Returns#

The indexed node of the AttrTree

items()[source]#

Keys and nodes of the AttrTree

keys()[source]#

Keys of nodes in the AttrTree

classmethod merge(trees)[source]#

Merge a collection of AttrTree objects.

property path#

Returns the path up to the root for the current node.

pop(identifier, default=None)[source]#

Pop a node of the AttrTree using its path string.

Parameters#

identifier

Path string of the node to return

default

Value to return if no node is found

Returns#

The node that was removed from the AttrTree

set_path(path, val)[source]#

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

update(other)[source]#

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values()[source]#

Nodes of the AttrTree