Skip to contents

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)

Arguments

hierarchy

A d_hierarchy_state().

path

Character branch path. Defaults to the hierarchy's active path where applicable.

missing

Value returned when no matching state exists.

base_offsets

Optional algorithmic base offsets for the active state.

dx_m, dy_m

Incremental branch movement in projected map units.

Value

Updated hierarchy states, active/parent states, or composed offset tables as described by each function.