title: Selecting rows from a DT table using Crosstalk in Shiny
body: <p>I confess, I did post this question over on RStudio three days ago but it has not had enough love yet, so I'm trying again here. I hope that's okay. The original question is here (the text is the same in both, I'm just being transparent). <a href="https://community.rstudio.com/t/selecting-rows-from-a-dt-table-using-crosstalk-in-shiny/4079" rel="nofollow noreferrer">https://community.rstudio.com/t/selecting-rows-from-a-dt-table-using-crosstalk-in-shiny/4079</a></p>
  
  <p>So I would like to brush across points in D3Scatter and use it to filter the rows of a datatable produced using the DT package with crosstalk.</p>
  
  <p>Just like this, which totally works outside of shiny:</p>
  
  <pre><code>library(crosstalk)
  library(d3scatter)
  library(DT)
  
  shared_iris &lt;- SharedData$new(iris)
  
  bscols(d3scatter(shared_iris, ~Petal.Length, ~Petal.Width, ~Species, width = "100%",
               x_lim = range(iris$Petal.Length), y_lim = range(iris$Petal.Width)),
  
     datatable(shared_iris))
  </code></pre>
  
  <p>But when I put it in Shiny, I can select points on the scatter from the table, but not vice versa:</p>
  
  <pre><code>library(shiny)
  library(crosstalk)
  library(d3scatter)
  library(DT)
  
  ui &lt;- fluidPage(
    fluidRow(
      column(6, d3scatterOutput("scatter1")),
      column(6, DT::dataTableOutput("scatter2"))
    )
  )
  
  server &lt;- function(input, output, session) {
    jittered_iris &lt;- reactive({
      iris
    })
  
    shared_iris &lt;- SharedData$new(jittered_iris)
  
    output$scatter1 &lt;- renderD3scatter({
      d3scatter(shared_iris, ~Petal.Length, ~Petal.Width, ~Species, width = "100%",
            x_lim = range(iris$Petal.Length), y_lim = range(iris$Petal.Width))
    })
  
    output$scatter2 &lt;- DT::renderDataTable({
      datatable(shared_iris)
    })
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>They’ve got it working here: <a href="https://rstudio-pubs-static.s3.amazonaws.com/215948_95c1ab86ad334d2f82856d9e5ebc16af.html" rel="nofollow noreferrer">https://rstudio-pubs-static.s3.amazonaws.com/215948_95c1ab86ad334d2f82856d9e5ebc16af.html</a></p>
  
  <p>I’m at a loss. I feel like I’ve tried everything. Any clues anyone?</p>
  
  <p>Thanks,</p>