mtennekes / treemap

R package for treemap visualisation
64 stars 24 forks source link

argument plot = FALSE or draw = FALSE #20

Open timelyportfolio opened 9 years ago

timelyportfolio commented 9 years ago

I dislike argument bloat, but based on https://github.com/timelyportfolio/d3treeR/issues/12 from d3treeR, would it be possible to add an argument to skip the grid drawing piece in lines. Using the contrived example from https://github.com/timelyportfolio/d3treeR/issues/12 with 4000 rows, here is the lineprof view.

image

I hesitate to even ask since treemap was designed for output, but would it be possible to add an argument to skip the plotting for use with d3treeR or other potential piggybacking packages?

mtennekes commented 9 years ago

Sure, no problem! Please try the latest version. It's a quick and dirty solution though: it still generates a grid.newpage(), with all its viewports. I cannot simply ignore that, since this also results in the aspect ratio that is needed to run the rectangle placement algorithm. A more elegant solution would be to let the desired aspect ratio be determined by the user in case draw=FALSE.

timelyportfolio commented 9 years ago

This is great. Sorry been really sick all week so just getting a chance to check it out. I'll use grid.grep to look for a legend in d3treeR so we know either a legend was not drawn or draw = FALSE. However, would it be worthwhile to add the value of draw in the invisibly returned list. Happy to submit pull if you would like.

mtennekes commented 9 years ago

Done