8000 save_iheatmap rendering blank output · Issue #111 · ropensci/iheatmapr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

save_iheatmap rendering blank output #111

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

Open
tabulez opened this issue Oct 3, 2024 · 10 comments
Open

save_iheatmap rendering blank output #111

tabulez opened this issue Oct 3, 2024 · 10 comments

Comments

@tabulez
Copy link
tabulez commented Oct 3, 2024

Hi, I am able to render the example heatmap in an RMarkdown html export, but when I try to use save_iheatmap() or try to render the heatmap in the RStudio Viewer, the result is a blank image. Thanks for any help!

`
mat <- matrix(rnorm(24), nrow = 6)

hm <- iheatmap(mat)

save_iheatmap(hm, "example_iheatmap.png")

hm
`

R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/New_York
tzcode source: internal

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

other attached packages:
[1] iheatmapr_0.7.1

loaded via a namespace (and not attached):
[1] cli_3.6.2 knitr_1.48 rlang_1.1.3 xfun_0.44
[5] processx_3.8.4 jsonlite_1.8.8 glue_1.7.0 colorspace_2.1-0
[9] htmltools_0.5.8.1 ps_1.7.6 fastcluster_1.2.6 sass_0.4.9
[13] scales_1.3.0 rmarkdown_2.28 evaluate_1.0.0 munsell_0.5.1
[17] jquerylib_0.1.4 fastmap_1.2.0 yaml_2.3.8 lifecycle_1.0.4
[21] compiler_4.4.0 RColorBrewer_1.1-3 htmlwidgets_1.6.4 rstudioapi_0.16.0
[25] farver_2.1.2 digest_0.6.35 R6_2.5.1 callr_3.7.6
[29] magrittr_2.0.3 bslib_0.8.0 webshot_0.5.5 tools_4.4.0
[33] cachem_1.1.0

@alanocallaghan
Copy link
Contributor

I wasn't able to reproduce this yet, I'll revisit tomorrow

@tabulez
Copy link
Author
tabulez commented Oct 8, 2024

I have the same issue on a different system and version of R, although the version of iheatmapr is slightly different

R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 9.4 (Plow)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.21.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] iheatmapr_0.7.0

loaded via a namespace (and not attached):
[1] knitr_1.44 magrittr_2.0.3 munsell_0.5.0 colorspace_2.1-0
[5] R6_2.5.1 rlang_1.1.1 fastmap_1.1.1 fastcluster_1.2.3
[9] tools_3.6.0 webshot_0.5.5 xfun_0.40 cli_3.6.1
[13] htmltools_0.5.6.1 ellipsis_0.3.2 yaml_2.3.7 digest_0.6.33
[17] lifecycle_1.0.3 processx_3.8.2 RColorBrewer_1.1-3 callr_3.7.3
[21] farver_2.1.1 htmlwidgets_1.6.2 ps_1.7.5 evaluate_0.22
[25] rmarkdown_2.25 compiler_3.6.0 scales_1.2.1 jsonlite_1.8.7

@alanocallaghan
Copy link
Contributor

I wouldn't expect it to work on R 3.6.0. Can you try to save a heatmap using eg:

htmlwidgets::saveWidget(iheatmapr::to_widget(iheatmap(matrix(rnorm(100), 10, 10))), "tmp.html")

then open the file in your favourite browser and check for any console errors in the browser devtools?

@tabulez
Copy link
Author
tabulez commented Oct 8, 2024

I'm able to save the heatmap and it renders in the html file with no errors/no messages in the console.

@alanocallaghan
Copy link
Contributor

Oh dear, that's ironically the worst outcome when it comes to debugging. I'll try a different rstudio setup as soon as I can.

Can you check if it works from a regular r session, outside of rstudio? It should pop up your default browser, you can check for console output if it doesn't work

@tabulez
Copy link
Author
tabulez commented Oct 9, 2024

Unfortunately same issue. It can render in a regular R session and I see it pop-up in the browser, it can render the html, but the png output is still blank with save_iheatmap(). I had to add pandoc to my Windows PATH environment since I was seeing this error when I tried to export the image, but it didn't help rendering the png output.

@alanocallaghan
Copy link
Contributor

Hang on, so when you say

try to render the heatmap in the RStudio Viewer

Do you mean viewing a dynamic plot, or a static image?

@tabulez
Copy link
Author
tabulez commented Oct 9, 2024

The dynamic plot. My goal is to have a dynamic plot in the html and save a static version to a png to use in presentations, etc. Exporting the dynamic plot in an html has worked for me, unless I'm in an interactive session and the plot tries to display in the Viewer window rather than the main coding window (i.e. working in an RMarkdown where the plot may display below the coding chunk). I mentioned it in case the dynamic plot not displaying in the Viewer window was related to not being able to save a static version to a png.

@alanocallaghan
Copy link
Contributor
alanocallaghan commented Oct 9, 2024

Hmm, so we have:

  • Rendering iheatmap to HTML file does work
  • Printing iheatmap to console outside RStudio does work
  • Saving iheatmap to png doesn't work
  • Printing/viewing iheatmap in RStudio doesn't work

Am I right?

I can reproduce the blank PNG now, so should be able to look into this soon. Incidentally I ran into this on Linux.

Still can't reproduce the RStudio problem. Are you running a reasonably recent RStudio version?

@tabulez
Copy link
Author
tabulez commented Oct 9, 2024

That's correct! Regarding Linux, I did add Sys.setenv(OPENSSL_CONF="/dev/null") to my .Rprofile to get the html graphics to generate.
I was running rstudio-2024.04.1 and I tried on 2024.09.0; no difference there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0