When generating a plotly geom_point() plot with a tooltip that contains a long description, the package's standard is to show the text in a single line. The issue with that is that it does not fit in the screen. How is it possible to break the line, in a way that it can be read?
library(tidyverse)
library(plotly)
bd <- data.frame(Freq = c(1, 2, 3),
Criticality = c("A", "B", "C"),
Status = c("alpha", "beta", "alpha"),
Plant = c(1, 2, 1),
Description = c("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"))
g <- bd %>%
ggplot(aes(x = Freq, y = Criticality)) +
geom_point(aes(shape = Status, col = Plant, text = Description)) +
geom_jitter(aes(shape = Status, col = Plant, text = Description)) +
guides(size = FALSE)
ggplotly(g, tooltip = c("Description"))
Currently, I get the following error message but it does not generate any problem.
Warning: Ignoring unknown aesthetics: text