tests/test-modules/107_scatterplot/app.R
raw| 1 | library(shiny) |
| 2 | library(ggplot2) |
| 3 | |
| 4 | |
| 5 | ui <- fixedPage( |
| 6 | h2("Module example"), |
| 7 | linkedScatterUI("scatters"), |
| 8 | textOutput("summary") |
| 9 | ) |
| 10 | |
| 11 | server <- function(input, output, session) { |
| 12 | df <- linkedScatterServer( |
| 13 | "scatters", |
| 14 | reactive(mpg), # data |
| 15 | left = reactive(c("cty", "hwy")), |
| 16 | right = reactive(c("drv", "hwy")) |
| 17 | ) |
| 18 | |
| 19 | output$summary <- renderText({ |
| 20 | sprintf("%d observation(s) selected", sum(df()$selected_)) |
| 21 | }) |
| 22 | } |
| 23 | |
| 24 | shinyApp(ui, server) |