Learn R Programming

loon (version 1.4.1)

l_layer_move: Move a layer

Description

The postition of a layer in the layer tree determines the rendering order. That is, the non-group layers are rendered in order of a Depth-first traversal of the layer tree. The toplevel group layer is called 'root'.

Usage

l_layer_move(widget, layer, parent, index = "0")

Value

0 if success otherwise the function throws an error

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

parent

if parent layer is not specified it is set to the current parent layer of the layer

index

position among its siblings. valid values are 0, 1, 2, ..., 'end'

See Also

l_layer, l_layer_printTree, l_layer_index

Examples

Run this code
if(interactive()){

p <- l_plot()

l <- l_layer_rectangle(p, x=0:1, y=0:1, color="steelblue")
g <- l_layer_group(p)
l_layer_printTree(p)

l_layer_move(l, parent=g)
l_layer_printTree(p)

l_layer_move(p, 'model', parent=g)
l_layer_printTree(p)

}

Run the code above in your browser using DataLab