It would be great if PlotlyJS could autoscale an axis depending on the current data on the screen. The idea is as soon as you change visible data range, you don't care what is outside of it and just want to see the auto-scaled chart. I've implemented auto-scaling for Y axis and here is the demo: https://codepen.io/plotly-demo/pen/JOERgj. Try to change visible range or zoom in/out using mouse/touchpad (the implementation based on `dragTail` function) Example of usage: `Plotly.newPlot('myDiv', data, layout, { autoscaleYAxis: true })` My branch & commit: https://github.com/apalchys/plotly.js/commit/2afdb22611196f3976de48e26df8a893342b8286 Could you please look into it and let me know what do you think? Would it be useful addition to the library?
Activity
etpinard commentedon Nov 14, 2017
You mean something similar to #387 ?
etpinard commentedon Nov 14, 2017
See also #1876 for more possibly-related thoughts on the topic.
apalchys commentedon Nov 15, 2017
Sorry, I missed the #1876 issue. As far as I understand, my issue is exactly like this comment.
The main goal is dinamically (after interactions) autoranging one axis based on only the visible data.
alexcjohnson commentedon Nov 15, 2017
Yes, this will definitely be included when we address #1876 - closing it here, @apalchys feel free to contribute to the discussion over there.