staticPlot {manipulateWidget}R Documentation

Include a static image in a combinedWidgets

Description

staticPlot is a function that generates a static plot and then return the HTML code needed to include the plot in a combinedWidgets. staticImage is a more general function that generates the HTML code necessary to include any image file.

Usage

staticPlot(expr, width = 600, height = 400)

staticImage(file, style = "max-width:100%%;max-height:100%%")

Arguments

expr

Expression that creates a static plot.

width

Width of the image to create.

height

Height of the image to create.

file

path of the image to include.

style

CSS style to apply to the image.

Value

a shiny.tag object containing the HTML code required to include the image or the plot in a combinedWidgets object.

Examples

staticPlot(hist(rnorm(100)))

if (require(plotly)) {
  data(iris)

  combineWidgets(
    plot_ly(iris, x = ~Sepal.Length, type = "histogram", nbinsx = 20),
    staticPlot(hist(iris$Sepal.Length, breaks = 20), height = 300)
  )

  # You can also embed static images in the header, footer, left or right
  # columns of a combinedWidgets. The advantage is that the space allocated
  # to the static plot will be constant when the window is resized.

  combineWidgets(
    plot_ly(iris, x = ~Sepal.Length, type = "histogram", nbinsx = 20),
    footer = staticPlot(hist(iris$Sepal.Length, breaks = 20), height = 300)
  )
}


[Package manipulateWidget version 0.11.1 Index]