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
I discovered this as I was assembling this Plotly + statebins post. I am not convinced it is a bug yet, but it is certainly very confusing to me. While I experienced this behavior with symbol, I am guessing that it extends to other arguments, such as color, x, etc. If I had to choose I would say the behavior in the last example is closest to what I would expect, but of course using add_markers instead of the add_trace.
library(plotly)
df <- data.frame( x = 1:10 )
doesn't work
# doesn't work
df %>%
plot_ly() %>%
add_markers(
x = ~x, y = ~x,
symbol = ~1:nrow(df) > 5,
symbols = c("triangle-down","triangle-up"),
size = I(200)
)
works
# works
df %>%
plot_ly() %>%
add_markers(
x = ~x, y = ~x,
symbol = c(rep("a",5),rep("b",5)),
symbols = c("triangle-down","triangle-up"),
size = I(200)
)
works
# works
df %>%
plot_ly() %>%
add_markers(
x = ~x, y = ~x,
symbol = c(rep("triangle-down",5),rep("triangle-up",5)),
symbols = c("triangle-down","triangle-up"),
size = I(200)
)
works
# works
df %>%
plot_ly() %>%
add_trace(
x = ~x, y = ~x,
type = "scatter",
mode = "markers",
marker = list(
symbol = ~ifelse(1:nrow(df) > 5, "triangle-down", "triangle-up")
),
size = I(200)
)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I discovered this as I was assembling this Plotly + statebins post. I am not convinced it is a bug yet, but it is certainly very confusing to me. While I experienced this behavior with
symbol
, I am guessing that it extends to other arguments, such ascolor
,x
, etc. If I had to choose I would say the behavior in the last example is closest to what I would expect, but of course usingadd_markers
instead of theadd_trace
.doesn't work
works
works
works
The text was updated successfully, but these errors were encountered: