using ggforce paginated figures with ggplotly
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)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- 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