FlashMXML

FlashMXML_0.2-0.tar.gz (07 February 2010)

This package provides

One of the motivations is to be able to build stand-alone graphical displays from within R that use Flash to display the plots and also to provide many GUI components.

This does not make R available to the Flash run-time engine. The connection between R and Flash is when we generate the Flash code from within R to later render the plots in Flash quite separately.

The mxmlDevice() function creates an MXML application document (and compiles it by default) containing the ActionScript code to display the document. One can augment this MXML document after the device has been closed to annotate the plot with interactive components, event handlers, etc.

The flash() function implements a device that produces just the ActionScript code for the plot. It generates code that creates ActionScript objects of different classes such as RCircle, RLine, RText, RPolyline, RPolygon. These can be redrawn, moved, transformed, etc. and each has an RGContext object that represents the graphical parameters. These can be changed and the object redrawn. This device forms the basis of the mxmlDevice() device which adds processing of the MXML file.

A third device flashDevice is a simpler, more direct rendering of the R plot in Flash. It generates the ActionScript code that draws the lines, circles, polygons, etc. using simpler Sprite objects. The objects do not have knowledge of the original R graphics parameters or the coordinates of their path(s).

This is a very early release that is intended as a prototype and an example of how we might go about leveraging R's graphics from Flash. The graphics device works, but needs some work with respect to fonts and positioning of text. I hope that others will take this and experiment and develop better versions or feedback changes to me to improve this version. All of the code is in R as we use the RGraphicsDevice package. This makes it quite easy to explore alternative implementations of different aspects or write an entirely new device.

Documentation

  • Some examples of post-processing the MXML/ActionScript code to provide interaction. Here we describe how to do this in ActionScript code.
    And some of the generated code. View the swf files for running code, mxml files for the code generated from R.
  • Annotation in R
    This provides examples of how we can post-process the Flash plot in R, rather than ActionScript. Currently we annotate the ActionScript code, but the generation of this code is in R. In the future, we may develop a generic annotation mechanism where one annotates abstract descriptions of the plot elements.
  • Some notes/ideas on implementation.
  • R help files
    There are many more classes and functions that are not exported but should be of interest to anyone wanting to extend this package.
  • Related Packages


    Duncan Temple Lang <duncan@wald.ucdavis.edu>
    Last modified: Sun Feb 7 16:24:37 PST 2010