updateXYpadInput {shinyXYpad}R Documentation

Change a XY pad input on the client

Description

Changes a XY pad input on the client.

Usage

updateXYpadInput(
  session,
  inputId,
  label = NULL,
  value = NULL,
  xmin = NULL,
  xmax = NULL,
  ymin = NULL,
  ymax = NULL,
  ndecimals = NULL,
  bgColor = NULL,
  pointColor = NULL,
  pointRadius = NULL
)

Arguments

session

session object passed to the Shiny server function

inputId

id of the XY pad input

label

new label, or NULL for no change

value

new value, or NULL for no change

xmin

new xmin, or NULL for no change

xmax

new xmax, or NULL for no change

ymin

new ymin, or NULL for no change

ymax

new ymax, or NULL for no change

ndecimals

new ndecimals, or NULL for no change

bgColor

new bgColor, or NULL for no change

pointColor

new pointColor, or NULL for no change

pointRadius

new pointRadius, or NULL for no change

Value

No value is returned, called for side-effect.

Examples

library(shiny)
library(shinyXYpad)
ui <- fluidPage(
  fluidRow(
    column(6, XYpadInput("xy", onMove = TRUE, label = "XY pad")),
    column(6, verbatimTextOutput("xyvalue"))
  ),
  br(),
  actionButton("update", "Update")
)
server <- function(input, output, session){
  output[["xyvalue"]] <- renderPrint({ input[["xy"]] })
  observeEvent(input[["update"]], {
    updateXYpadInput(session, "xy", value = list(x = 25, y = 25),
                     bgColor = "chartreuse", pointColor = "yellow",
                     pointRadius = 10, ndecimals = 3)
  })
}

if(interactive()){
  shinyApp(ui, server)
}

[Package shinyXYpad version 0.2.0 Index]