ropensci / iheatmapr

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

Integration with new function in plotly #33

Open dasiav7 opened 5 years ago

dasiav7 commented 5 years ago

Hi,

Since there is some problem generating pdf of plot like someone discussed before in https://github.com/wch/webshot/issues/28#issuecomment-442886029, I tried orca() function from plotly. However I got the error:

Error in UseMethod("plotly_build") : 
  no applicable method for 'plotly_build' applied to an object of class "c('IheatmapHorizontal', 'Iheatmap')"

So, can it be resolved?

Thank you!

AliciaSchep commented 5 years ago

@dasiav7 This package does not rely on the plotly R package, only on the JS package, so using a function from the R package won't work. Potentially this package could make use of orca (the package https://github.com/plotly/orca , rather than function in plotly R package) for saving files.

However, this package is using a quite old version of plotly.js at this point... it should likely be updated at some point. I am not sure if that will be a pre-requisite for using 'orca'.

jonmmease commented 5 years ago

Hi @AliciaSchep and @dasiav7,

FWIW, orca is pretty flexible in the versions of plotly.js it supports. If you already ship a bundled version of plotly.js, you can use the --plotly flag to point orca to that particular bundle

orca graph --help
...
  --plotly [or --plotlyjs, --plotly-js, --plotly_js, --plotlyJS, --plotlyJs]
    Sets the path to the plotly.js bundle to use.
    This option can be also set to 'latest' or any valid plotly.js server release (e.g. 'v1.2.3'),
    where the corresponding plot.ly CDN bundle is used.
    By default, the 'latest' CDN bundle is used.
...
AliciaSchep commented 5 years ago

Thanks @jonmmease, will try it out

dasiav7 commented 5 years ago

Thanks @jonmmease & @AliciaSchep !

alanocallaghan commented 11 months ago

Orca is deprecated, the new solution is kaleido, though I've not been able to get either working on my machine recently