plotly / plotly/plotly.R

using ggforce paginated figures with ggplotly

Abierto
#2,164 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

Hello, I'm currently trying to use ggforce::facet_wrap_paginate to take figures with many facets and chop them up to make them easier for folks to view in a Shiny App. I can render these with ggplot just fine, but when I try to use poorly it just puts all of the facets on the same figure. The code below reproduces the problem, and the output I see shown as well. The figure on the top is paginated ggplot output and the one below is the paginated plotly output.

Any help would be most appreciated.

library(plotly)
library(ggplot2)
library(ggforce)


ui <- fluidPage(
  plotOutput("page2_ggplot"),
  tags$br(),
  plotly::plotlyOutput("page2_ggplotly")
)

server <- function(input, output) {
  
  tmpds = diamonds[1:1000,]

  output$page2_ggplot   = renderPlot({
    p = ggplot(tmpds) +
      geom_point(aes(carat, price), alpha = 0.1) +
      facet_wrap_paginate(~ cut:clarity, ncol = 3, nrow = 3, page = 2)
    
    res = p
  res})
  
  output$page2_ggplotly   = plotly::renderPlotly({
    p = ggplot(tmpds) +
      geom_point(aes(carat, price), alpha = 0.1) +
      facet_wrap_paginate(~ cut:clarity, ncol = 3, nrow = 3, page = 2)
    res = plotly::ggplotly(p)
  res})
}

# Run the application 
shinyApp(ui = ui, server = server)
image

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza ejecutando la aplicación Shiny proporcionada y compara la salida de renderPlot con renderPlotly y ggplotly usando facet_wrap_paginate(page = 2). Rastrea cómo se gestionan las opciones de facets paginados en la conversión a Plotly y considera resuelto el issue cuando la salida de Plotly muestre únicamente la página solicitada de facets.

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
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.