plotly/plotly.R

geom_GeomTextRepel() has yet to be implemented in plotly

Opened this issue · 3 comments

#plot output generated but without text written explicitly on correlation
funnel plot, however, when hovering it shows the text description
trial_funnelplot <- trial_churn %>%
binarize()%>%
glimpse()%>%
correlate(y__yes )%>%
plot_correlation_funnel()

ggplotly(trial_funnelplot)
Warning message:
In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomTextRepel() has yet to be implemented in plotly

Duplicate of #2408

GGrepel is quite very tricky to implement, as it requires good knowledge of exact text shapes and repositioning upon plot zoom/pan so labels remain readable. That means that ideal implementation would be done in JavaScript and run in the browser - and that is a lot of work to implement and maintain, and it would likely look different than original ggrepel, causing endless influx of "bug" reports. Not something I am looking forward to. That said - if you have ideas, PRs are welcome!

+1 from me, would be nice for ggtangle::cnetplot, which is part of the clusterProfiler/ DOSE suite of tools.

library(DOSE)
library(org.Hs.eg.db)
library(plotly)

data(geneList)
de <- names(geneList)[abs(geneList) > 2]

edo <- enrichDGN(de)
edox <- setReadable(edo, 'org.Hs.eg.db', 'ENTREZID')
p1 <- ggtangle::cnetplot(edox, foldChange=geneList)

ggplotly(p1)