~/talk

Why Writing a Pinch-to-Zoom Component Is Harder Than You Think

Talkat React Summit US 2025 · on Tuesday, 2025-11-18· at 12:35· [react, web-platform]

Describes a concrete implementation for the AG Charts React component: use touchstart/touchmove events, compute normalized coordinates, derive closed‑form equations for Zmin and Zmax (two equations, two unknowns), and feed results into a CSS transform for independent X and Y scale and translation. Code uses refs, a math solver, and useState for the transform; demo runs on an iPad. Covers practical caveats: finger swapping, tiny off‑axis offsets, and debouncing/snapping to remove fidgety scale changes.

AI-written summary · about

  1. 0:00Pinch-to-Zoom Component Challenge
  2. 1:23Independent X and Y-axis Control
  3. 3:41Unified Touch Interactions
  4. 6:10Interpolated Touch Coordinates
  5. 8:56Equation Implementation and Event Handling
  6. 10:28React Integration and CSS Transform
  7. 11:58Component Integration and Math Solver
  8. 13:51CSS Transformation Calculation
  9. 14:42Normalized Coordinate Space and Scale Calculation
  10. 15:37Realistic Touch Gestures and Caveats
  11. 17:16Pinch-to-Zoom Implementation Features
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.