0

I have used GeoJSONDataSource (converted from a geopandas) to display ALL the world map in my bokeh figure.

geosourceword = GeoJSONDataSource(geojson = json_data)
standardfig.patches('xs','ys', source = geosourceword,fill_color = {'field':'deaths', transform':color_mapper})

Then I use

hover_tool = HoverTool(tooltips = [ ('location', '@location'), ('# of deaths', '@deaths')])

to display over a location the number of deaths. Since, in my data, some country have deaths = NaN I don't want to display them (for instance in this picture I don't want to display Turkey). Any idea how I can proceed ? enter image description here

olivier dadoun
  • 622
  • 6
  • 22
  • 1
    You would use `CustomJSHover` to return the empty string (or whatever) for nan values, i..e a special case of the other linked question. – bigreddot Dec 01 '20 at 16:56
  • 1
    https://stackoverflow.com/a/62601527/3406693 is also relevant – bigreddot Dec 01 '20 at 16:58
  • 1
    CustomJSHover and the link help me a lot thanks. I would like to recommand also this post https://discourse.holoviz.org/t/how-to-create-a-conditional-custom-hover-tool-for-a-holoviews-plot/311 – olivier dadoun Dec 02 '20 at 17:05

0 Answers0