Adds a small increment to the current offset of one region or label in a
d_state(). This is the scripted equivalent of dragging slightly in the
browser: existing movement is preserved and the delta is added on top.
Unknown ids gain a new row, matching update_region_offset().
Usage
d_nudge(state, id, dx_m = 0, dy_m = 0, target = c("region", "label"))Examples
state <- d_state(
region_offsets = data.frame(region = "A", dx_m = 10, dy_m = 0)
)
state <- d_nudge(state, "A", dx_m = 5)
state$region_offsets
#> region dx_m dy_m
#> 1 A 15 0
