1.2.0 • Published 7 years ago
@gomezhyuuga/react-pan-zoom v1.2.0
React Pan & Zoom
A simple pan and zoom for canvas like elements in react.
Demo
Installation
> yarn add @ajainarayanan/react-pan-zoomUsage
import ReactPanZoom from "@ajainarayanan/react-pan-zoom";
class MyComponent extends React.PureComponent {
public render() {
return (
<ReactPanZoom>
<img src="some/src/for/image.png" />
</ReactPanZoom>
);
}
}Props
zoom: Provide zoom level for the cavnas'ish element.1by defaultdx: Provide the initial x co-ordinate to pan the underlying element to be.0by defaultdy: Provide the initial y co-ordinate to pan the underlying element to be.0by default
For more information on what dx and dy mean please refer here
(tx == dx and ty == dy).