-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: New cartesian axis modebardisable
attribute
#7358
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
base: master
Are you sure you want to change the base?
Conversation
@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, Also a few thoughts on naming —
Maybe |
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 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? |
Very useful feature. Thanks @alexcjohnson. |
Hi @alexcjohnson ! Revisiting this one because we'd love to get it into the next minor release. Taking another look at the diff, I noticed there's an existing axis property called |
I think Perhaps |
So Or do you mean edit: on rereading your earlier post @alexcjohnson, I guess |
Ping @alexcjohnson |
@emilykl I like that! with the same flags as in this PR, So we'd end up with this as the attribute: modebardisable: {
valType: 'flaglist',
flags: ['auto', 'inout'],
extras: ['none'],
dflt: 'none',
editType: 'modebar',
description: [
'Disables certain modebar buttons for this axis.',
'*auto* disables the autoscale buttons, *inout* disables the',
'zoom-in and zoom-out buttons.'
].join(' ')
}, If we're agreed on this I'll be happy to make that change in the PR. |
I like this suggestion. |
modebardisable
attribute
@alexcjohnson @archmoj I like this EXCEPT I would prefer the flag names |
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, andinout
sets whether the zoom in / zoom out buttons affect this axis. You can also useall
(default) andnone
as shorthands.