Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less hacky way to intercept plot output #3

Open
hafen opened this issue May 9, 2016 · 3 comments
Open

Less hacky way to intercept plot output #3

hafen opened this issue May 9, 2016 · 3 comments

Comments

@hafen
Copy link
Collaborator

hafen commented May 9, 2016

Currently we overwrite R print methods to capture plot output and send it to servr. It would be nice to do this more cleanly with something like addTaskCallback(). I want to keep usage extremely simple, such that nothing is done differently than what you would do if you were operating locally. A potential issue with addTaskCallback() is that I don't think you can know that you need to intercept a plot output until after it has already been written to the default graphics device. Some deeper knowledge of R internals would be useful here...

@lawremi
Copy link

lawremi commented May 9, 2016

Why would you need to intercept plot output before it is rendered? You should be able to just copy from whatever device is active to whatever device lets you capture the output.

@hafen
Copy link
Collaborator Author

hafen commented May 11, 2016

Oh - now it is so obvious! Thanks! We can do that easily for lattice and ggplot, but how do you detect in the callback whether the previous top-level command was a base graphics? The "value" in the callback is NULL in this case.

@lawremi
Copy link

lawremi commented May 11, 2016

For base graphics you will need to take the approach from the evaluate package, which unfortunately means comparing the display list after every task to the previous and if something has changed, push an update.

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

No branches or pull requests

2 participants