plotly / plotly/plotly.R

using ggforce paginated figures with ggplotly

Ouverte
#2,164 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
R
Étoiles
2.7k
Forks
641
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par exécuter l’application Shiny fournie et comparez la sortie de renderPlot avec renderPlotly et ggplotly en utilisant facet_wrap_paginate(page = 2). Suivez la manière dont les paramètres des facets paginés sont gérés lors de la conversion vers Plotly, et considérez l’issue comme terminée lorsque la sortie Plotly n’affiche que la page de facets demandée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
r
Domaine
data-visualization
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.