我想最終在 ggiraph 的工具提示中插入 R(互動式或非互動式)圖形。像我之前成功使用傳單一樣使用 iframe,它看起來像這樣:
library(ggplot2)
library(ggiraph)
library(htmltools)
p <- {ggplot()
aes(1,1, tooltip = "blabla")
geom_point_interactive()} %>%
girafe(ggobj = .)
save_html(p, file = "test.html") # I would use a loop to save many different graphs at the same time
{ggplot()
aes(1,1, tooltip = HTML("<iframe src='test.html' frameborder=0 width=300 height=300></iframe>"))
geom_point_interactive()} %>%
girafe(ggobj = .)
不幸的是,我帶來了一些錯誤。咱們試試吧:
{ggplot()
aes(1,1, tooltip = HTML("<iframe src='https://stackoverflow.com' frameborder=0 width=300 height=300></iframe>"))
geom_point_interactive()} %>%
girafe(ggobj = .)
在 Firefox 中,它只給出一個黑色方塊,而在 RStudio IDE 中,它會在滑鼠懸停時意外地在瀏覽器中打開該站點。

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/462726.html
上一篇:為組設定特定的色階
