Skip to content

Commit b8789dd

Browse files
committed
tidy up documentation and function signature
1 parent 1e10fc7 commit b8789dd

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

R/shiny.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,16 @@ prepareWidget <- function(x) {
5656
#'
5757
#' This function must be called within a reactive shiny context.
5858
#'
59-
#' @param event The type of plotly event. Currently 'plotly_hover',
60-
#' 'plotly_click', 'plotly_selected', and 'plotly_relayout' are supported.
59+
#' @param event The type of plotly event. All supported events are listed in the
60+
#' function signature above (i.e., the usage section).
6161
#' @param source a character string of length 1. Match the value of this string
62-
#' with the source argument in [plot_ly()] to retrieve the
63-
#' event data corresponding to a specific plot (shiny apps can have multiple plots).
62+
#' with the `source` argument in [plot_ly()] (or [ggplotly()]) to respond to
63+
#' events emitted from that specific plot.
6464
#' @param session a shiny session object (the default should almost always be used).
6565
#' @export
66+
#' @references
67+
#' * <https://plotly-book.cpsievert.me/shiny-plotly-inputs.html>
68+
#' * <https://plot.ly/javascript/plotlyjs-function-reference/>
6669
#' @author Carson Sievert
6770
#' @examples \dontrun{
6871
#' plotly_example("shiny", "event_data")
@@ -72,8 +75,8 @@ event_data <- function(
7275
event = c(
7376
"plotly_hover", "plotly_unhover", "plotly_click", "plotly_doubleclick",
7477
"plotly_selected", "plotly_selecting", "plotly_brush", "plotly_brushing",
75-
"plotly_deselect", "plotly_relayout", "plotly_legendclick",
76-
"plotly_legenddoubleclick", "plotly_afterplot"
78+
"plotly_deselect", "plotly_relayout", "plotly_restyle", "plotly_legendclick",
79+
"plotly_legenddoubleclick", "plotly_clickannotation", "plotly_afterplot"
7780
),
7881
source = "A",
7982
session = shiny::getDefaultReactiveDomain()

man/event_data.Rd

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)