I have a number of plots using {ggplot2} and {ggiraph} that I have consolidated into a {flexdashboard}
Before attempting to display them with the dashboard, these plots displayed correctly on RStudio's viewer using the sizing option width = 0.7
However, they do not display on the dashboard (just a blank panel), and now produce a blank panel if run directly in RStudio. After some investigation it seems that some setting has changed and that the charts are not output because the size is inconsistent with the window.
If I change the width setting to 10 it displays correctly in the RStudio viewer which seems odd.
I have a small reprex here:
library(ggplot2)
library(ggiraph)
#dummy dataframe
df <- data.frame(
x = seq.Date(Sys.Date() - 30, Sys.Date() - 1, by = "days"),
y = runif(30, 0, 2)
)
p <- ggplot2::ggplot(df, (aes(x,y)))+
geom_point_interactive(aes(tooltip = x, data_id = x))
plot <- girafe(ggobj = p,
width =0.7)
print(plot)
This produces the following output:
However if I adjust width setting to 10
plot <- girafe(ggobj = p,
width =10)
print(plot)
I get the following:
This seems inconsistent with the documentation for {ggiraph}, is there some graphics setting that has been modified by {flexdashboard}? I've tried interactive (js) charts with {plotly} and {echarts4r} on {flexdashboard} output which don't show the same behaviour.
I'm using RStudio 1.4.1103 R version 4.0.2 System: x86_64-apple-darwin17.0