-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Changes to allow rgl (and other?) graphics systems to work like base graphics #1892
Conversation
Travis seems confused: some checks have been sitting there for a few days, stuck at "Queued -- Build Created". |
Update patch branch from upstream.
The main branch of |
* Allow custom output handler in evaluate_and_highlight. * Allow packages like rgl to have low level and high level objects (see yihui/knitr#1892)
Merge branch 'master' into rglpatch # Conflicts: # R/block.R
Similar changes to these were merged into
If you'd like one or both of those changes in this PR, I'd be happy to make them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall. I'll make some minor and doc changes before merging. Thanks!
Great! |
This patch is related to my comments on #1881 and my issue #1853, to allow
rgl
to work more seamlessly withknitr
. The idea is that, like base graphics,rgl
has "high level" and "low level" commands to change the current display, and users typically only want to see output when a new high level command is run.To do this, I needed to export two internal functions from
knitr
:wrap()
andis_low_change()
. I also needed to changeis_low_change()
to a generic function, so the test for low versus high could take place inrgl
, and I introduced a new class name,"knit_other_plot"
so thatknitr
could tell that myrgl
graphics objects are actually plots that need handling. The access towrap()
allowsrgl
graphics to efficiently share data: if part of a plot has previously appeared, it won't be written to the HTML output.This PR shouldn't have bad effects on anyone as far as I know. The current development version of
rgl
on R-forge doesn't take advantage of the changes; it uses a complicated (and fragile, I worry) set of hooks to replace a bunch of code inknitr
. You can see the code that does work with this PR in https://github.com/dmurdoch/rgl branchrglpatch
.