title: Highlight During Hover in Plotly - not working?
body: <p>Context: I am trying to plot a line graph with multiple time series at once. The groups are described by ~Country. Only those countries that are selected by the user (input$Country) in a shiny app are displayed in the graph. The user also defines the x and y variables. </p>
  
  <p>Problem: I would like to use the highlight feature to highlight each time series when there is a hover event. The graph seems to recognize the highlight syntax, because the color selecting widget specified by Dynamic=TRUE is there. The lines themselves do not get highlighted during the mouseover, however.</p>
  
  <p>Can anyone see where the error is and what would allow the highlight function to work during hover? </p>
  
  <pre><code>server &lt;- function(input, output, ...) {
  
  highlight_key(data, key=~Country)
  
      output$p &lt;- renderPlotly({
        (plot_ly(data, x = ~get(input$xvar), y = ~get(input$yvar), mode='lines', color= ~Country) %&gt;%
        filter(Country %in% input$Country) %&gt;%
        add_lines(line=list(width=3)) %&gt;% 
        layout(yaxis = list(type = input$yscale, title = input$yvar))%&gt;% 
        layout(xaxis = list(title = "Title of X"))%&gt;% 
        config(displayModeBar = FALSE, scrollZoom=TRUE)%&gt;%
        filter(Country %in% input$Country)%&gt;%
        highlight(on='plotly_hover',off='plotly_doubleclick',dynamic=TRUE))  
  
    })
  }
  </code></pre>