icontainer: Creates a new interactive container

Description Usage Arguments Details Value Note See Also Examples

Description

icontainer creates a new interactive container. Containers are used to group interactive visual objects (such as plots) and can be nested.

Usage

1
icontainer(parent = NULL, window, frame, flags)

Arguments

parent

parent container to register with. If NULL this container is created on its own.

window

window to place this container into. If not specified a window is created and filled with this container.

frame

numeric vector of the form c(x, y, with, height) specifying the size and location of the container

flags

flags defining the behavior of this container when the parent container of window are resized

Details

Containers can contain any visual object in the iPlots eXtreme graphics system. Most commonly such objects are plots, R graphics devices or further containers. The flags of each obejct define how it will respond to resize events. Containers automatically handle the resizing of their children.

The model for resizing is that each object can choose to fix its borders with respect to any of the four sides of its parent. Any sides that are not fixed will grow proportinally. The default is to be fixed to all four sides (or from the other point of view full expansion in both directions) which simply fills all available space.

The currently supported flags are:

"fix.top"

fixed at the top

"fix.bottom"

fixed at the bottom

"fix.left"

fixed at the left margin

"fix.right"

fixed at the right margin

"xspring"

expands along the x axis (by fixing both ends) - same as c("fix.left","fix.right")

"yspring"

expands along the y axis (by fixing both ends) - same as c("fix.top","fix.bottom")

"xyspring"

expands in all directions (by attaching all four margins) - same as the combination of all fix attributes above

The window parameter can be either NULL is which case a new window is created and filled with the container (the size of the window is thus defined by the size of the container) or FALSE in which case an off-screen container is created to be attached to a window later or a window object (of the clas iWindow).

Value

Object of the class iContainer.

Note

Operations on the container object are by default not followed by an implicit redraw (as is the case for plots) to allow contruction of complex layouts without unnecessary redraws. Please use redraw after all components have been added to a container.

See Also

iplot, redraw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# create a container (implicitly creates a new window)
a = icontainer(frame=c(0,0,400,300))

# create some random plots off-screen (window=FALSE)
x = rnorm(1000)
y = rnorm(1000)
p = iplot(x, y, window=FALSE, frame=c(0,0,200,300),
        flags=c("fix.left","fix.top","fix.bottom"))
q = iplot(y, x, window=FALSE, frame=c(200,0,200,300),
        flags=c("fix.right","fix.top","fix.bottom"))

# add the plots to the container and redraw
redraw(a + p + q)

att/iplots documentation built on May 10, 2019, 2:12 p.m.