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

[FEATURE] Create option for wheel zoom tool to apply only to subplot nearest to the cursor position #13728

Open
droumis opened this issue Feb 29, 2024 · 1 comment · May be fixed by #13826
Open
Assignees
Labels
grant: CZI R5 Funded by CZI Round 5 grant type: feature
Milestone

Comments

@droumis
Copy link
Member

droumis commented Feb 29, 2024

Problem description

In the current implementation, when dealing with visualizations that incorporate multiple subplots (e.g., for simultaneously recorded timeseries data such as EEG, MEG, ECG in neuroscience), there's a need to zoom into specific groups of timeseries without affecting others. However, the current toolset necessitates creating multiple zoom tools for each group, leading to a cluttered interface. With the number of zoom tools scaling with the number of source groups, this becomes impractical beyond a couple of groups, compromising usability.

image

Feature description

I propose an enhancement to the wheel zoom tool that allows it to dynamically target the subplot (or group of subplots) under the cursor for zooming actions. This feature would enable a single wheel zoom tool to apply selectively based on the cursor's position over the plot, streamlining user interactions by keeping attention in the viewport rather than on an array of similar looking tools in the toolbar.

One potential implementation would be to expand the options for the 'level' arg (which normally specifies whether a tool applies to a base plot (level = 0) or a subplot (level = 1), see Bokeh's example) to allow for something like level='cursor'. I don't think is the solution since there may be elements on the base/parent level. Probably a better solution would be to utilize a new arg, something like follow_cursor=True, which, when combined with level=1, would allow for the behavior being described - only the subplot closest to the cursor is impacted. Yet another solution would be to create a distinct zoom tool specifically for this behavior.

This approach would simplify the UI and make it more intuitive for users to zoom into specific parts of the visualization relevant to their point of interest.

Potential alternatives

One alternative considered is maintaining the status quo with multiple zoom tools for each group, which is not scalable. A complex solution could involve custom scripting to manage zoom levels and targets dynamically, but this would significantly increase the burden on the user.

One less good but possible alternative is to utilize a dropdown menu in the toolbar to select a particular subplot group and then have a zoom tool apply to the selected group. While this mitigates the scalability issue, it adds complexity to specifying this custom dropdown tool for an action that should be easier to express and apply.

Additional information

Anticipated challenges:

  1. Handling scenarios where subplots overlap, which might necessitate a decision on which subplot(s) the zoom applies to when the cursor is above multiple groups. An initial approach could be to apply the zoom action to all underlying subplots, with further refinements as needed.

  2. When zooming out, at some point the subplot under the cursor may not be under the cursor any more, so 'applying to nearest subplot' is probably needed to maintain consistency.

  3. Integrating this dynamic zoom functionality with tap zoom tools presents a challenge, as tap zoom requires toolbar interaction. I suggest focusing on wheel zoom. Tap zoom might require a separate mechanism, such as an 'active group' selection through a dropdown in the toolbar... so separate issue.

tagging @jbednar, from whom this request most recently came.

@droumis droumis added the TRIAGE label Feb 29, 2024
@jbednar
Copy link
Contributor

jbednar commented Feb 29, 2024

That captures it all well, thanks! My concern is that the current status quo is not intuitive or discoverable or easy to use; if we have multiple zoom tools in the toolbar, which group they apply to is obscure, the fact that you have to pick one or the other is something the user has to figure out fairly painfully, and switching between groups is awkward. Whereas pointing to a group and using the scroll wheel is intuitive and obvious and doesn't require explanation; people will discover it immediately ("Oh! It only zooms this group! What if I move to the other group; does it now zoom that? Yes! Perfect!"). I strongly prefer UIs that don't require explanation. :-)

@mattpap mattpap added this to the 3.x milestone Feb 29, 2024
@droumis droumis added the grant: CZI R5 Funded by CZI Round 5 grant label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grant: CZI R5 Funded by CZI Round 5 grant type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants