kbroman / qtlcharts

R/qtlcharts: An R package for interactive QTL graphics
https://kbroman.org/qtlcharts
Other
84 stars 29 forks source link

Can't include multiple interactive plots in ioslides_presentation Rmd files #35

Open kbroman opened 9 years ago

kbroman commented 9 years ago

Reported from Matthew Stephens:

have you tried including multiple interactive plots in an ioslides_presentation .Rmd file? When I do that it seems only one of the plots renders... but when I produce html_document it is fine.

ps it seems to work (almost) ok with output: slidy_presentation instead of ioslides

jjallaire commented 9 years ago

Try updating to the very latest version of htmlwidgets on CRAN (v0.5, submitted yesterday) as it fixes some issues related to multiple widgets in ioslides (also make sure you are using the latest version of the rmarkdown package v0.7).

On Sun, Jun 21, 2015 at 10:56 PM, Karl Broman notifications@github.com wrote:

Reported from Matthew Stephens http://stephenslab.uchicago.edu:

have you tried including multiple interactive plots in an ioslides_presentation .Rmd file? When I do that it seems only one of the plots renders... but when I produce html_document it is fine.

ps it seems to work (almost) ok with output: slidy_presentation instead of ioslides

— Reply to this email directly or view it on GitHub https://github.com/kbroman/qtlcharts/issues/35.

kbroman commented 9 years ago

Thanks, @jjallaire!

kbroman commented 9 years ago

@jjallaire: There still seem to be some problems with ioslides.

I put an example at this gist. When I initially load the html file into a browser, the first plot will display but the others won't. If I refresh, the others will load, but the first one will may then show up strangely, like this:

screen shot 2015-06-22 at 9 06 37 am

I'm getting console errors like this:

screen shot 2015-06-22 at 9 08 34 am

jjallaire commented 9 years ago

I think there's an issue with sizing. With ioslides the invisible slide elements start out as display:none which could throw off your widget. Here's what I did in dygraphs:

https://github.com/rstudio/dygraphs/blob/master/inst/htmlwidgets/dygraphs.js#L97-L104

On Mon, Jun 22, 2015 at 10:09 AM, Karl Broman notifications@github.com wrote:

@jjallaire https://github.com/jjallaire: There still seem to be some problems with ioslides.

I put an example at this gist https://gist.github.com/kbroman/fc28c545dcf7ab034271. When I initially load the html file into a browser, the first plot will display but the others won't. If I refresh, the others will load, but the first one will may then show up strangely, like this:

[image: screen shot 2015-06-22 at 9 06 37 am] https://cloud.githubusercontent.com/assets/53972/8283668/2f941e88-18be-11e5-8b9e-23ce315bdf67.png

I'm getting console errors like this:

[image: screen shot 2015-06-22 at 9 08 34 am] https://cloud.githubusercontent.com/assets/53972/8283688/5178c26a-18be-11e5-8ed9-1d61f3f91a7e.png

— Reply to this email directly or view it on GitHub https://github.com/kbroman/qtlcharts/issues/35#issuecomment-114117187.

stephens999 commented 9 years ago

just to say I also tried the update and still have the problem. Just for the record, since Karl seems to be on it...

sessionInfo() R version 3.2.0 (2015-04-16) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.3 (Yosemite)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] htmlwidgets_0.4

loaded via a namespace (and not attached): [1] htmltools_0.2.6 tools_3.2.0 yaml_2.1.13 rmarkdown_0.7 digest_0.6.8