-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Remove the scaleanchor constrain on axes having an image trace #6709
Comments
Good point! I don't see any way currently to turn this behavior off. Seems like the options are:
The second might be more discoverable in the documentation, but it's less direct and if you have multiple images you'd need to set this on all of them. The first requires you to figure out that the constraint is specified on the Y axis and that an explicit So I'd lean toward the first, plus a note somewhere in the docs for image trace about this setting in the Y axis. |
This would be great @alexcjohnson! What do you think @lvlte? |
Yes I would go for the first option too. I think I will make a PR this weekend or next week. |
|
In Keep square pixels + ability to have any rectangular shape zoom with Plotly.js, with a plot with 2 layers's answer by @lvlte, we see that it is sometimes useful to be able to remove the scaleanchor constrain applied by default on axes having an image trace.
But this doesn't work: setting
scaleanchor: false
on either or both axes has no effect.The easiest solution is to patch, in https://github.com/plotly/plotly.js/blob/v2.25.2/src/plots/cartesian/constraints.js#L34,
by
but this is not a solution in the long-term.
Do you think it could be useful to add a setting to avoid this manual patching?
The text was updated successfully, but these errors were encountered: