Skip to content

Add touch input#19

Merged
CSSFrancis merged 1 commit into
mainfrom
feat/touch-input
Jun 16, 2026
Merged

Add touch input#19
CSSFrancis merged 1 commit into
mainfrom
feat/touch-input

Conversation

@CSSFrancis

Copy link
Copy Markdown
Owner

A touch-to-mouse bridge (_attachTouch, attached per panel in _attachPanelEvents) translates touch gestures into the existing mouse/wheel handlers via real MouseEvent/WheelEvent dispatch, so every panel kind and every example becomes touch-capable with no handler rewrites:

  • 1 finger drag -> pan / orbit / drag a widget, ROI, marker or plane
  • 2 fingers pinch -> zoom (wheel), centred on the gesture midpoint
  • double-tap -> dblclick -> the panel's double_click event

move/up dispatch to document (handlers listen there for off-canvas drags); down/wheel/dblclick to the overlay canvas. Overlay canvases set touch-action:none so the browser yields gestures to the plot rather than scrolling the page.

Tests: Playwright touch emulation (has_touch=True) across 2D/3D/1D drag, pinch zoom, and double-tap; 416 existing mouse-interaction tests unchanged.

A touch-to-mouse bridge (_attachTouch, attached per panel in
_attachPanelEvents) translates touch gestures into the existing mouse/wheel
handlers via real MouseEvent/WheelEvent dispatch, so every panel kind and
every example becomes touch-capable with no handler rewrites:

  - 1 finger  drag  -> pan / orbit / drag a widget, ROI, marker or plane
  - 2 fingers pinch -> zoom (wheel), centred on the gesture midpoint
  - double-tap      -> dblclick -> the panel's double_click event

move/up dispatch to document (handlers listen there for off-canvas drags);
down/wheel/dblclick to the overlay canvas.  Overlay canvases set
touch-action:none so the browser yields gestures to the plot rather than
scrolling the page.

Tests: Playwright touch emulation (has_touch=True) across 2D/3D/1D drag,
pinch zoom, and double-tap; 416 existing mouse-interaction tests unchanged.
Full suite 1330 passed / 58 skipped.
@CSSFrancis CSSFrancis changed the title Add touch input: plots usable on iPad / iPhone Add touch input Jun 16, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.62%. Comparing base (0ea8633) to head (e1886bc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #19   +/-   ##
=======================================
  Coverage   90.62%   90.62%           
=======================================
  Files          33       33           
  Lines        2741     2741           
=======================================
  Hits         2484     2484           
  Misses        257      257           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CSSFrancis CSSFrancis merged commit 0f8badb into main Jun 16, 2026
12 checks passed
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.

2 participants