-
-
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
errors during react() while drag-selecting #2644
Comments
I'm using the latest CDN build so I don't think that's it. It would be really nice for this to at least have the same behaviour as in #2643 ... /cc @alexcjohnson :) |
Ah, for clarity, here is the diff between the two cases: https://github.com/plotly/plotly.js-crossfilter.js/commit/23b1ff9bd8dc0a3923caf29e4d3feb960ec31234 |
Alright, managed to reproduce and understand what's going on here:
https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_api.js#L139-L145
I could do various simple things to avoid the particular error seen here (recalc before bailing out of I think the solution is to make something like @nicolaskruchten we talked about making the select box / lasso part of the figure - and that may still be part of this solution (just as we'd eventually like to have the hover data be part of the figure #1848, but I think the parts of the state that depend explicitly on mouse events (is the mouse up or down, where was it at mousedown) - which are necessary to fully recreate the plot after a mid-drag redraw - should not be part of the figure but should instead be kept as internal state. For one thing we don't really want the user to be able to say "start this plot out as though the mouse is down." For another, having this be internal state that we re-initialize after replot would allow us to clear it naturally if the change has obviated that state, like if the subplot was removed, @etpinard also brought up #1640 - an infinite loop created by using the hover event to do something that moves data points around (in that case adding/removing an annotation that changes the axis ranges) such that as soon as a point is hovered it is moved by the update so it's not hovered on, whereupon it's moved back again... I'll comment more over there, but similar loops could be an issue here too. |
This sounds like the correct way forward.
Yes. This one is in #1851
Can't wait for that one.
I agree 100% here. On a related topic, now that we're marching towards making every piece of selection interactions part of the plotly.js state, that is selections will soon be "fully" recreatable using |
Stumbled on #2120 which also reports |
Merged into #3305 |
@nicolaskruchten, I stumbled on a similar issue, but with different origin. I could not find a specific issue for this exact problem, but saw mentions of related issues on #2687 and #3305. The error is not repetitive, and I still didn't figure out the exact conditions reproduce it. Is there something I could do about it? Im using plotly.js ^1.58.4, with react-plotly.js ^2.5.1, to render a scatter3d plot that
The structure of my Plot component is as follows, and the React component is updated when data, layout and config properties change.
Detailed browser error view:
|
I'm trying to upgrade my crossfilter example to be more declarative by using
react()
but seeing errors. This is my attempt: https://github.com/plotly/plotly.js-crossfilter.js/blob/23b1ff9bd8dc0a3923caf29e4d3feb960ec31234/script.jsWhile drag-selecting on top of the Infant Mortality chart, the dashed-line selection box does not appear, and errors appear in the console:
The text was updated successfully, but these errors were encountered: