Skip to content
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

large matrices cannot be opened in any browser #65

Open
stanstrup opened this issue May 25, 2016 · 3 comments
Open

large matrices cannot be opened in any browser #65

stanstrup opened this issue May 25, 2016 · 3 comments

Comments

@stanstrup
Copy link

I know this is not really a bug but I was hoping there would be some solution.

I am trying to visualized a 1500x1500 correlation matrix. R crashes if I try to show it directly.
I can write it to a file with saveWidget but no browsers are able to show it (most crashes or simply shows nothing in the end waiting for a script to finish).
The html file is 25MB.

Is there something I can try to make this work or can d3heatmap be optimized somehow?

@talgalili
Copy link
Owner

Hi @stanstrup -

You can have a look at the new heatmaply package:
https://github.com/talgalili/heatmaply

It uses the plotly.js engine and can deal with larger matrix sizes (which was one of the reason I started working on it).

However, I suspect that 1500x1500 may be a bit too much (because of the overhead of parts of the code, actually plot.ly CAN deal with such a matrix). Try it, and if it doesn't work you can use the native haetmap of plot.ly (which wouldn't include the dendrograms)

n <- 200
x <- matrix(rnorm(n*n), nrow = n)

library(heatmaply)
heatmaply(x)

For larger n:

library(plotly)
plot_ly(z = x, type = "heatmap")

@stanstrup
Copy link
Author

Thanks. That does seem to work. Even heatmaply.
There seem to be some other smaller issues that I will report in your repo when I have investigated a bit more the minimal trigger.

@talgalili
Copy link
Owner

The heatmaply R package is a new implementation of interactive cluster heatmaps in R which relies on the plotly R package. This is based on a fork of my work in d3heatmap.

The package is availabale from CRAN:
https://cran.r-project.org/package=heatmaply

The feature you've requested is now available by using the new plotly plot_method, for example, using the following code (you can play with larger numbers, and it can still handle them much better than d3heatmap):

library(heatmaply)
bix_x <- matrix(1:10000, 100,100)
heatmaply(bix_x, plot_method = "plotly")

image

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