title: How to use Callbacks with echarts4r in a Shiny App
body: <p>I am looking to retrieve the user selected information in echarts4r objects in the server, for server side logic. I am looking to use the callbacks <code>id_clicked_data</code>, <code>id_mouseover_data</code>, etc found here <a href="https://echarts4r.john-coene.com/reference/echarts4r-shiny.html" rel="nofollow noreferrer">https://echarts4r.john-coene.com/reference/echarts4r-shiny.html</a>.</p>
  <p>In the toy app (below) I am looking to return the value of the clicked country on the map to return the value to the screen via the <code>outpt_map_country</code> object. Any help would be greatly appreciated thanks.</p>
  <p>I have tried with variations of <code>input$outpt_map_country_clicked_data</code> but the solutions is alluding me.</p>
  <pre><code>library(shiny)
  library(echarts4r)
  library(countrycode)
  library(dplyr)
  
  
  ui &lt;- fluidPage(
    echarts4rOutput('outpt_map'),
    verbatimTextOutput('outpt_map_country'),
    tableOutput('out_cns')
  )
  
  
  cns &lt;- data.frame(
    country = countrycode::codelist$country.name.en
  ) %&gt;% 
    mutate(value   = round(runif(length(country), 1, 5), 6))
  
  server &lt;- function(input, output, session) {
    
    
    output$outpt_map &lt;- renderEcharts4r({
      
      cns %&gt;% 
        e_charts(country) %&gt;% 
        e_map(value) 
    })
    
    output$outpt_map_country &lt;- renderPrint({
      
      input$outpt_map_country_clicked_data
      
    })
    
    output$out_cns &lt;- renderTable({
      
      cns
      
    })
    
  }
  
  shinyApp(ui, server)
  </code></pre>