-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
71 lines (67 loc) · 1.98 KB
/
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#devtools::install_github("react-R/rfabric")
library(shiny)
library(reactR)
library(rfabric)
ui <- fluidPage(
titlePanel("rfabric reactR Shiny Inputs Example"),
# rating
faRatingInput("rating"),
textOutput("ratingOutput"),
faRatingInput("rating2"),
textOutput("rating2Output"),
# toggle
faToggleInput("toggle", default=TRUE),
textOutput("toggleOutput"),
faToggleInput("toggle2", default=FALSE),
textOutput("toggle2Output"),
# checkbox
faCheckboxInput("checkbox"),
textOutput("checkboxOutput"),
faCheckboxInput("checkbox2"),
textOutput("checkbox2Output")
# spinbutton not working as expected; waiting on onChange handler
# faSpinbuttonInput("spinbutton"),
# textOutput("spinbuttonOutput"),
# slider not working; for some reason binding refers to other elements
# faSliderInput("slider"),
# textOutput("sliderOutput"),
# faSliderInput("slider2"),
# textOutput("slider2Output")
)
server <- function(input, output, session) {
#demo update functionality for rating even though not much purpose here
updateFaRatingInput(
session = session,
inputId = "rating",
value = 5,
configuration = list(max=10)
)
output$ratingOutput <- renderText({
sprintf("You entered: %s", input$rating)
})
output$rating2Output <- renderText({
sprintf("You entered: %s", input$rating2)
})
output$toggleOutput <- renderText({
sprintf("You entered: %s", input$toggle)
})
output$toggle2Output <- renderText({
sprintf("You entered: %s", input$toggle2)
})
output$checkboxOutput <- renderText({
sprintf("You entered: %s", input$checkbox)
})
output$checkbox2Output <- renderText({
sprintf("You entered: %s", input$checkbox2)
})
# output$spinbuttonOutput <- renderText({
# sprintf("You entered: %s", input$spinbutton)
# })
# output$sliderOutput <- renderText({
# sprintf("You entered: %s", input$slider)
# })
# output$slider2Output <- renderText({
# sprintf("You entered: %s", input$slider2)
# })
}
shinyApp(ui, server)