Skip to content

Commit

Permalink
Can't assume we have cairo capabilities in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Aug 17, 2021
1 parent 797d2a7 commit 30fbc11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions R/images.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ capturePlot <- function(expr, filename = tempfile(fileext = ".png"),
#'
#' if (interactive()) img
#'
#'
#' svg <- plotTag(plot(pressure), "A plot of the 'pressure' dataset",
#' device = grDevices::svg, width = 375, height = 275, pixelratio = 1/72,
#' mimeType = "image/svg+xml")
#'
#' if (interactive()) svg
#' if (interactive() && capabilities("cairo")) {
#' plotTag(
#' plot(pressure), "A plot of the 'pressure' dataset",
#' device = grDevices::svg, width = 375, height = 275, pixelratio = 1/72,
#' mimeType = "image/svg+xml"
#' )
#' }
#'
#' @export
plotTag <- function(expr, alt, device = defaultPngDevice(), width = 400, height = 400,
Expand Down
13 changes: 7 additions & 6 deletions man/plotTag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30fbc11

Please sign in to comment.