I have a tile map and two hd.regrid()-ded images overlaid on it. I can get a hover tooltip for both images if that image is overlaid alone on the map, but I have no idea how to do this with both images at the same time.
Colab Notebook example with 2x2 test images at slightly different positions:
https://colab.research.google.com/drive/1nACPvXNk-gnygTyzwUaNlnn-O1Y9i_7U?usp=sharing
One by one they work fine:
(tiles * image_population) + (tiles * image_elevation)
But if I overlay them on the same map (having alpha=0.5 you an see both images at the same time), I get two separate tooltips at the same position which is pretty useless:
tiles * image_population * image_elevation
I can try to create a custom tooltip, but I still don’t have access to any more information:
custom_tooltips = [
('name', "$name"), # ???
('index', "$index"), # 0
('@image', '@image{0.00}'), # this is the correct value
('@{population_density}', '@{population_density}{0.00} person/km2'), # ???
('@{elevation}', '@{elevation}m') # ???
]
custom_hover = bk.models.HoverTool(tooltips=custom_tooltips)
tiles * image_population.options(tools=[custom_hover]) * image_elevation.options(tools=[custom_hover])
As this time even the size and content of the tooltips are the same, you can only see if 1 or 2 tooltips are open if you pay attention to the opacity of the tooltip.
I get that the tooltips are attached to the images, so technically this is the expected functionality, but to be honest this is not very useful. I would like to have a way to access both data values in a single tooltip, similarly to the last code example.
Is there any workaround that would allow displaying multiple datasets in one tooltip? Right now I’m open to any hacky solutions, as this should be the single most important core functionality and at the same time the only missing piece of the project I’m working on. I know Bokeh and HV can display multiple values in a single tooltip, as there are many examples showcasing it for basic charts. I even know that Bokeh is capable of showing multiple values for images as there is a pure Bokeh example for that. I just have no idea how to implement that when my data is in two hd.regrid()-ded hv.Image().