l_layer_demote: Moves the layer to be a child of its right group layer...

View source: R/l_layer.R

l_layer_demoteR Documentation

Moves the layer to be a child of its right group layer sibling

Description

Moves the layer up the layer tree (away from the root layer) if there is a sibling group layer to the right of the layer.

Usage

l_layer_demote(widget, layer)

Arguments

widget

widget path or layer object of class 'l_layer'

layer

layer id. If the widget argument is of class 'l_layer' then the layer argument is not used

Value

0 if success otherwise the function throws an error

Examples

if(interactive()){

p <- l_plot()

g1 <- l_layer_group(p)
g2 <- l_layer_group(p, parent=g1)
l1 <- l_layer_oval(p, x=0:1, y=0:1)

l_layer_printTree(p)
l_layer_demote(p, l1)
l_layer_printTree(p)
l_layer_demote(p, l1)
l_layer_printTree(p)

}

loon documentation built on July 9, 2023, 5:48 p.m.