Description
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 deletinggd.calcdata
, or just check ifgd.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
andPlots.rehover
but for dragging, so we can get rid of thatgd._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 differentdragmode
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:
plotly.js/src/plot_api/plot_api.js
Lines 139 to 149 in 7bb5daa
Note that this same problem affect panning on graphs with axis.automargin: true
: https://codepen.io/etpinard/pen/BGEjwY?editors=0010