View source: R/element_interactive.R
label_interactive | R Documentation |
This function returns an object that can be used as a label
via the labs()
family of functions or
when setting a scale
/guide
name/title or key label.
It passes the interactive parameters to a theme element created via
element_text_interactive()
or via an interactive guide.
label_interactive(label, ...)
label |
The text for the label (scalar character) |
... |
any of the interactive_parameters. |
an interactive label object
interactive_parameters, labeller_interactive()
library(ggplot2)
library(ggiraph)
gg_jitter <- ggplot(
mpg, aes(cyl, hwy, group = cyl)) +
geom_boxplot() +
labs(title =
label_interactive(
"title",
data_id = "id_title",
onclick = "alert(\"title\")",
tooltip = "title" )
) +
theme(plot.title = element_text_interactive())
x <- girafe(ggobj = gg_jitter)
if( interactive() ) print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.