heatmaply icon indicating copy to clipboard operation
heatmaply copied to clipboard

Is it possible to have `custom_hovertext` appear on row/col side?

Open bjohnnyd opened this issue 3 years ago • 3 comments

I would like to add numerical values to be displayed on hover over a categorical row/col side.

I thought that creating an identical dataframe and overwriting the categorical column with numerical values and then passing this dataframe to custom_hovertext would make this work.

library(heatmaply)

# e.g. showing just the actual value twice on hover does not work
mtcars$test_col <- "test"
heatmaply(mtcars, custom_hovertext = mtcars)

# e.g. substituting the categorical with numeric does not work for the row/col side
mtcars_w_num_for_categorical <- mtcars
mtcars_w_num_for_categorical[] <- 10**6

heatmaply(mtcars, custom_hovertext = mtcars_w_num_for_categorical)

bjohnnyd avatar Jul 20 '21 22:07 bjohnnyd

This requires adding col_side_hovertext and row_side_hovertext args

alanocallaghan avatar Jul 21 '21 12:07 alanocallaghan

Ok, thanks. I was thinking that custom_hovertext will apply to the whole heatmap, not just the core. I guess this is in essence core_heatmap_hovertext.

bjohnnyd avatar Jul 21 '21 13:07 bjohnnyd

Probably when the categorical columns are pulled out we can also pull out the accompanying hovertext for those columns, but yeah unfortunately atm there's no custom hovertext for colsidecolors or rowsidecolors afaik

alanocallaghan avatar Jul 21 '21 14:07 alanocallaghan