treemap icon indicating copy to clipboard operation
treemap copied to clipboard

argument plot = FALSE or draw = FALSE

Open timelyportfolio opened this issue 9 years ago • 3 comments

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?

timelyportfolio avatar Jul 28 '15 23:07 timelyportfolio

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.

mtennekes avatar Jul 29 '15 16:07 mtennekes

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.

timelyportfolio avatar Aug 01 '15 00:08 timelyportfolio

Done

mtennekes avatar Aug 18 '15 07:08 mtennekes