Implement geom_GeomFunction()
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- R
- Estrellas
- 2.7k
- Forks
- 641
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la advertencia geom2trace.default producida por plotly::ggplotly() y reprodúcela usando el ejemplo de R proporcionado y el archivo effect.csv. Compara las salidas de ggplot y plotly para stat_function con dlnorm. Se considera terminado cuando la línea de distribución aparece en la salida de plotly y la advertencia sobre el geom no implementado ha desaparecido.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- r
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100