pan-zoom-es5

2.0.3 • Public • Published

pan-zoom tiny unstable

Panning and zooming events for any target. May come handy for webgl, canvas, svg, images or pure html manipulations. Handles mobile pinch-zoom, drag and scroll interactions, provides inertial movement.

See demo.

npm install pan-zoom

const panzoom = require('pan-zoom');
 
panzoom(target, e => {
        //e contains all the params related to the interaction
 
        //pan deltas
        e.dx;
        e.dy;
 
        //zoom delta
        e.dz;
 
        //coordinates of the center
        e.x;
        e.y;
 
        //type of interaction: mouse, touch, keyboard
        e.type;
    }
);

Credits

This package puts together high-quality tiny components, so acknowledgment to their authors:

Package Sidebar

Install

npm i pan-zoom-es5

Weekly Downloads

0

Version

2.0.3

License

MIT

Last publish

Collaborators

  • mividtim