flash: ActionScript Graphics Device

Description Usage Arguments Value Author(s) See Also Examples

Description

This graphics device is the one responsible for generating ActionScript code that displays R plots in Flash based on high-level graphics objects within Flash.

We typically use mxmlDevice to generate and compile an entire Flash application that can be viewed directly or in a Web browser.

Usage

1
2
3
4
flash(file, dim = c(1000, 800), col = "black", fill = "transparent",
      ps = 10, font = Font(findFontFile("arial.ttf"), "arial", 1, ps),
      wrapup = writeCode, top = 0, left = 0, ...,
      funs = dummyDevice( obj = new("FlashDeviceMethods")))

Arguments

file

to where the generated code should be written. This can be the name of a local file, or a connection.

dim

a numeric vector of length 2 giving the width and height of the graphics device.

col

the "initial" color to use for drawing.

fill

the initial color to use for filling rectangles, circles, polygons, etc.

ps

the initial point size for fonts.

font

a Font object specifying the default font to use in the plot(s).

wrapup

a function that is called when the device is closed. This is invoked with a list with an element for each of the generated plots and each element is a character vector containing the generated code. The second argument is file. The ... collection for this function is also passed to provide additional customization parameters.

top

the offset (an integer) for the top of the plot relative to the Flash application. This can be used to leave space at the top of the application for other components.

left

the offset (an integer) for the left side of the plot relative to the Flash application. This can be used to leave space at the left side of the application for other components.

...

additional parameters passed directly to wrapup.

funs

a collection of functions that provide implementation for the methods of the graphics device for drawing, e.g., circles, lines, text, polygons, etc. This an object of class FlasDeviceMethods, or derived from RDevDescMethods at least.

Value

A reference to the C-level device. This is an object of class DevDescPtr-class.

Author(s)

Duncan Temple Lang

See Also

mxmlDevice

Examples

1
2
3
 flash("bob.as")
   plot(1:10)
 dev.off()

duncantl/FlashMXML documentation built on May 15, 2019, 5:26 p.m.