View source: R/annotate_interactive.R
annotate_interactive | R Documentation |
The layer is based on annotate()
.
See the documentation for that function for more details.
annotate_interactive(...)
... |
arguments passed to base function, plus any of the interactive_parameters. |
The interactive parameters can be supplied as arguments in the relevant function and they can be scalar values or vectors depending on params on base function.
girafe()
, interactive_parameters, annotation_raster_interactive()
# add interactive annotation to a ggplot -------
library(ggplot2)
library(ggiraph)
gg <- ggplot(mtcars, aes(x = disp, y = qsec )) +
geom_point(size=2) +
annotate_interactive(
"rect", xmin = 100, xmax = 400, fill = "red",
data_id = "an_id", tooltip = "a tooltip",
ymin = 18, ymax = 20, alpha = .5)
x <- girafe(ggobj = gg, width_svg = 5, height_svg = 4)
if( interactive() ) print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.