Skip to content

Show plot history#181

Merged
andycraig merged 4 commits intoREditorSupport:masterfrom
renkun-ken:plot-history
Jan 24, 2020
Merged

Show plot history#181
andycraig merged 4 commits intoREditorSupport:masterfrom
renkun-ken:plot-history

Conversation

@renkun-ken
Copy link
Copy Markdown
Member

@renkun-ken renkun-ken commented Jan 8, 2020

What problem did you solve?

Closes #171

This PR:

  • Preserves historic plots in {tempdir}/images by updating the history plot file on plot.new and grid.new hook.
  • Adds a command Show Plot History to show a WebView of historic plots.
  • Fotorama is used in the WebView to present the plot history that provides thumbnails of images and allows user to navigate via click and arrow keys.

Known limitation:

  • Currently, we replay plot on task callback, i.e. top level of user input. If user uses par(mfrow = c(a, b)) and produces multi-page images in a single callback (i.e. create plots of more than a*b so the page is cleared and a new page is created), only the last page can be replayed.
  • If user uses par(mfrow = c(a, b)), when user adds a plot to the current page, it will be regarded as a new plot and saved to a new history plot file since I don't know a way to know if a page is flushed. For example, for par(mfrow = c(1, 2)), and user runs plot(rnorm(100)) twice, two plots files are preserved as history plots, unless user produces two plots in a single callback.

(If you have)Screenshot

image

@renkun-ken renkun-ken changed the title WIP: Plot history Show plot history Jan 9, 2020
@andycraig andycraig merged commit 9b54764 into REditorSupport:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve plot history

2 participants