highlight() function: setting the 'off' event to 'plotly_unhover' results in an error.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
This is a modified example from here:
library(plotly)
# load the `txhousing` dataset
data(txhousing, package = "ggplot2")
# declare `city` as the SQL 'query by' column
tx <- highlight_key(txhousing, ~city)
# initiate a plotly object
base <- plot_ly(tx, color = I("black")) %>%
group_by(city)
# create a time series of median house price
time_series <- base %>%
group_by(city) %>%
add_lines(x = ~date, y = ~median)
highlight(
time_series,
on = "plotly_hover",
off = "plotly_hover", # causes error
selectize = FALSE,
dynamic = FALSE,
color = "red",
persistent = FALSE
)
Not providing off results in a warning:
Setting the
offevent (i.e., 'plotly_doubleclick') to match theonevent (i.e., 'plotly_hover'). You can change this default via thehighlight()function.
Setting off to plotly_hover or plotly_unhover (my initial intention) results in an error:
Error in match.arg(off, off_options) :
'arg' should be one of “plotly_doubleclick”, “plotly_deselect”, “plotly_relayout”
Found this via: https://stackoverflow.com/a/64387370/9841389
PS: using the latest CRAN version of plotly.
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
Beginnen Sie am Einstiegspunkt highlight() und reproduzieren Sie das modifizierte txhousing-Beispiel, bei dem off auf plotly_hover und plotly_unhover gesetzt ist. Untersuchen Sie die Validierung von off_options und vergleichen Sie sie mit dem dokumentierten Ereignisverhalten; als erledigt gilt, wenn gültige off-Ereignisse nicht mehr den gemeldeten match.arg-Fehler auslösen und sich das Beispiel wie vorgesehen verhält.
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
- 38/100