Displaying grid (tiff) data on Plotly Dash mapbox with Holoviews and Datashader

Full Colab Notebook:
https://colab.research.google.com/drive/1_Rr71QbjlEjBmTW_r0hOoBLFVoxaMfBh?usp=sharing

Summary:
I’d like to display a Tiff image in a Mapbox layer in Plotly Dash, with tooltip showing the actual values.

I’m using Holoviews and I easily can get it work in the Bokeh backend:
Bokeh example

As you can see, the image is overlaid on the map, and a tooltip shows up where the mouse pointer is, displaying the actual value at that location.

However if I use the plotly backend or I try to feed this exact result into Dash (which I assumes forces the plotly backend), I get an error:

Elements of type <class 'holoviews.element.raster.Image'> cannot be overlaid with Tiles elements using the plotly backend

It sounds weird, but ok.

Then I tried to feed the image into Datashader and display the result (as the live data will be much more detailed than the test data I’m going to use DS either way). Now I don’t get the hover tooltip and weirdly enough also the image is vertically mirrored:

datashader example

I’ve been trying to make this work for a week now, and I’m going nuts. Does anybody have an idea how to display a tiff on a mapbox properly while showing hover tooltips for the data? It seems like such a basic thing to do and yet with 20 years of developer experience and by reading through every documentation I could find and checking out every example I can’t manage to do it, so any pointers are appreciated.

How large is the image?

The test image used above is 4MB, the live image I would like to use is 400MB, so Datashader definitely will be needed.

I have previously used custom tiling for this kind of use case. Here is a small example,

But the holoviews approach might be simpler (:

Might be - if it would work. I’ve actually checked out the terracotta-dash module, downloaded the example and I am pretty impressed by it. (Off, but I’m a huge fan of your work with the leaflet module too.) Currently the terracotta solution my fallback plan, but it lacks the hover tooltip functionality which is pretty crucial for my use case (the whole point of showing the image is showing a visual representation of the data, but you need to see the data) while this approach - understandably - handles the image as an image and the “click to see the data here” functionality is not enough.