plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Bar / histogram traces break on single-ended (zoom) axis drag

Open alexcjohnson opened this issue 9 years ago • 2 comments

  • Make a bar or histogram plot. To see it even more clearly, use a plot with bars and something else like scatter - for example http://localhost:3000/devtools/test_dashboard/#bar_line
  • Position your mouse over an axis end or corner dragger - anywhere the mouse cursor becomes a single-ended arrow
  • Drag. The scatter or other traces stay scaled correctly as the axis/axes zoom. The bar trace(s) don't, they just pan.

alexcjohnson avatar Dec 14 '16 07:12 alexcjohnson

The issue seems to be slightly more subtle (or has changed since originally reported)

  • If you are dragging from the low end of the X axis or the high end of the Y axis, then the bars appear to pan, but moving far further than they aught to, but
  • If you are dragging from the high end of the X axis, or the low end of the Y axis, then the bars do not move until a click-up event, at which point they redraw.

Fairly easy to see on these mocks as well, with the rendering being corrected once the users stopps the drag. http://localhost:3000/devtools/test_dashboard/#basic_bar http://localhost:3000/devtools/test_dashboard/#stacked_bar http://localhost:3000/devtools/test_dashboard/#grouped_bar

rpaskowitz avatar Jan 31 '17 20:01 rpaskowitz

This is a side effect of @rreusser https://github.com/plotly/plotly.js/pull/762 where

subplot.plot
  .selectAll('.points').selectAll('.point')

(unfortunately) also selects <g points> nodes in bar traces. Easy fix coming up.

etpinard avatar Feb 10 '17 15:02 etpinard