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

New cartesian axis modebarbuttons attribute #7358

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alexcjohnson
Copy link
Collaborator

Gives you the ability to disable certain modebar buttons for an axis, without otherwise impacting the interactivity of that axis. This is useful for example if you have one axis with data over a very broad range (like a time series, or in my case, data down a several-thousand-meter drill hole) and the opposite axes have a relatively limited, well-defined range that you don't need to change much.

I made this attribute as a flaglist, mostly for future expansion if needed since there are only two flags right now: auto sets whether the autorange button affects this axis, and inout sets whether the zoom in / zoom out buttons affect this axis. You can also use all (default) and none as shorthands.

@gvwilson gvwilson requested a review from emilykl February 10, 2025 14:49
@gvwilson gvwilson added feature something new P1 needed for current cycle labels Feb 10, 2025
@emilykl
Copy link
Contributor

emilykl commented Feb 17, 2025

@alexcjohnson It's not entirely clear to me how to think about which buttons are intended to be included/excluded by these options. The most extreme interpretation of, say, inout would seem to be that every other modebar button besides zoomin / zoomout has no effect on that axis -- including e.g. zoom, pan, boxselect. I'm not sure that's a desired behavior (and that's not the behavior of your PR) -- but how can we clarify to the user that buttons like zoom and pan are not affected by this flag? Feel free to let me know if I'm thinking about this the wrong way.

Also a few thoughts on naming —

auto is a bit confusing to me as it makes me think of "automatically choose which modebar buttons affect this axis" rather than "autoscale". How about simply autoscale?

Maybe zoominout rather than inout as well?

@alexcjohnson
Copy link
Collaborator Author

Good point. Maybe this would be clearer as a container with booleans in it, rather than a flaglist? That would also be more extensible, since those booleans could default to true which you can't do with a flaglist. This would work with a flaglist of buttons to disable, but that seems even more confusing.

So perhaps:

modebarbuttons: {
    autoscale: false,
    zoominout: false
}

That's more verbose when you want to disable both, but seems clearer about exactly what it applies to. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants