Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add axis autoscaling #2158

Closed
apalchys opened this issue Nov 14, 2017 · 4 comments
Closed

Add axis autoscaling #2158

apalchys opened this issue Nov 14, 2017 · 4 comments

Comments

@apalchys
Copy link
Contributor

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: apalchys@2afdb22

Could you please look into it and let me know what do you think? Would it be useful addition to the library?

@etpinard
Copy link
Contributor

You mean something similar to #387 ?

@etpinard
Copy link
Contributor

See also #1876 for more possibly-related thoughts on the topic.

@apalchys
Copy link
Contributor Author

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
Copy link
Collaborator

Yes, this will definitely be included when we address #1876 - closing it here, @apalchys feel free to contribute to the discussion over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants