I have made a plot with an interactive annotation; this works in RStudio in the viewer tab when I run this code:
library(ggiraph)
library(tidyverse)
data(iris)
graph <- iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point() +
annotate_interactive("text", x = 7, y = 4,
label = "1.",
fontface = "bold",
tooltip = "a test")
girafe(ggobj = graph)
RStudio viewer tab:
However, when I try to write this onto a Quarto document and render in Rstudio, the graph comes back as a blank space. It doesn't load. The output is html.
library(ggiraph)
library(tidyverse)
data(iris)
graph <- iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point() +
annotate_interactive("text", x = 7, y = 4,
label = "1.",
fontface = "bold",
tooltip = "a test")
girafe(ggobj = graph)
I would have expected this to work within Quarto, but I might be missing something. Many thanks.