Plotly.js: Unstable panning behavior when updating trace during pan

Created on 5 Aug 2019  路  3Comments  路  Source: plotly/plotly.js

codepen: https://codepen.io/jonmmease/pen/xvPzVg?editors=1010

When I update the position of an image (in data coordinates) while panning using the new plotly_relayouting event, everything works very smoothly. To do this, I'm using Plotly.react with layout.uirevision: true.

MoveImageRelayouting

But, if I update the position of a trace using the same approach, I get an unstable panning behavior.

MoveTraceRelayouting

I ran into this while working on updating the display of images/heatmaps while panning using Datashader.

Here's the kind of thing with Bokeh that I'm working towards with Plotly.js:

console_server

bug

All 3 comments

Thanks very much for the report! I'll investigate this further at some point today.

I couldn't find the exact cause to the problem, so in the meantime here are two working examples:

Thanks for taking a look! After playing around with your working react example, I think a key difference is that the xrange/yrange that I was passing into react came from gd._fullLayout, but yours ends up coming from gd.layout. It looks like gd._fullLayout updates during the drag while gd.layout does not. So to work around the issue, it looks like the axis ranges getting passed to react need to be the ranges at the start of the drag, not the current ranges.

If I add

newLayout.xaxis.range = gd.layout.xaxis.range.slice();
newLayout.yaxis.range = gd.layout.yaxis.range.slice();

right before the call to react my example works as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maxwell8888 picture maxwell8888  路  3Comments

archmoj picture archmoj  路  3Comments

taybart picture taybart  路  4Comments

etpinard picture etpinard  路  3Comments

boleslawmaliszewski picture boleslawmaliszewski  路  3Comments