plotly / plotly/plotly.R

Discrete axis fails to remove "interior" categories in response to filter interactions

Offen
#689 9 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

I am using the example from the plotly page to generate a bar plot. I am also using plotly devel version 4.3.4. Here is the code:

library(plotly)

df <- data.frame(x = as.factor(LETTERS[1:5]), 
                 y = sample(10:20, size = 5))

# First change factor levels
df$x <- factor(df$x, levels = c("C", "B", "A", "D", "E"))

# Plot
p <- ggplot(df, aes(x, y, fill = x)) + 
  geom_bar(stat = "identity") +
  ggtitle("Bar Chart with changed factor levels")

ggplotly(p)


> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotly_4.3.4         ggplot2_2.1.0        BiocInstaller_1.23.6

On the plot.ly page, when I click on one of the bars in the middle (blue/green) the plot gets autoscaled and the placeholders disappear. But when I generate the plot using the code in R and click on the middle bars, the placeholders are still there.

Here I have clicked A to remove that bar but as you can see the placeholder remains:

screen shot 2016-08-17 at 5 29 01 pm

When I click on the bars at either end, the plot auto-adjusts and placeholders are removed. How can I remove the placeholders when clicking one of the middle bars?

Thanks!

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

Führen Sie zunächst das mitgelieferte R-Beispiel mit plotly 4.3.4 und den neu angeordneten Faktorstufen aus und reproduzieren Sie anschließend die im Issue beschriebene Filterinteraktion des mittleren Balkens. Vergleichen Sie sie mit dem verlinkten ggplot2-Balkendiagrammbeispiel; als erledigt gilt die Aufgabe, wenn innere Kategorien verschwinden oder die diskrete Achse nach dem Filtern konsistent neu skaliert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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