rstudio/ggvis — pull request #66 by jjallaire (2013-10-13 10:20:09+00:00)
Title: specify height in call to internal viewer

Formerly the RStudio Viewer pane maximized to take all available vertical space. This was problematic especially for the case of users configured with the Console in the top-right pane. As of RStudio v0.98.423 the viewer function takes an additional height parameter that can be used to request a desired height (excluding the parameter simply uses the current pane height). RStudio will attempt to provide the requested height subject to the constraint of the opposing pane staying at least 160 pixels high (7 lines of text in the Console).

This change hard-codes the requested height to 600 pixels (about what's currently necessary to show a ggvis plot without extra interaction controls). There are two additional refinements we'll ultimately want to make:

- Request less space once we've hidden the standard renderer/download controls. I did some testing and discovered that on an 800 pixel high monitor the ideal height is about 400 pixels so this is probably a good number to shoot for.

- Request some additional space for interaction controls when they are present. We'll also want to do some work to minimize how much vertical space is occupied by interaction controls (e.g. by trying to get two controls per line).

Note that if a height request can't be satisfied there are two possible remedies: (1) ggvis could detect the window height and scale the plot down accordingly; or (2) The window could be allowed to scroll which would serve as a prompt for the user to manually resize the pane as they see fit.

One other change here is the querying of the ggvis.view_internal option to allow the user to specify that they always want plots viewed in an external browser. Wasn't exactly sure how to integrate this with the new opts() function but it seems like this would be desirable.