You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 off event (i.e., 'plotly_doubleclick') to match the on event (i.e., 'plotly_hover'). You can change this default via the highlight() 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”
The text was updated successfully, but these errors were encountered:
ismirsehregal
changed the title
highlight() function: setting the off event to 'plotly_hover' results in an error.
highlight() function: setting the 'off' event to 'plotly_hover' results in an error.
Oct 16, 2020
ismirsehregal
changed the title
highlight() function: setting the 'off' event to 'plotly_hover' results in an error.
highlight() function: setting the 'off' event to 'plotly_unhover' results in an error.
Oct 20, 2020
This is a modified example from here:
Not providing
off
results in a warning:Setting
off
toplotly_hover
orplotly_unhover
(my initial intention) results in an error:Found this via: https://stackoverflow.com/a/64387370/9841389
PS: using the latest CRAN version of
plotly
.The text was updated successfully, but these errors were encountered: