Skip to content

Allow fixedrange axes to scaleanchor with constrain:domain #3460

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

Closed
wants to merge 1 commit into from

Conversation

etpinard
Copy link
Contributor

Compare

where the first one has fixedrange:true on both x and y axes, and the second does not. This was first reported in https://community.plot.ly/t/axis-constraints-without-zoom-use-scaleanchor-with-fixedrange/18354

Now, the scaleanchor logic is skipped for fixedrange:true. This makes sense when constraining by range (from #1522), but does it also make sense when constraining by domain (from #1767)?

Commit dee136d was added in the first scaleanchor PR #1522, to:

Lib.warn('ignored ' + containerOut._name + '.scaleanchor: "' +
containerIn.scaleanchor + '" to avoid either an infinite loop ' +
'and possibly inconsistent scaleratios, or because the target' +
'axis has fixed range.');

I can't imagine a scenario where constrain:'domain' would lead to an infinite loop.

@alexcjohnson @plotly/plotly_js can you think any?

@alexcjohnson
Copy link
Collaborator

The prohibition on fixedrange wasn't due to infinite loops, it was just that if you've fixed a range and constrained another range based on that, the second range would be fixed too, at least in span.

I suppose if both axes are fixedrange and constrain: 'domain' (as in your mock) there are no concerns: one of them will get a reduced domain but both will keep the specified ranges. If one is fixedrange (and constrain: 'domain'), the other one could in principle be either constrain, and it would need to be restricted to allow pan but not zoom.

@etpinard
Copy link
Contributor Author

etpinard commented Feb 5, 2019

Will be part of #3506

@etpinard etpinard closed this Feb 5, 2019
@etpinard etpinard deleted the scaleanchor-constrain-domain-fixedrange branch February 5, 2019 16:10
etpinard added a commit that referenced this pull request Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants