Implement geom_GeomFunction()
Nessuno ha ancora preso questa issue.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I am running an R shiny app that uses plotly. One of the plots includes a distribution drawn using stat_function, which works great with ggplot(), but that dissapears when the ggplot object is passed to plotly::ggplotly(), returning the following message:
Warning message:
In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomFunction() has yet to be implemented in plotly.
If you'd like to see this geom implemented,
Please open an issue with your example code at
https://github.com/ropensci/plotly/issues
Please, follow the reproducible example below, using the attached file (see below) as input:
library("plotly")
library("tidyverse")
df <- readr::read_csv("effect.csv")
my_plot <- df %>% ggplot2::ggplot() +
stat_bin(aes(x=effect, y=..density..), fill="blue", colour="white", binwidth = 0.02) +
stat_function(aes(x = effect, y = ..y..), fun = get("dlnorm"), colour="red", n = 100, args = c(-3.3, 0.5)) +
scale_x_continuous(name = "Effect size") +
scale_y_continuous(name = "", limits = c(0, 25))
theme_minimal()
# ggplot (with the red line showing the distribution fit)
my_plot
# plotly version (without the line, and returning the above message)
plotly::ggplotly(my_plot)
Example file with effect.csv:
example.zip
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’avviso geom2trace.default prodotto da plotly::ggplotly() e riproducilo usando l’esempio R fornito e il file effect.csv. Confronta gli output di ggplot e plotly per stat_function con dlnorm. Il lavoro è completato quando la linea della distribuzione appare nell’output di plotly e l’avviso relativo al geom non implementato è scomparso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- r
- Ambito
- data-visualization
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100