[Rd] Scripting SVG with R
shane.conway at gmail.com
Thu Oct 21 16:33:35 CEST 2010
This is slightly tangential, but I would just add some notes related
to things that I had worked on (in various stages of completion).
1) I wrapped most of the Protovis primitives in an R package called
webvis (http://cran.r-project.org/web/packages/webvis/). If you're
not familiar, Protovis is an excellent low-level plotting package in
lab at Stanford (http://vis.stanford.edu/). Protovis produces SVG
graphics as the output. As a first pass, I decided to just use the
calling demo("playfairs.wheat") or looking at the plot.webvis help
directly in R. To that end, I started working on another package that
would wrap the javax.script.* library using rJava. This works for me,
and it allows you to pass code in any scripting language that runs on
something like Protovis: you need the complete web browser context.
You can get this by using env-js (http://www.envjs.com/). But that
Rhino) in javax.script wasn't the latest, so I would need to use Rhino
directly (you can see part of my discussion that here:
That's where I stopped.
What would the end result of webvis be so far as it pertains to your
problem? With a small amount of effort, it would be pretty straight
R. I had envisioned that this would be more useful for an interactive
R session, but I know of one project (RNode) that's currently using it
from a browser through Rserve (see
Hope that this is useful.
On Fri, Oct 15, 2010 at 11:06 AM, Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> I am currently working on this very thing under Duncan Temple Lang. Or, to
> be more precise what you are describing is one piece of our overarching
> goal, which is to create a system in which R can be run from within a
> browser (currently FireFox) with bi-directional communication occurring
> example, build web pages which can contain both R code (which can be
> executed in-browser) and "live"graphics devices in the form of
> for the building of rich, easily customizable GUIs for R through the
> (relatively painless though not easy to do well) process of designing
> interactive/multimedia web pages.
> Duncan has done quite a bit of work of this nature in the past, even going
> so far as embedding R in the Netscape browser some 10 years ago
> (SNetscape<http://www.omegahat.org/SNetscape/>note this is quite
> outdated now). More recently, last summer he created a
> package (RFirefox, not currently available, see below) which embeds R within
> down into R (so R code can be evaluated and the results passed back up to
> under his supervision. Currently the installation/configuration is _very_
> fragile/nonexistent, and as I said, only one direction of communication is
> possible. We are currently working on implementing communication with
> objects/methods from within R. This will allow us to draw to draw directly
> (and not so useful) capabilities.
> We hope to have a usable alpha/proof-of-concept release with bi-directional
> procedure sometime within the next few weeks (3-6), with a paper, live
> examples, and a more complete/robust package to follow.
> Glad to see there is some interest :)
> Gabe Becker
> On Wed, Oct 13, 2010 at 8:30 AM, Wolfgang Huber <whuber at embl.de> wrote:
> > Since now many browsers support (ECMA/Java-)scripted SVG, I am wondering
> > whether there are already any examples of inserting R code into SVG
> > interactive?
> > I am aware of the excellent packages gridSVG and SVGAnnotation, which
> > facilitate making R-generated SVG plots more interesting either at
> > construction time or by postprocessing; the above question is about
> > employing R at viewing time.
> > Best wishes
> > Wolfgang Huber
> > EMBL
> > http://www.embl.de/research/units/genome_biology/huber
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
More information about the R-devel