plotly.js
plotly.js copied to clipboard
Bar / histogram traces break on single-ended (zoom) axis drag
- 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.
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
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.