R/message.R

Defines functions ggvis_message

Documented in ggvis_message

#' Send a message to ggvis running on client
#'
#' This will be sent to the client and passed to a handler in ggvis.messages on
#' the client side. The handler is specified by \code{type}.
#'
#' @param session A session object.
#' @param type A string representing the type of the message.
#' @param data An object (typically a list) containing information for the client.
#' @param id A unique identifier for ggvis message handler (optional).
#' @export
ggvis_message <- function(session, type, data = NULL, id = NULL) {
  if (is.null(session)) {
    stop("Need an active Shiny session to send ggvis message")
  }
  session$sendCustomMessage("ggvis_message",
    list(type = type, id = id, data = data))
}

Try the ggvis package in your browser

Any scripts or data that you put into this service are public.

ggvis documentation built on May 29, 2024, 1:12 a.m.