-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
update_*() batch methods #1484
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
Comments
I like it. Here are some places that come to mind where I can see this being immediately useful.
Another option, would be to support JSONPath-style keys in the existing
This would offer pretty complete flexibility, at the cost of perhaps a slightly higher learning curve. I'm also not sure how much we could reuse from existing libraries like https://github.com/kennknowles/python-jsonpath-rw. |
I think the JSONPath idea is a good one, but likely not a total replacement for either what I'm proposing here or magic-underscores... One other thing I want to throw into the mix is a more swiss-army-knifey |
Merged in #1534. It's not everything discussed in this issue, but it's the things that motivated the initial use case so I'm going to close this. We can open a new issue if there are chunks here that warrant further discussion. |
For real |
You're right. Done in #1548 |
Given that
px
produces figures which often have non-trivial numbers of fairly 'regular' axes/annotations/traces, it would be very convenient to have something likeFigure.update_traces( <patch>, <selector> )
-type methods e.g.In this example,
px.scatter()
generates somescatter
traces but also someviolin
ones, so the patch will only apply to thescatter
traces. Also note that this example uses some magic-underscores from #1481This would also be very convenient for changing axis-level attributes in the case of a facetted
px
plot with many axes, ditto theannotation
-based facet titles etc. In fact, I could see this being useful pretty much anywhere we have a collection of things either in a list (annotations, traces, shapes, etc) or with a number suffix (xaxis, yaxis, geo, scene, etc).A more uniform API where all the method are called
batch_update
likeFigure.data.batch_update()
orFigure.layout.xaxis.batch_update()
might work as well? The latter case maybe less nice, but there is no "collection" of x-axes on which to attach the method there :)The text was updated successfully, but these errors were encountered: