Skip to content
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

Allow replot during drag interactions #3305

Closed
etpinard opened this issue Dec 3, 2018 · 4 comments
Closed

Allow replot during drag interactions #3305

etpinard opened this issue Dec 3, 2018 · 4 comments
Assignees
Milestone

Comments

@etpinard
Copy link
Contributor

etpinard commented Dec 3, 2018

Combining issues #2438, #2687, #2644 and #2643 into a single ticket - as all these issues are likely to be fixed once we implement @alexcjohnson 's #2644 (comment) :

I could do various simple things to avoid the particular error seen here (recalc before bailing out of Plotly.plot, or use some other signal besides deleting gd.calcdata, or just check if gd.calcdata exists before trying to relink it) but all of those have problems of various severity with the plot data being out of sync with the displayed plot, which are going to bite us down the line in obvious or subtle ways.

I think the solution is to make something like gd._hoverData and Plots.rehover but for dragging, so we can get rid of that gd._dragging bail out, actually do the replot, then re-establish the partial drag (be it a pan, a zoom, a select...). Obviously this has the potential to be a bit of a project, given all the different dragmode settings; but it would also address the use case of streaming (or otherwise changing independent of user interaction) data.

N.B. the promise rejections comes from:

// if the user is trying to drag the axes, allow new data and layout
// to come in but don't allow a replot.
if(gd._dragging && !gd._transitioning) {
// signal to drag handler that after everything else is done
// we need to replot, because something has changed
gd._replotPending = true;
return Promise.reject();
} else {
// we're going ahead with a replot now
gd._replotPending = false;
}


Note that this same problem affect panning on graphs with axis.automargin: true: https://codepen.io/etpinard/pen/BGEjwY?editors=0010

@etpinard
Copy link
Contributor Author

etpinard commented Apr 1, 2019

Examples from previous issues:

@brian428
Copy link

brian428 commented Apr 4, 2019

I'll add that if you click to edit an annotation, then click the annotation again while the text field is showing, Plotly throws "Uncaught (in promise): [object Undefined]" during the relayout. I assume it's related to this issue.

@etpinard
Copy link
Contributor Author

etpinard commented Apr 4, 2019

@brian428

I'll add that if you click to edit an annotation, then click the annotation again while the text field is showing

This deserves a separate issue. Would you mind opening one and/or sharing a reproducible codepen? Thank you!

@etpinard
Copy link
Contributor Author

etpinard commented Apr 5, 2019

Closing (but might re-open later) as #3716 is now merged.

Starting in 1.47.0, all the bug reports listed in this ticket should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants