plotly / plotly/plotly.R

SharedData's selection() method not firing

Open
#993 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Shiny example and tracing the SharedData$selection() entry point alongside highlight(), plotlyOutput(), and renderPlotly(). Done means the selection output updates when a plotly selection is made; the payload does not name a test or source file to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.