diff --git a/DESCRIPTION b/DESCRIPTION index 2ac6300cdb..318fd9d49b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -78,7 +78,7 @@ Suggests: rsvg, ggridges LazyData: true -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Encoding: UTF-8 Roxygen: list(markdown = TRUE) Config/Needs/check: diff --git a/NAMESPACE b/NAMESPACE index a181db4ad9..1512977bb3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -40,6 +40,9 @@ S3method(print,api_grid_local) S3method(print,api_plot) S3method(print,kaleidoScope) S3method(print,plotly_data) +S3method(process,api_image) +S3method(process,api_plot) +S3method(process,default) S3method(to_basic,GeomAbline) S3method(to_basic,GeomAlluvium) S3method(to_basic,GeomAnnotationMap) diff --git a/R/animate.R b/R/animate.R index 25ffa28433..16a6878c5a 100644 --- a/R/animate.R +++ b/R/animate.R @@ -122,7 +122,6 @@ animation_opts_defaults <- function() { } -#' @inheritParams animation_opts #' @param hide remove the animation slider? #' @param ... for `animation_slider`, attributes are passed to a special #' layout.sliders object tied to the animation frames. @@ -149,7 +148,6 @@ animation_slider <- function(p, hide = FALSE, ...) { } -#' @inheritParams animation_slider #' @param label a character string used for the animation button's label #' @export #' @rdname animation diff --git a/R/api_exports.R b/R/api_exports.R index c7123f5590..9172db3ea3 100644 --- a/R/api_exports.R +++ b/R/api_exports.R @@ -107,11 +107,6 @@ #' api("folders", "POST", list(path = "/starts/at/root/and/ends/here")) #' #' } -#' - - -#' @rdname api -#' @export api_create <- function(x = last_plot(), filename = NULL, fileopt = c("overwrite", "new"), sharing = c("public", "private", "secret"), ...) { diff --git a/R/orca.R b/R/orca.R index 1f9f988742..df0398d783 100644 --- a/R/orca.R +++ b/R/orca.R @@ -97,7 +97,6 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file), #' Orca image export server #' -#' @inheritParams orca #' @param port Sets the server's port number. #' @param keep_alive Turn on keep alive mode where orca will (try to) relaunch server if process unexpectedly exits. #' @param window_max_number Sets maximum number of browser windows the server can keep open at a given time. diff --git a/R/plotly.R b/R/plotly.R index 76dd6b64c8..c61db84253 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -15,12 +15,12 @@ #' help inform default axis/scale titles #' (e.g., `plot_ly(x = mtcars$wt)` vs `plot_ly(x = ~mtcars$wt)`) #' -#' @param data A data frame (optional) or [crosstalk::SharedData] object. #' @param ... Arguments (i.e., attributes) passed along to the trace `type`. #' See [schema()] for a list of acceptable attributes for a given trace `type` #' (by going to `traces` -> `type` -> `attributes`). Note that attributes #' provided at this level may override other arguments #' (e.g. `plot_ly(x = 1:10, y = 1:10, color = I("red"), marker = list(color = "blue"))`). +#' @param data A data frame (optional) or [`crosstalk::SharedData`] object. #' @param type A character string specifying the trace type (e.g. `"scatter"`, `"bar"`, `"box"`, etc). #' If specified, it *always* creates a trace, otherwise #' @param name Values mapped to the trace's name attribute. Since a trace can diff --git a/R/plotly_data.R b/R/plotly_data.R index ddd5de4263..38dcb8c780 100644 --- a/R/plotly_data.R +++ b/R/plotly_data.R @@ -87,16 +87,17 @@ print.plotly_data <- function(x, ...) { #' Highlight/query data based on primary key #' -#' This function simply creates an object of class [crosstalk::SharedData]. -#' The reason it exists is to make it easier to teach others how to leverage -#' its functionality in plotly. It also makes it more discoverable if one -#' is already aware of [highlight]. +#' This function simply creates an object of class [`crosstalk::SharedData`]. +#' The reason it exists is to make it easier to teach others how to leverage its +#' functionality in plotly. It also makes it more discoverable if one is already +#' aware of [highlight()]. #' #' @param x a plotly visualization or a `data.frame`. -#' @param ... arguments passed to `crosstalk::SharedData$new()` +#' @param ... arguments passed to +#' [`crosstalk::SharedData$new()`][crosstalk::SharedData]. #' @export #' @author Carson Sievert -#' @return An object of class [crosstalk::SharedData] +#' @return An object of class [`crosstalk::SharedData`]. #' @seealso [highlight] highlight_key <- function(x, ...) { UseMethod("highlight_key") diff --git a/R/process.R b/R/process.R index bd987b0f21..bb422e6839 100644 --- a/R/process.R +++ b/R/process.R @@ -6,14 +6,17 @@ process <- function(resp) { UseMethod("process") } +#' @export process.default <- function(resp) { json_content(relay_error(resp)) } +#' @export process.api_plot <- function(resp) { json_content(relay_error(resp)) } +#' @export process.api_image <- function(resp) { relay_error(resp) type <- resp[["headers"]][["content-type"]] diff --git a/man/add_trace.Rd b/man/add_trace.Rd index 5c36652c78..bd0c9d0703 100644 --- a/man/add_trace.Rd +++ b/man/add_trace.Rd @@ -126,7 +126,7 @@ See \code{\link[=schema]{schema()}} for a list of acceptable attributes for a gi provided at this level may override other arguments (e.g. \code{plot_ly(x = 1:10, y = 1:10, color = I("red"), marker = list(color = "blue"))}).} -\item{data}{A data frame (optional) or \link[crosstalk:SharedData]{crosstalk::SharedData} object.} +\item{data}{A data frame (optional) or \code{\link[crosstalk:SharedData]{crosstalk::SharedData}} object.} \item{inherit}{inherit attributes from \code{\link[=plot_ly]{plot_ly()}}?} diff --git a/man/highlight_key.Rd b/man/highlight_key.Rd index 85766bf424..079921cd34 100644 --- a/man/highlight_key.Rd +++ b/man/highlight_key.Rd @@ -9,16 +9,17 @@ highlight_key(x, ...) \arguments{ \item{x}{a plotly visualization or a \code{data.frame}.} -\item{...}{arguments passed to \code{crosstalk::SharedData$new()}} +\item{...}{arguments passed to +\code{\link[crosstalk:SharedData]{crosstalk::SharedData$new()}}.} } \value{ -An object of class \link[crosstalk:SharedData]{crosstalk::SharedData} +An object of class \code{\link[crosstalk:SharedData]{crosstalk::SharedData}}. } \description{ -This function simply creates an object of class \link[crosstalk:SharedData]{crosstalk::SharedData}. -The reason it exists is to make it easier to teach others how to leverage -its functionality in plotly. It also makes it more discoverable if one -is already aware of \link{highlight}. +This function simply creates an object of class \code{\link[crosstalk:SharedData]{crosstalk::SharedData}}. +The reason it exists is to make it easier to teach others how to leverage its +functionality in plotly. It also makes it more discoverable if one is already +aware of \code{\link[=highlight]{highlight()}}. } \seealso{ \link{highlight} diff --git a/man/plot_ly.Rd b/man/plot_ly.Rd index b32d197483..c287d35d6f 100644 --- a/man/plot_ly.Rd +++ b/man/plot_ly.Rd @@ -31,7 +31,7 @@ plot_ly( ) } \arguments{ -\item{data}{A data frame (optional) or \link[crosstalk:SharedData]{crosstalk::SharedData} object.} +\item{data}{A data frame (optional) or \code{\link[crosstalk:SharedData]{crosstalk::SharedData}} object.} \item{...}{Arguments (i.e., attributes) passed along to the trace \code{type}. See \code{\link[=schema]{schema()}} for a list of acceptable attributes for a given trace \code{type}