-
Notifications
You must be signed in to change notification settings - Fork 14
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
HTMLWidgets and xmlSVG not rendering #20
Comments
Thank you for pointing that out. I didnt notice that those examples broke. |
can you paste the I can render the sliders in the rstudio IDE the plots, there seems to be a problem with the standalone output for the xmlSVG and how it is rendered in the browser (in my case chrome). |
I tried to run with regular plots and a ggplot. Neither one renders.
|
Hi You are running slickr v0.2.4, can you update to the GH master (slickR v0.4) and try again please. remotes::install_github('metrumresearchgroup/slickR') Thanks |
Also what browser/version are you using to open the rendered file on? I see that there is a problem on
but not on
|
cc @timelyportfolio @lionel- any ideas why the standalone svg+xml from {svglite} would be having problems on those browsers? |
Are the SVGs included inline? We had problems with inline SVGs in vdiffr before this fix: r-lib/vdiffr#51 I'm not knowledgeable in the matter unfortunately. |
Yes they are inline. thanks for the link |
@osker130 this should work for you. I'll update the html link that is with the package. library(svglite)
library(ggplot2)
library(slickR)
plotsToSVG=list(
#Standard Plot
xmlSVG({plot(1:10)},standalone=TRUE),
#ggplot
xmlSVG({show(ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width,colour=Species))+
geom_point())},standalone=TRUE)
)
hash_encode_url <- function(url){
gsub("#", "%23", url)
}
#make the plot self contained SVG to pass into slickR
s.in=sapply(plotsToSVG,function(sv){
hash_encode_url(paste0("data:image/svg+xml;utf8,",as.character(sv)))
})
slickR(s.in,slideId = 'ex4',slickOpts = list(dots=T), height = 200,width = '100%')
|
@yonicd @lionel- thank you both! @yonicd your solution works well. The svgs now render fine. Any thoughts on the HTML widgets? I tried the slickR v0.4 update yesterday when I was having problems and then reverted after concluding that the update wasn't the solution. My goal is to use these in an Rshiny application. Most users will be accessing with google chrome as their default browser. |
which html widget didn't work? i have those examples working on my side. |
This one wont render in RStudio. I'm left with grey boxes for leaflet and white boxes for plottly. The widgets work fine as standalones.
|
It’s a known problem that Iframes don’t in render in the rstudio viewer, only in the browser |
Got it thank you!
…On Wed, Aug 28, 2019 at 11:07 AM yonicd ***@***.***> wrote:
Closed #20 <#20>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACQ5BKR3ZFNZM5BLM3H5MB3QG2IC7ANCNFSM4HBRANCA>
.
|
Hello,
I love the potential of this package. However, I notice that many of the examples are not rendering in the official readme: https://metrumresearchgroup.github.io/slickR/. I ran the code on my own machine and reproduced the problem. Any ideas?
J
The text was updated successfully, but these errors were encountered: