title: Multiple variable observation plotly tooltip
body: <p>I am working on making a plotly map of the US with hover tooltips which I have gotten to work somewhat. However, I have multiple observations per state for each variable I would like to display in the tooltip and currently only the first observation for each state is displayed. Each observation is the performance of a candidate in the 1976 presidential election in a state, and I would like the hover tooltip to display each candidates performance in the state instead of just the first candidate listed in that state.</p>
  
  <p>Here is the code I am using at the moment.</p>
  
  <p>candidate denotes the name of the candidate , state_share and round_share denote the percent of the state popular vote and state electoral votes the candidate receives respectively.</p>
  
  <pre><code>library(plotly)
  colorscale &lt;- c("blue" , "purple" , "red")
  
  l &lt;- list(color = toRGB("white"), width = 2)
  # specify some map projection/options
  g &lt;- list(
    scope = 'usa',
    projection = list(type = 'albers usa'),
    showlakes = FALSE
  )
  
  threshold10$hover &lt;- with(threshold10, paste(state, "&lt;br&gt;" , canvec ,':', 
                                               state_share ,",","Electoral Votes", round_share ))
  fig &lt;- plot_geo(subset(threshold10, year == 1976), locationmode = 'USA-states') 
  
  fig &lt;- fig %&gt;% 
    add_trace(
      z = ~evotes, text = ~ hover  , locations = ~state_po,
    color = ~state_share , colors = colorscale) %&gt;% 
    layout(title = '1976 Electoral Vote Allocation &lt;br&gt; 10% State Threshold',
      geo = g)
  fig
  
  </code></pre>
  
  <p>I'm also attaching an image of the dataset and the map produced by my code. I appreciate any help anyone has to offer. I am newish to working with plotly and mapping so if this is a simple question sorry about that. Thank you for your help.</p>
  
  <p>dataframe:
  <a href="https://i.stack.imgur.com/yUDyW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yUDyW.png" alt="enter image description here"></a></p>
  
  <p>map output:
  <a href="https://i.stack.imgur.com/bt79G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bt79G.png" alt="enter image description here"></a></p>