iheatmapr icon indicating copy to clipboard operation
iheatmapr copied to clipboard

Integration with new function in plotly

Open dasiav7 opened this issue 7 years ago • 5 comments

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!

dasiav7 avatar Nov 29 '18 16:11 dasiav7

@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'.

AliciaSchep avatar Nov 30 '18 04:11 AliciaSchep

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.
...

jonmmease avatar Dec 03 '18 11:12 jonmmease

Thanks @jonmmease, will try it out

AliciaSchep avatar Dec 04 '18 06:12 AliciaSchep

Thanks @jonmmease & @AliciaSchep !

dasiav7 avatar Dec 04 '18 07:12 dasiav7

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

alanocallaghan avatar Aug 11 '23 16:08 alanocallaghan