XYpadInput {shinyXYpad} | R Documentation |
XY pad controller
Description
Creates a XY pad controller to be included in a Shiny UI.
Usage
XYpadInput(
inputId,
label = NULL,
value = list(x = 50, y = 50),
xmin = 0,
xmax = 100,
ymin = 0,
ymax = 100,
ndecimals = 2,
width = 200,
height = 200,
bgColor = "rgba(255,200,200,0.2)",
xyColor = "blue",
xySize = 11,
xyStyle = "italic",
coordsColor = xyColor,
pointColor = "#16235a",
pointRadius = 5,
border = "2px solid #777CA8",
x = "x",
y = "y",
displayPrevious = TRUE,
displayXY = TRUE,
onMove = FALSE
)
Arguments
inputId |
the input slot that will be used to access the value |
label |
label for the XY pad, or |
value |
the initial value, a list of two numbers named |
xmin , xmax |
minimal x-value and maximal x-value |
ymin , ymax |
minimal y-value and maximal y-value |
ndecimals |
number of decimals of the displayed coordinates (if |
width |
a positive number, the width in pixels |
height |
a positive number, the height in pixels |
bgColor |
background color, a HTML color; you have to set some transparency in order to see the coordinates |
xyColor |
color of the labels of the coordinates (if |
xySize |
font size of the labels of the coordinates (if |
xyStyle |
font style of the labels of the coordinates (if |
coordsColor |
color of the displayed coordinates (if |
pointColor |
color of the point, a HTML color |
pointRadius |
radius of the point in pixels |
border |
CSS for the border of the XY pad |
x |
label of the x-coordinate (if |
y |
label of the y-coordinate (if |
displayPrevious |
logical, whether to display the previous position of the point |
displayXY |
logical, whether to display the coordinates |
onMove |
logical, whether to send value to server on mouse move
( |
Value
A shiny.tag.list
object generating a XY pad input control that
can be added to a Shiny UI definition.
See Also
updateXYpadInput
for updating the XY pad on server-side.
Examples
library(shiny)
library(shinyXYpad)
ui <- fluidPage(
fluidRow(
column(
6,
XYpadInput("xy1", onMove = TRUE, label = "XY pad - on move")
),
column(
6,
XYpadInput(
"xy2", label = "XY pad - on release",
displayXY = FALSE, displayPrevious = FALSE
)
)
),
fluidRow(
column(6, verbatimTextOutput("xy1value")),
column(6, verbatimTextOutput("xy2value"))
)
)
server <- function(input, output, session){
output[["xy1value"]] <- renderPrint({ input[["xy1"]] })
output[["xy2value"]] <- renderPrint({ input[["xy2"]] })
}
if(interactive()){
shinyApp(ui, server)
}