Hi, On Saturday 19 June 2010, Prasenjit Kapat wrote: > Looking at Deepayan's reply: > http://article.gmane.org/gmane.comp.lang.r.debian/1268 > > i think it might be "easy" to implement the history part (paginated > device may be more difficult) for our graphics device. > > The idea would be to store the plotting calls into a list > (.rk.something) and with two top level menu entries ('<' and '>') on > the graphics window we could flip through the list... > > Is it at all easy to implement, or am I hallucinating?
first a technical note: The graphics device in RKWard is simply the native R device. All we do is to "capture" that window, and add our own menus to it. Thus, the difficult part remaining from Deepayan's mail is 1: figuring out just when R is about to overwrite the existing plot with something new (alternatively: figuring out, when a plot has been completed). Unfortunately, the hook in plot.new() gets called directly *after* the previous plot has been blanked, so that is too late for our purpose. I suppose it might be possible to override plot.new() using assignInNamespace(). See the bottom of internal.R for our procedure to override "menu" and "select.list" in the "utils" package (rk.fix.assignments() is called during initialization). The main work would be done in R: If you can come up with R code that gets called for every new plot (in the onscreen device), and saves the previous plot into a list (perhaps limiting the total object.size() of saved plots to some user-definable amount), then adding a gui to flip through the list will indeed be easy. (Of course there are some additional questions to find an answer for, such as: Keep a separate list for each device window, or a single list for all? Clear the list, when the corresponding device windows is closed?) Regards Thomas
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________ RKWard-devel mailing list RKWard-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rkward-devel