Merge pull request #492 from rstudio/bugfix/0.10misc

Miscellaneous bug fixes
This commit is contained in:
Winston Chang
2014-05-23 14:13:29 -05:00
3 changed files with 10 additions and 3 deletions

View File

@@ -42,6 +42,9 @@ plotPNG <- function(func, filename=tempfile(fileext='.png'),
}
pngfun(filename=filename, width=width, height=height, res=res, ...)
# Call plot.new() so that even if no plotting operations are performed
# at least we have a blank background
plot.new()
dv <- dev.cur()
tryCatch(shinyCallingHandlers(func()), finally = dev.off(dv))

View File

@@ -120,8 +120,11 @@ renderPlot <- function(expr, width='auto', height='auto', res=72, ...,
plotFunc <- function() {
# Actually perform the plotting
result <- withVisible(func())
if (result$visible)
print(result$value)
if (result$visible) {
# Use capture.output to squelch printing to the actual console; we
# are only interested in plot output
capture.output(print(result$value))
}
# Now capture some graphics device info before we close it
usrCoords <- par('usr')

View File

@@ -1072,10 +1072,11 @@
this.renderError(el, err);
};
this.renderError = function(el, err) {
this.clearError(el);
if (err.message === '') {
// not really error, but we just need to wait (e.g. action buttons)
$(el).empty();
return this.clearError(el);
return;
}
var errClass = 'shiny-output-error';
if (err.type !== null) {