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

refactor: V2 "mouseable" canvas objects, remove mouse logic from qt/jupyter views #64

Merged
merged 7 commits into from
Dec 10, 2024

Conversation

tlambert03
Copy link
Member

this pulls the logic that was patching mouse events from the Qt/Jupyter view side of things, and patches them directly on the canvases themselves. The canvas becomes a "Mouseable" object, and gains mouseMoved, mousePressed, and mouseReleased signals, as well as on_mouse_x() callbacks. This paves the way for some of the stuff in histograms to use the same base logic as the image canvas, without needing to deal with them each separately on the "main" view objects.

it also fixes pygfx again to work for jupyter, and gives a more generic run_app() method (which will help for #62 )

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 64.40678% with 84 lines in your changes missing coverage. Please review.

Please upload report for BASE (v2-mvc@7dba289). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/ndv/views/_app.py 62.00% 38 Missing ⚠️
src/ndv/views/_mouse_events.py 40.32% 37 Missing ⚠️
src/ndv/views/_pygfx/_pygfx.py 80.64% 6 Missing ⚠️
src/ndv/views/protocols.py 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             v2-mvc      #64   +/-   ##
=========================================
  Coverage          ?   74.25%           
=========================================
  Files             ?       31           
  Lines             ?     3026           
  Branches          ?        0           
=========================================
  Hits              ?     2247           
  Misses            ?      779           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03 tlambert03 changed the title refactor: V2 "mouseable" events refactor: V2 "mouseable" canvas objects, remove mouse logic from qt/jupyter views Dec 10, 2024
@tlambert03 tlambert03 merged commit 78fffd9 into pyapp-kit:v2-mvc Dec 10, 2024
17 checks passed
@tlambert03 tlambert03 deleted the v2-mouseable branch December 10, 2024 12:23
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.

1 participant