l_layer_bbox: Get the bounding box of a layer.

Description Usage Arguments Value Examples

View source: R/l_layer.R

Description

The bounding box of a layer returns the coordinates of the smallest rectangle that encloses all the elements of the layer.

Usage

1
l_layer_bbox(widget, layer = "root")

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

Numeric vector of length 4 with (xmin, ymin, xmax, ymax) of the bounding box

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if(interactive()){

p <- with(iris, l_plot(Sepal.Length ~ Sepal.Width, color=Species))
l_layer_bbox(p, layer='model')

l <- l_layer_rectangle(p, x=0:1, y=30:31)
l_layer_bbox(p, l)

l_layer_bbox(p, 'root')

}

loon documentation built on May 10, 2021, 9:08 a.m.