These pure helpers make hierarchy state operational without imposing UI behavior. Paths are character vectors of branch IDs. Child states may be keyed by the full slash-separated path or, for backward compatibility, by the final path component.
Usage
d_set_active_path(hierarchy, path = character())
d_active_state(hierarchy, path = hierarchy$active_path, missing = NULL)
d_parent_state(hierarchy, path = hierarchy$active_path, missing = NULL)
d_branch_offsets(hierarchy, path = hierarchy$active_path)
d_effective_offsets(
hierarchy,
path = hierarchy$active_path,
base_offsets = NULL
)
d_move_branch(hierarchy, path = hierarchy$active_path, dx_m = 0, dy_m = 0)