Customising heatmaply hover in R Shiny app

92 views Asked by At

I have a plotlyOutput heatmap in a R Shiny app, which I render through heatmaply.

When I hover the mouse on the heatmap I get a popup saying

Row - [rowname] 
Column - [columnname]
Value - xxxxx

How would I go about customising this to a custom string?

1

There are 1 answers

0
ismirsehregal On BEST ANSWER

We can overwrite the default hovertemplate via style():

library(heatmaply)
library(datasets)

heatmaply(mtcars) |> style(hovertemplate = paste0("X: %{x}<extra></extra>"))