Description Details Active bindings Methods
R6 class representing a single node, with links to child nodes
R6 class representing a single node, with links to child nodes
The node has a name, an environment that contains its attributes, and a NodeSet that contains its children, along with accessors for required functionality (determined by downstrea).
id
node id as string
children
NodeSet of child nodes
child_ids
character vector of child ids
attributes
node attributes
data
node data
dump
contents as a list
json
node contents as JSON
new()
Used as Node$new(...) create a new node
Node$new(name, ..., .children = NodeSet$new())
name
name of the node (arbitrary label, not checked).
...
an attributes to record (in the environment).
.children
optoinally a list of child nodes (as NodeSet)
a 'Node' object
matches()
Check whether this node matches conditions specified in dots
Node$matches(...)
...
interpreted as in 'dplyr::filter' against the node attributes.
TRUE iff the tests pass
mutate()
Modify node attributes as specified in dots
Node$mutate(..., .which = "attributes")
...
interpreted as in 'dplyr::mutate' against the node attributes using a data mask and quosures.
.which
either 'attributes' in which case the static node attributes are modified and a new node ID will be generated or 'data' (anything else really) and the mutable data in the node will be modified.
modified version of self
spawn()
Deep-clone the node and mutate node attributes as specified in dots
Node$spawn(...)
...
interpreted as in 'dplyr::mutate' against the node attributes using a data mask and quosures.
modified version of the cloned node
merge()
Merge another node's child id's into this node. Only makes sense on a node with identical id's... should test that,
Node$merge(x)
x
another Node object.
modified self
disown()
Clear record of child nodes, internal use
Node$disown()
self, without children
transform()
Create a new node using transformations described in a Transition object
Node$transform(x)
x
transition object
a *child* object created by applying the transition
modify()
Modify the current node using transformations described in a Transition object
Node$modify(x)
x
transition object
self object created by applying the transition
get()
Retrieve an attribute value by symbol (or character string).
Node$get(x)
x
bare symbol or character string
value of x in node attributes
has()
Check for presence of attribute by symbol (or character string).
Node$has(x)
x
bare symbol or character string
TRUE iff x exists as an attribute
clone()
The objects of this class are cloneable with this method.
Node$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.