-
Notifications
You must be signed in to change notification settings - Fork 632
add support for partial updates in style(), fixes #1342 #1343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think this is quite right. The plotly.js semantics are that whatever object is found at the property path, is completely replaced. Your semantics appear to be more like if there is a p <- plot_ly(x = 1:10, y = 1:10, symbol = I(15), marker = list(
line = list(
width = 5,
color = "orange"
)
))
p
# According to plotly.js semantics, this should revert the marker line
# back to its default color, but with this PR it's still orange
style(p, marker.line = list(width = 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
return(trace) | ||
} | ||
trace[[path[1]]] <- trace[[path[1]]] %||% setNames(list(NULL), path[2]) | ||
trace[[path[1]]] <- trace_replace(trace[[path[1]]], path[-1], value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is fine but I think you could've also just replaced both of these lines (73 and 74) with:
trace[[path[1]]] <- trace_replace(trace[[path[1]]] %||% list(), path[-1], value)
No description provided.