Skip to content

pie labels/values aren't relayed in event_data() #1655

Open
@cpsievert

Description

@cpsievert

At least the customdata workaround exists, but we should do a better job relaying more information (do we 'black-list' pt.data/pt._fullData and let everything else through)? https://codepen.io/cpsievert/pen/rNNZpVo

library(shiny)

ui <- fluidPage(
  plotlyOutput("category"),
  verbatimTextOutput("info")
)

server <- function(input, output) {
  
  output$category <- renderPlotly({
    sales %>%
      count(category, wt = sales) %>%
      plot_ly() %>%
      add_pie(labels = ~category, values = ~n)
  })
  
  output$info <- renderPrint({
    event_data("plotly_click")
  })
  
}

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