Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cursor tool #662

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
Loading
from
Draft

Cursor tool #662

wants to merge 2 commits into from

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Oct 18, 2024

closes #380

WIP

cursor-2024-10-18_05.42.15.mp4
  • Allow adding a Cursor to:

    • subplots
    • Graphics
  • The cursor's current "source" position is where the pointer currently is. Either the subplot or the graphic the pointer is on.

  • When added to graphics, the cursor's current "source" position is based on the graphic the mouse pointer is currently on. When added to a graphic the cursor's data is always in the same space as the parent graphic's data, i.e. Cursor.data maps directly to Graphic.data. The offset of an individual cursor matches the offset of the graphic is is on top of.

  • Allow setting transforms from the source graphic to all over children, just do linear transform, I think this will work:

# w_source, h_source and width and height of source graphic bbox
# w_target, h_target are width and height of target graphic bbox

A = np.array([
    [w_target / w_source, 0],
    [0, h_target / h_source],
])

u = [source_x, source_y]

target_pos = A @ u
  • Allowing an arbitrary non-linear transform could also be useful for some visualizations, so allow setting an arbitrary function as a transform. If the Cursor has a permanent set parent graphic, an inverse transform could also be useful and settable!

  • Allow a cursor to be a scatter point of any shape

  • Line cursors one line, or two lines. If a line, then the endpoints are based on the bbox of the graphic or the subplot's extents.

  • When calling target graphics, know what the source graphic was to prevent the source graphic from also becoming a target during that "event call cycle". Could happen if bbox of graphics overlap.

  • When a graphic is deleted, remove it from the cursor list.

  • Have modes, for example to allow double click to "add a marker" that sticks in that location.

  • Let the source graphic either be dynamic (i.e. based on current mouse pointer position), or fixed so it only responds to a fixed source graphic.

  • Display text tooltips

This was referenced Oct 18, 2024
@kushalkolar
Copy link
Member Author

@clewis7 I think this can be greatly simplified after #744

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

Successfully merging this pull request may close these issues.

Hiding and using our own mouse cursors
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.