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

easy way of tying minallowed/maxallowed to the computed range

Open archmoj opened this issue 2 years ago • 5 comments

Out of curiosity: is there an easy way of tying minallowed/maxallowed to the computed range? Basically to let Plotly.js compute the autorange and set min/max allowed to that automatically, thereby implementing "zoom in but not out" without having to separately compute ranges outside of Plotly.js?

Originally posted by @nicolaskruchten in https://github.com/plotly/plotly.js/issues/887#issuecomment-1802654077

archmoj avatar Nov 08 '23 21:11 archmoj

What is the status of this one? I am able to limit zoom/pan only by minallowed, maxallowed is not working.

sirpeas avatar Jan 04 '24 09:01 sirpeas

“maxallowed is not working” would be a separate bug, are you able to reproduce this in a codepen? Thanks!

alexcjohnson avatar Jan 04 '24 10:01 alexcjohnson

@alexcjohnson actually it's not working in the official example https://plotly.com/python/axes/#setting-a-maximum-and-minimum-allowed-axis-value, change mode to pan and move to the right. I will try to create codepen later

sirpeas avatar Jan 04 '24 12:01 sirpeas

@sirpeas that example looks to me like it's behaving correctly: there's only a minallowed on the x axis (so you can pan as far to the right as you want, but you're limited on the left) and only a maxallowed on the y axis (so you can pan as far down as you want but not up).

alexcjohnson avatar Jan 04 '24 16:01 alexcjohnson

Ok I figured it out https://codesandbox.io/p/sandbox/plotly-forked-d7my6

For others who will have the same issue, for category charts maxallowed and mixallowed are related to index from the feed array.

sirpeas avatar Jan 04 '24 17:01 sirpeas

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

gvwilson avatar Jul 12 '24 12:07 gvwilson