I am using ggiraph with geom_tile_interactive in RStudio. The graph renders beautifully in the viewer window but after converting to HTML & hovering over the graph online, the font size is too tiny to read. I am using ggiraph 0.8.7 and the latest CRAN version of htmlwidgets. This is my code
g <- ggplot(gg.dat, aes(x = class, y = var.lab, fill = probability,
tooltip = paste0(class, "\n", var.lab, "\n", probability),
data_id = var.lab)) +
geom_tile_interactive(width = .75)
g.int <- girafe(ggobj = g)
saveWidget(g.int, file = paste0(my.dir, "/", my.graph.name, ".html),
selfcontained = TRUE)
Any assistance would be greatly appreciated.
Don
Whereas you can set the font size for the chart itself using
theme()orsize=as inggplot2for the tooltip you have to set the font size using theoptions=argument ofgirafe(). To this endggiraphprovides a helper functionopts_tooltip()which allows to style the tooltip via thecss=argument, e.g. in the code below I have set thefont-sizeto4rem.Using a minimal reproducible example based on mtcars: