-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
enable persistence of selection info to the layout #6167
Comments
will this stay coordinates with |
Great question - when the user is creating or modifying the selection via GUI we'll set them both, but when rendering or rerendering the graph it seems like you might want it either way:
So perhaps we need a boolean attribute that explicitly says "when replotting, do I recalculate |
All good questions. Maybe they all roll up into "what to do if |
Regarding plotly.js/src/plots/cartesian/select.js Lines 788 to 835 in 1377356
Why both |
Probably because we want the result to be as if we had called |
This causes a large issue when trying to sync selected points between multiple plots (non-sub-plots). If the selections array even had an ids option that would be great |
Part of #1851 - split out so we can discuss it separately
To make it possible to retain selections across redraws or create a new selection programmatically, the selection data should be part of the layout. This also means that when you finish a selection, in addition to the
plotly_selected
event you'll also get aplotly_relayout
event. Probably no changes in the middle though (ie withplotly_selecting
).So what should these attributes look like? We need to describe the selection in data coordinates, including which axes / subplot we're selecting on; we need to support rectangular and lasso selections, as well as shift-select combinations of multiple regions and simultaneous selections on different subplots.
So I propose:
One tricky case here around
geo
subplots: for many projections when you pan or zoom, what was a rectangle is no longer a rectangle, what was a straight line is no longer straight. We may need to either (a) convert rect to lasso, and increase the density of points on the lassos when you pan/zoom after making the selection, or (b) keep track of the projection parameters in effect when the selection was made, so we can transform it to an accurate representation in the new projection. Option (a) will never be perfect, and will have occasional edge cases where it breaks down spectacularly, but (b) means adding a complicated bunch of logic to the drawing and point selection routines, and may have performance implications.mapbox
may have some of this issue, as it supports rotating and tilting, though straight lines are still pretty close to straight when the map is tilted even if they are no longer x/y aligned.polar
too, in the case where users set a nonzero inner radius.The text was updated successfully, but these errors were encountered: