Say I have this boxplot rendered within a Quarto document:
library(tidyverse)
library(ggplot2)
data(iris)
iris %>%
pivot_longer(cols = Sepal.Length:Petal.Width,
names_to = 'metric',
values_to = 'value') %>%
ggplot(aes(x=metric, y=value)) +
geom_boxplot(aes(fill = Species)) +
facet_wrap(~metric, scales = 'free')
Is it possible to add a pop-up window, or a hover text, to each facet title such that when you click or hover over it, it shows a description of the title?
descriptions <- c('Petal length (cm)', 'Petal Width (cm)', 'Sepal Length (cm)', 'Sepal Width (cm)')