File: message.R

package info (click to toggle)
r-cran-ggvis 0.4.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,716 kB
  • sloc: sh: 25; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#' 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))
}