Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬 Register for the Oct 27 webinar.

Does plotly support customdata with heatmaps?

Sorry, this is a bit of an x-post:
I would like to get this working, and I want to make sure I’m not running headfirst at a wall:
Showing extra data in a heatmap with hovertemplate and customdata
Does the underlying plotly library actually support what I want?

Here’s how: https://codepen.io/etpinard/pen/agNeoY?editors=1010

Thanks. So in theory, if I can get R plotly to convert something to a list of lists for customdata, it should work.

Ok, this R code worked, thanks for pointing me in the right direction:

library(plotly)
mat <- matrix(1:100,10,10);
plot_ly(z=mat, type="heatmap", customdata=apply(mat,1, as.list), hovertemplate="%{customdata}<extra></extra>")

The problem was realizing that 1) it was working 2) I just needed to convert the data into the correct format.
It would be nice if I (or other people) knew how to get some sort of debug output or something.

Oh one more thing, I tried, but I simply couldn’t find any documentation or examples
for using a more complex data structure in a single customdata element.
Is it possible to to do that?

For example (just something I made up), putting an object in an element and then accessing its fields:
%{customdata.somefield}

Why not just be able to evaluate arbitrary code to do something with the structure?
(Though - I’m using R, so I’m not sure what would be nice. I guess some inline javascript…)

Our task needs to show heatmaps that are logged, but show unlogged values (or no data cases) in hover. customdata and hovertemplate works great for this. However my boss wants me, after all this great work, put part of the hover info along the bottom of the plot (Like is done automatically in line+marker plots)
In other words rather than this:
image
show something like this:
image
image
Is this possible? Some combination of hovermode: x works with heatmaps?