Skip to content

SharedData's selection() method not firing #993

Open
@cpsievert

Description

@cpsievert
library(plotly)
library(shiny)
library(crosstalk)

m <- SharedData$new(mtcars)

ui <- fluidPage(
  plotlyOutput("plotID"),
  verbatimTextOutput("brushInfo")
)

server <- function(input, output) {

  output$plotID <- renderPlotly({
    p <- ggplot(m, aes(wt, mpg)) + geom_point()
    highlight(ggplotly(p), "plotly_selected")
  })
  
  output$brushInfo <- renderPrint({
    m$selection()
  })
  
}

shinyApp(ui, server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions