output_plot: Add a plot to a webpage

View source: R/output_plot.R

output_plotR Documentation

Add a plot to a webpage

Description

Adds a Plotly plot to a webpage, based on specified or selected variables.

Usage

output_plot(x = NULL, y = NULL, color = NULL, color_time = NULL,
  dataview = NULL, id = NULL, click = NULL, subto = NULL,
  options = list(), plotly = TRUE)

Arguments

x

The name of a variable, or ID of a variable selector to plot along the x-axis.

y

The name of a variable, or ID of a variable selector to plot along the y-axis.

color

The name of a variable, or ID of a variable selector to use to color lines.

color_time

The ID of a selector to specify which timepoint of color to use.

dataview

The ID of an input_dataview component.

id

Unique ID for the plot.

click

The ID of an input to set to a clicked line's ID.

subto

A vector of output IDs to receive hover events from.

options

A list of configuration options, with named entries for any of data, layout, or options, potentially extracted from a saved plotly object (see Plotly documentation), if plotly is TRUE.

plotly

Logical; if TRUE, uses Plotly.

Value

A character vector of the content to be added.

Examples

# for mpg ~ wt * am in a site based on mtcars data
output_plot("wt", "mpg", "am")

uva-bi-sdad/community documentation built on Oct. 12, 2023, 1:18 p.m.