config is not overwritting `ModeBarButtons` slot
Offen
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I have noticed that after placing a ModeBarButtons configuration, it is not overwritten / updated downstream.
Reproducible example:
library(plotly)
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
# This plotly only has the `toImage` modeBarButton
plot1 <- plot_ly() %>%
config(displaylogo = FALSE) %>%
config(modeBarButtons = list(list("toImage")))
plot1$x$config$modeBarButtons
#> [[1]]
#> [[1]][[1]]
#> [1] "toImage"
# This plotly also has the `toImage` modeBarButton only
plot2 <- plot_ly() %>%
config(displaylogo = FALSE) %>%
config(modeBarButtons = list(list("toImage"))) %>%
config(modeBarButtons = list(list("zoom")))
plot2$x$config$modeBarButtons
#> [[1]]
#> [[1]][[1]]
#> [1] "toImage"
Created on 2022-11-29 with reprex v2.0.2
This holds true for config(modeBarButtonsToAdd ...)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem Einstiegspunkt config() und reproduziere die beiden Beispiele aus dem Issue, indem du plot1$x$config$modeBarButtons mit plot2$x$config$modeBarButtons vergleichst. Der Fix ist abgeschlossen, wenn eine spätere Konfiguration von modeBarButtons den früheren Wert aktualisiert und dasselbe Verhalten für modeBarButtonsToAdd verifiziert ist.
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