-
-
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
Using fig.cur
in rgl (or another htmlwidget)?
#2241
Comments
This seems related to #2169, but I don't think |
I have a better suggested change: the |
Thanks! I've tested this, and it's now working fine in the devel version of rgl. |
Great! Thanks for testing! I just submitted the dev version to CRAN. Hopefully it will be on CRAN in a couple of days. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
In
rgl
I'd like to include alt text in the displays. For regular plots, the alt text is found using theoptions$fig.cur
value to index intooptions$fig.alt
.This code determines the
fig.cur
value and uses it to index intofig.alt
:knitr/R/output.R
Lines 495 to 499 in c50d307
where
reduce_plot_opts
does the indexing, changingfig.alt
and some other options to scalars.The code is run very late in the rendering process, because not all lines of code that generate plots result in having them shown in the final document: low level changes (like adding annotations to a base plot) suppress the display of the previous plot. By the time this is run for
rgl
widgets, the data in the widget is fixed, so there's no opportunity forrgl
code to see the appropriate alt text.Would it be possible to include the
fig.cur
value in some attribute of thediv
that wraps the widget? Then I could save the wholefig.alt
vector in thergl
data, and index into it at rendering time.Another approach to solve this would be to dispatch to the next method after
knit_asis
instead of hard-coding theknit_asis_htmlwidget
handling.The text was updated successfully, but these errors were encountered: