d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
507 stars 143 forks source link

horizontal only? #215

Open Fil opened 4 years ago

Fil commented 4 years ago

I don’t think it’s possible to have a drag or zoom behavior that works only horizontally and doesn’t “trap” the natural vertical scrolling gesture?

LifeIsStrange commented 4 years ago

duplicate of https://github.com/d3/d3-zoom/issues/48 and https://github.com/d3/d3-zoom/pull/171 ?

Fil commented 4 years ago

Not the same issue, since the difficulty here is not about applying only t.x. It's more about reading horizontal scroll, but leaving the natural vertical scroll to the browser.

hammerjs does it this way: https://github.com/hammerjs/hammer.js/blob/master/src/touchactionjs/touchaction-constructor.js#L109