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
- Attributes:
Methods
filter
(path_filters)Filters the loaded AttrTree using the supplied path_filters.
get
(identifier[, default])Get a node of the AttrTree using its path string.
items
()Keys and nodes of the AttrTree
keys
()Keys of nodes in the AttrTree
merge
(trees)Merge a collection of AttrTree objects.
pop
(identifier[, default])Pop a node of the AttrTree using its path string.
set_path
(path, val)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)Updated the contents of the current AttrTree with the contents of a second AttrTree.
values
()Nodes of the AttrTree
- 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
- 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.