|
1 | 1 | #' Convert ggplot2 to plotly |
2 | 2 | #' |
3 | | -#' This function converts a \code{\link[ggplot2]{ggplot}()} object to a |
| 3 | +#' This function converts a [ggplot2::ggplot()] object to a |
4 | 4 | #' plotly object. |
5 | 5 | #' |
6 | 6 | #' @details Conversion of relative sizes depends on the size of the current |
7 | 7 | #' graphics device (if no device is open, width/height of a new (off-screen) |
8 | | -#' device defaults to 640/480). In other words, \code{height} and |
9 | | -#' \code{width} must be specified at runtime to ensure sizing is correct. |
| 8 | +#' device defaults to 640/480). In other words, `height` and |
| 9 | +#' `width` must be specified at runtime to ensure sizing is correct. |
10 | 10 | #' |
11 | 11 | #' @param p a ggplot object. |
12 | 12 | #' @param width Width of the plot in pixels (optional, defaults to automatic sizing). |
|
15 | 15 | #' in the tooltip. The default, "all", means show all the aesthetic mappings |
16 | 16 | #' (including the unofficial "text" aesthetic). The order of variables here will |
17 | 17 | #' also control the order they appear. For example, use |
18 | | -#' \code{tooltip = c("y", "x", "colour")} if you want y first, x second, and |
| 18 | +#' `tooltip = c("y", "x", "colour")` if you want y first, x second, and |
19 | 19 | #' colour last. |
20 | 20 | #' @param dynamicTicks should plotly.js dynamically generate axis tick labels? |
21 | 21 | #' Dynamic ticks are useful for updating ticks in response to zoom/pan |
|
24 | 24 | #' @param layerData data from which layer should be returned? |
25 | 25 | #' @param originalData should the "original" or "scaled" data be returned? |
26 | 26 | #' @param source a character string of length 1. Match the value of this string |
27 | | -#' with the source argument in \code{\link{event_data}()} to retrieve the |
| 27 | +#' with the source argument in [event_data()] to retrieve the |
28 | 28 | #' event data corresponding to a specific plot (shiny apps can have multiple plots). |
29 | 29 | #' @param ... arguments passed onto methods. |
30 | 30 | #' @export |
31 | 31 | #' @author Carson Sievert |
32 | 32 | #' @references \url{https://plot.ly/ggplot2} |
33 | | -#' @seealso \code{\link{plot_ly}()} |
| 33 | +#' @seealso [plot_ly()] |
34 | 34 | #' @examples \dontrun{ |
35 | 35 | #' # simple example |
36 | 36 | #' ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species) |
@@ -149,14 +149,14 @@ ggplotly.ggplot <- function(p = ggplot2::last_plot(), width = NULL, |
149 | 149 | #' @param tooltip a character vector specifying which aesthetic tooltips to show in the |
150 | 150 | #' tooltip. The default, "all", means show all the aesthetic tooltips |
151 | 151 | #' (including the unofficial "text" aesthetic). |
152 | | -#' @param dynamicTicks accepts the following values: \code{FALSE}, \code{TRUE}, \code{"x"}, or \code{"y"}. |
| 152 | +#' @param dynamicTicks accepts the following values: `FALSE`, `TRUE`, `"x"`, or `"y"`. |
153 | 153 | #' Dynamic ticks are useful for updating ticks in response to zoom/pan/filter |
154 | 154 | #' interactions; however, there is no guarantee they reproduce axis tick text |
155 | 155 | #' as they would appear in the static ggplot2 image. |
156 | 156 | #' @param layerData data from which layer should be returned? |
157 | 157 | #' @param originalData should the "original" or "scaled" data be returned? |
158 | 158 | #' @param source a character string of length 1. Match the value of this string |
159 | | -#' with the source argument in \code{\link{event_data}()} to retrieve the |
| 159 | +#' with the source argument in [event_data()] to retrieve the |
160 | 160 | #' event data corresponding to a specific plot (shiny apps can have multiple plots). |
161 | 161 | #' @param ... currently not used |
162 | 162 | #' @return a 'built' plotly object (list with names "data" and "layout"). |
|
0 commit comments