title: Using bqplot tooltip with a dataframe
body: <p>Use widget to display snippets from a csv file/dataframe and feed to tooltip attribute of bqplot</p>
  
  <p>I am trying to display certain info (statistics such as age group, income, obesity levels etc.) for each state in the US using bqplot. I am able to plot the US map using examples provided on bqplot github. But the tooltip constructor is using columns names from a json file, which is also used to actually display the map. I do not know how to override that so, I decided to use a widget (ideally a container widget) to hold the data I want to display for each state and use the on_hover() method provided in bqplot.map; In fact, I just modified the code in the link below:</p>
  
  <p><a href="https://stackoverflow.com/questions/56655741/container-as-tooltip-doesnt-show-contents">Container as tooltip doesn&#39;t show contents</a></p>
  
  <p>to display info for a particular state</p>
  
  <pre><code>
  import bqplot
  import pandas as pd
  import ipywidgets as ipw
  from IPython.display import display, clear_output
  
  res = pd.read_csv('data_files/clean_data.csv')
  df = pd.DataFrame(res)
  
  ## using values for only one state
  df_temp = df[df['State'] == 'NY']
  
  out = ipw.Output()
  def hover_handler(self,Dataframe):
          out.clear_output()
          with out:
  
              display(ipw.HTML(df_temp.to_html()))
  
  
  geo = AlbersUSA()
  scale_s =  OrdinalColorScale(domain=['Obese', 'Not Obese'], colors=['Red', 'Green'])
  st_green = dict(zip(df['State'], list(obesity_list)))
  
  geo = AlbersUSA()
  scale_s =  OrdinalColorScale(domain=['Obese', 'Not Obese'], colors=['Red', 'Green'])
  map_args = {'color': st_green,
                'scales': {'projection': geo, 'color': scale_s}, 
                'colors': {'default_color': 'Black'}}   
  
  s_map = plt.geo(map_data='USStatesMap', **map_args)
  s_map.toolip = out  # I am pointing tooltip to the out object
  s_map.on_hover(hover_handler)
  s_map
  </code></pre>
  
  <ol>
  <li><p>I cannot figure how to change the color in each state based on values 'Obese' and 'Not obese';</p></li>
  <li><p>I used snippets of code from bqplot example and the link above on stackoverflow but I do not know how to make the info change as I hover over to another state; Currently <code>df_temp</code> holds  values for only one state and that is displayed anywhere I hover over the map. How can I make the widget fetch relevant data? </p></li>
  </ol>
  
  <p>2.1 Essentially, I need it to display results in a tabular format:</p>
  
  <pre><code>State:NY
  Status: Not Obese
  Age_group | Obese | Not_obese
  &lt;18       |  %    |  %
  19-30     |  %    |  %
  </code></pre>
  
  <p>I have data for all the fields above as columns in a dataframe for EACH state. I am new to ipywidgets and bqplot. So, any help would be greatly appreciated.</p>
  
  <p>Thank you!</p>