inst/apps/103-plot-interaction-article-8/app.R

### Keep this line to manually test this shiny application. Do not edit this line; shinycoreci::::is_manual_app

library(ggplot2)
ui <- basicPage(
  plotOutput("plot1",
    brush = brushOpts(id = "plot_brush", fill = "#ccc", direction = "x"),
    height = 250
  )
)

server <- function(input, output) {
  output$plot1 <- renderPlot({
    ggplot(ChickWeight, aes(x=Time, y=weight, colour=factor(Chick))) +
      geom_line() +
      guides(colour=FALSE) +
      theme_bw()
  })
}

shinyApp(ui, server)
rstudio/shinycoreci documentation built on April 11, 2025, 3:17 p.m.