plotly / plotly/plotly.R

Better support for trellis displays

Aperta
#727 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
R
Stelle
2.7k
Fork
641
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Esamina prima l’argomento trellis proposto in #726 e il meccanismo esistente di subplot(). Una soluzione completa dovrebbe fornire una funzione trellis() che mantenga il controllo sulle righe di subplot e supporti un comportamento simile a quello di ggplot2, incluso mantenere le variabili di trellising fuori dalle legende e mostrarle come annotazioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
r
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.