plotly / plotly/plotly.R

Add more bar tests

Offen
#967 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

ggplotly
Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Just making a note so I don't forget -- add more tests for 71e29b4

# https://github.com/ropensci/plotly/issues/831
df <- data.frame(
  V1 = gl(6,20), V2 = gl(40,3)
)
p <- ggplot(df, aes(x = V1, fill = V2)) + geom_bar(color="white")
ggplotly(p)


# https://github.com/ropensci/plotly/issues/560
d <- data.frame(
  x = LETTERS[1:10], 
  y = -5:4, 
  g = rep(c('A','B'), each = 5)
)

p <- ggplot(data = d, aes(x = x, y = y, fill = g)) +
  geom_bar(stat='identity')
ggplotly(p)

# https://github.com/ropensci/plotly/issues/901
data_before <- data.frame(
  year = c(2014,2014,2014,2015,2015,2015,2016,2016,2016),
  pet = c("dog","cat","bird","dog","cat","bird","dog","cat","bird"),
  wt = c(56, 25, 26, 10, 19, 41, 16, 17, 13)
)
data_after <- data.frame(
  year = c(2014,2014,2014,2015,2015,2015,2016,2016,2016),
  pet = c("dog","cat","bird","dog","cat","bird","dog","cat","bird"),
  wt = c(49, 18, 19,  3, 12, 34,  9, 10,  6)
)
p <- ggplot() +
  geom_bar(data = data_before, aes(year, wt, fill = pet), 
           stat = "identity", position = "dodge", width = 0.9, alpha = 0.5) +
  geom_bar(data = data_after, aes(year, wt, fill = pet), 
           stat = "identity", position = "dodge", width = 0.9) +
  labs(x = "Year", y = "Weight") +
ggplotly(p)

# https://github.com/ropensci/plotly/issues/874
dd <- data.frame(x = rnorm(100,5,2))
dd2 <- data.frame(x = rnorm(100,5,2))
p3 <- ggplot() + 
  geom_histogram(data = dd,aes(x = x,y = ..count..)) + 
  geom_histogram(data = dd2,aes(x = x,y = -..count..),color = 'green')
ggplotly(p3)



# https://github.com/ropensci/plotly/issues/968

p <- ggplot(data=dat, aes(x=time, y=total_bill)) +
  geom_bar(stat="identity") + coord_flip()
ggplotly(p)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es ist keine Testdatei und kein Einstiegspunkt angegeben. Beginne damit, die vorhandenen ggplotly-Tests für Balkendiagramme und Histogramme zu finden, und prüfe anschließend die mit den Issues 831, 560, 901, 874 und 968 verknüpften Reproduktionsbeispiele; abgeschlossen ist die Aufgabe, wenn jeder Fall durch Regressionstests abgedeckt ist und das erwartete Plot-Verhalten dokumentiert wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
data-visualization, testing
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.