Skip to content

Commit a159ded

Browse files
committed
fix event_data shiny example
1 parent d6ea8bc commit a159ded

File tree

1 file changed

+3
-5
lines changed
  • inst/examples/shiny/event_data

1 file changed

+3
-5
lines changed

inst/examples/shiny/event_data/app.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ server <- function(input, output, session) {
1717
nms <- row.names(mtcars)
1818

1919
output$plot <- renderPlotly({
20-
if (identical(input$plotType, "ggplotly")) {
21-
p <- ggplot(mtcars, aes(x = mpg, y = wt, customdata = nms)) + geom_point()
22-
ggplotly(p) %>% layout(dragmode = "select")
20+
p <- if (identical(input$plotType, "ggplotly")) {
21+
ggplotly(ggplot(mtcars, aes(x = mpg, y = wt, customdata = nms)) + geom_point())
2322
} else {
24-
plot_ly(mtcars, x = ~mpg, y = ~wt, customdata = nms) %>%
25-
layout(dragmode = "select")
23+
plot_ly(mtcars, x = ~mpg, y = ~wt, customdata = nms)
2624
}
2725
p %>%
2826
layout(dragmode = "select") %>%

0 commit comments

Comments
 (0)