ropensci / iheatmapr

Complex, interactive heatmaps in R
https://docs.ropensci.org/iheatmapr
Other
267 stars 35 forks source link

Fix plotly dependencies #7

Closed alanocallaghan closed 7 years ago

alanocallaghan commented 7 years ago

Address #6

AliciaSchep commented 7 years ago

Thanks @Alanocallaghan for noticing and fixing this issue!

One issue I am noticing though with new plotly + this patch is that in an rmarkdown only the first plot made by iheatmapr shows up in the html. However, if a regular plotly plot is added as well, then all the plots show up...

alanocallaghan commented 7 years ago

If you post an example I'll look into it

AliciaSchep commented 7 years ago

The vignette is an example -- adding plotly::plot_ly(x =1:5,y=1:5) in a chunk anywhere in the document seems to make the problem go away

alanocallaghan commented 7 years ago

Bizarre! A workaround would be to put that in a block starting {r, echo=FALSE} but that's not a great fix

AliciaSchep commented 7 years ago

It seems like adding in the additional dependencies that plotly r package uses, in particular crosstalk::crosstalkLibs() is necessary for multiple iheatmapr plots to show up in rmarkdown. Adding a plotly plot was a fix because the html would then load those libraries when making the plot.

AliciaSchep commented 7 years ago

Hi @Alanocallaghan, I decided to address the problem a different way, by removing the dependency on plotly r package in order to have more control over things like the version of plotly.js and other aspects of making the htmlwidget (as outlined in #7). I'm going to close this pull request and the corresponding issue. Thanks again for detecting this problem and suggesting a fix!