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

Custom interactions #4531

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

Conversation

EdsterG
Copy link
Contributor

@EdsterG EdsterG commented Oct 25, 2024

Description

Partially Fixes #3950

The goal of this PR is to allow users to change default interactions, by modifying a global registry.

  • Define a global registry of default interactions for Axis and Axis3D.
  • Update RectangleZoom to use the registration functions registration_setup! and deregistration_cleanup!.
  • Update RectangleZoom deactivate when modifier key (if one is defined) is released before the mouse.
  • Allow LimitReset to be customizable.

I understand that a small subset of the interactions can be changed as an argument to Axis, however that doesn't solve the general problem of changing the default values for those interactions. For users that prefer to use non-default values, instead of forcing them to constantly pass a bunch of extra kwargs to Axis, this PR will allow them to specify new defaults, one time.

Type of change

Delete options that do not apply:

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@EdsterG EdsterG marked this pull request as draft October 25, 2024 19:41
@EdsterG
Copy link
Contributor Author

EdsterG commented Oct 30, 2024

Any high level thoughts on this @ffreyer?

@EdsterG
Copy link
Contributor Author

EdsterG commented Dec 7, 2024

@SimonDanisch I think Makie is very close to becoming the goto library for interactive dashboard. In my opinion, allowing users to customize interactions will help solidify Makie as the best library for complex dashboard. Here's a simple use case which requires the default interactions to change. Right click to drag/pan, left click to control the vertical bar, modifier + left click to box zoom.

example.mov

@EdsterG EdsterG marked this pull request as ready for review December 9, 2024 17:29
@SimonDanisch
Copy link
Member

Thanks!
I think this should be part of the theme, shouldn't it?

@EdsterG
Copy link
Contributor Author

EdsterG commented Dec 10, 2024

I think interactions can go both ways, part of the theme or not part of the theme. They aren't currently part of theme. What's your preference? If you prefer having them be part of the theme, how do you suggest they be added? Doing something like this Axis3 = (interactions=Dict(...),) feels a bit unnatural and clunky because it's bypassing the register/deregister interface.

# Conflicts:
#	CHANGELOG.md
#	src/makielayout/blocks/axis3d.jl
@EdsterG
Copy link
Contributor Author

EdsterG commented Dec 23, 2024

@SimonDanisch any suggestions for how to make this part of the theme? Or shall it be left as is for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

FR: Add ability to change the "reset zoom" binding
2 participants