-
Notifications
You must be signed in to change notification settings - Fork 24
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
performance times and memory usage? #12
Comments
This can definitely be a problem, since now that I also extract the legend with |
Using |
So, now that @mtennekes has added a library(treemap)
library(d3treeR)
library(dplyr)
#library(lineprof)
Var1 <- letters[1:26]
Var2 <- LETTERS[1:26]
Var3 <- c("Tiger", "Lion", "Bear", "Penguin", "Eagle", "Aardvark")
biggish <- expand.grid(Var1, Var2, Var3)
n <- nrow(biggish)
biggish$Size <- abs(rnorm(n, 12, 3))
biggish$Colour <- rnorm(n, 0, 1)
#lp<-lineprof(
tm <- treemap(biggish, index = c("Var1", "Var2", "Var3"),
vSize = "Size", vColor = "Colour",
type = "value", palette = "Spectral",
fun.aggregate="weighted.mean",draw = FALSE)
#)
#lp2 <- lineprof(
d3tree2(tm)
#)
#shine(lp)
#shine(lp2) |
great, this is much better. From my perspective you could close this issue now if you want. Of course, faster would always be nicer, but the basic un-usability is fixed. |
Yep, faster would be better, but think only way would be to leverage |
With a more complex treemap - say one with 4000 rows - the d3tree2 function takes impractibly long to convert from a treemap object. The final result renders fine - and not too slowly (just) on screen - but for practical purposes you want to create it once-off and save it; you certainly couldn't create it on the fly in a Shiny app. Also, it seems to take a surprisingly large amount of RAM, which makes me wonder if there is some kind of efficiency to be found somewhere. Example below is similar in size to a real world dataset for which the end result is ok, just very slow to generate. On my (not particularly high powered) machine the example below takes 66 seconds to create the original treemap object, 30 minutes to convert it to a d3 tree, and about 12 seconds to actually render it in a browser. The memory utilised shoots straight up to 4GB as soon as d3tree2() starts doing its thing, and then stays at that high level until R is shut down even though there are no objects of anywhere near that size in the R workspace.
The text was updated successfully, but these errors were encountered: