[rkward-devel] plot history featrues
Prasenjit Kapat
kapatp at gmail.com
Mon Sep 6 22:40:00 UTC 2010
Hi,
Since I am trying do this from scratch, let me try to chalk out the
intended features and expected caveats. So please comment with your
suggestion / objections.
A. a global history - all managed screen devices will share it.
B. ignore preview devices completely
C. a STATIC global switch (checkbox) to enable / disable the plot
history feature. STATIC means: "toggling the checkbox will only affect
new sessions of rkward, not the running ones"
- this global switch should be used to enable/disable the menu/toolbar
actions as well
Features:
1. history length restriction
2. duplicating a device:
- behave as if the duplicated plot is "new" ie do not alter the old plot
- when/if, possible to determine (reliably) that this "new" duplicated
plot and old plot (duplicated from) are identical, do not save this
new plot, otherwise always add it to the history at a new position
3. multiple plots on the screen:
- check for par (mfig) and graphics:::.SSexists ("sp.screens")
4. save the history list when rkward closes - not for this release
- as part of the "save workspace"?
- Windows uses .GlobalEnv::.savedPlots right from the beginning
- when loading, replace the existing plot history by the loaded one?
5. Actions:
a. first / prev / next / last
b. remove plot (has to be implemented due to 1.)
c. append plot
d. insert plot
e. overwrite/replace plot (insert then remove)
f. clear history
g. plot properties
5a. first / prev / next / last
- always record
- if the recorded version is not identical (see *1) to the old one and
if the same plot is displayed on multiple devices, then save this
recorded plot in place on the current device but set the status of the
plots on all these "other" devices as "new"
- if the number of these "other" devices > 1, then no way to avoid
duplicated plots (err on the conservative side!) (see *2)
5b. remove plot
- if the user removes a plot from a device then replay the "next
available" plot on this device
- if this removed plot is displayed on any "other" device(s) then set
their status to "new"
- again, if after removal, more than one "other" device displays the
removed plot, then set these as "new" - no reliable way to avoid
duplicated plots in the history (see *2)
5c. append plot
- no matter what the current status is, this action should always
append the displayed plot to the history
- this is a safe guard action, ie, if some plot does not pass through
the plot.new / print.trellis etc. wrappers then the user still has a
way to add it to the history w/o loosing the plot
5d. Insert plot
- similar to append, but the plot will be "inserted" in the history
- care needs to be taken to avoid copying / moving the whole/part of
the recorded history
5e. Clear history
- after clearing, make the plots displayed on the devices as "new"
5f. Plot properties
- for lattice calls, truncate the call string to a fixed length
- additional status bar? since drop-down menu has been implemented,
this may not be needed.
- for graphics::: functions extract the last plot call from history,
if at all possible - last priority, may not work at all
[*1]
use either identical (a,b) or identical (a[[1]], b[[1]])
[*2]
For plots saved via "a <- recordPlot ()" a[[1]] is all that is
"sufficient" I think. It contains the data as well as the meta data.
In that case, we can hash using digest (a[[1]]) and later (more?)
reliably identify / track duplicated plots in the history? (Make
digest a dependency of rkward or make it modular?)
Regards,
--
Prasenjit
More information about the Rkward-devel
mailing list