Unified mouse, mouse wheel & single-touch event stream abstraction. Stream emits tuples of:
[type, {pos, click?, delta?, zoom}]
The click
and delta
values are only present if type == GestureType.DRAG
. Both (and pos
too) are 2-element arrays of [x,y]
coordinates.
The zoom
value is always present, but is only updated with wheel
events. The value will be constrained to minZoom
... maxZoom
interval (provided via options object).
yarn add @thi.ng/rstream-gestures
import * as rsg from "@thi.ng/rstream-gestures";
- Karsten Schmidt
© 2018 Karsten Schmidt // Apache Software License 2.0