## ----include = FALSE---------------------------------------------------------- knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE) ## ----------------------------------------------------------------------------- # library(shiny) # library(shinyreact) # # ui <- page_react() # discovers www/ui.js + www/ui.css # # server <- function(input, output, session) { # output$greeting <- reactive_output({ # paste0("Hello, ", input$name, "!") # }) # } # # shinyApp(ui, server) ## ----------------------------------------------------------------------------- # output$dist <- reactive_output({ # n <- input$bins # if (is.null(n)) { # return(NULL) # } # hist(faithful$waiting, breaks = n, plot = FALSE)$counts # }) ## ----------------------------------------------------------------------------- # output$dist_data <- reactive_output({ # h <- hist(faithful$waiting, breaks = input$bins, plot = FALSE) # list(breaks = I(h$breaks), counts = I(h$counts)) # }) ## ----------------------------------------------------------------------------- # observeEvent(input$save, { # send_message(session, "notify", list(text = "Saved", level = "info")) # }) ## ----------------------------------------------------------------------------- # output$plot <- plotly::renderPlotly({ # plotly::plot_ly(x = ~ faithful$waiting, type = "histogram") # })