Better support for trellis displays
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
There are a few different ways to do a trellis display currently, but these are all a bit esoteric
one_plot <- function(d) {
plot_ly(d, x = ~wt, y = ~mpg)
}
mtcars %>%
group_by(vs) %>%
do(plot = one_plot(.)) %>%
subplot(nrows = NROW(.))
plot_ly(mtcars, x = ~wt, y = ~mpg, color = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
subplot(nrows = 2)
plot_ly(mtcars, x = ~wt, y = ~mpg, split = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
subplot(nrows = 2)
#726 implements a trellis argument, which essentially maps that variable to sensible trace anchors, then uses subplot()'s machinery to populate axis objects. The problem is, we have guarantee a subplot is returned if we want a sensible result for:
plot_ly(mtcars, x = ~wt, y = ~mpg, trellis = ~vs)
Thus, we lose the ability to specify the number of rows in that subplot
It'd be better to have trellis() function:
trellis <- function(p, formula, ...) {
# do some stuff here
subplot(p, ...)
}
Ideally, the trellising would work a lot like ggplot2 facets (trellising variables should not appear in legends, and appear as annotations instead). This is what we do in ggplotly() via clever use of showlegend and legendgroup.
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
Revisa primero el argumento trellis propuesto en #726 y la maquinaria existente de subplot(). Una solución completa debería proporcionar una función trellis() que conserve el control sobre las filas de subplot y admita un comportamiento similar al de ggplot2, incluido mantener las variables de trellisado fuera de las leyendas y mostrarlas como anotaciones.
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
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100