Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

event_data() triggering unexpected warning about registering #1528

Copy link
Copy link
Closed
@bklingen

Description

@bklingen
Issue body actions

Using event_data("plotly_hover", source="mysource") seems to trigger the following warning with the newest plotly version:
Warning: The 'plotly_hover' event tied a source ID of 'mysource' is not registered. In order to obtain this event data, please add event_register(p, 'plotly_hover') to the plot (p) that you wish to obtain event data from.

library(shiny)
library(plotly)

ui <- fluidPage(
        plotlyOutput("myplot"),
        verbatimTextOutput("hovered")
      )

server <- function(input, output, session) {
    
    output$myplot <- renderPlotly({
        p <- plot_ly(faithful, x=~eruptions, y=~waiting, source="mysource")
        return(p)
    })
    
    output$hovered <- renderPrint({
      event_data("plotly_hover", source="mysource")
    })

}

shinyApp(ui = ui, server = server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.