0.1.48 • Published 4 years ago

react-zoom-pan v0.1.48

Weekly downloads
128
License
-
Repository
github
Last release
4 years ago

react-zoom-pan

npm MIT License Travis codecov Codacy Badge downloads

A react component that enables you to add pan,zoom,resize and rotation functionality to your application

screencast

About

With React-zoom-pan is a container component that has g zoom and pan functionality as well as adding resize,move,and rotatation capabilities to any child element .

The component is capable of:

  • Can handle thousands of elements .
  • Pan Viewport
  • Move elements
  • Resize elements.
  • Rotate elements.
  • Zoom.
  • Wheel zoom.
  • Fully customisable elements.

To watch a demo take a look at video that shows how to use the component.

To play with a live demo .

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Installation

npm install react-zoom-pan

Getting started

Using this component is really easy, Import the ZoomPan component,add the ZoomPan to your render method and add whatever other component inside the ZoomPan container. And that's all. Now all the components inside the container can be move,resize and rotate, you also can use your mouse wheel to zoom and pan.

import React, { Component } from 'react';
import ZoomPan from 'react-zoom-pan';

import './App.css';

export default class App extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div className="app-container">
        <div className="flow-container">
          <ZoomPan>
            <div x={800} y={50} w={200} h={50}>
              container 1
            </div>
            <div x={100} y={250} w={200} h={50}>
              container 2
            </div>
          </ZoomPan>
        </div>
      </div>
    );
  }
}

Here is the demo code:

Edit 1y2on87jj

Element Configuration

To set the dimensions like (x,y) positions or (width,height) on the children documents you can set the following properties:

nameDescriptions
yThe y coordinate of the top point of the element
wThe width of the element
hThe height of the element

Events

PropertyparamsDescriptions
onSelectItemstringset the zoom level.The possible values are:"month","week","day"
onChangestringset the zoom level.The possible values are:"month","week","day"
onAddItemstringset the zoom level.The possible values are:"month","week","day"
0.1.48

4 years ago

0.1.47

4 years ago

0.1.46

4 years ago

0.1.44

4 years ago

0.1.41

4 years ago

0.1.42

4 years ago

0.1.43

4 years ago

0.1.40

4 years ago

0.1.37

4 years ago

0.1.38

4 years ago

0.1.39

4 years ago

0.1.36

4 years ago

0.1.35

4 years ago

0.1.34

4 years ago

0.1.30

4 years ago

0.1.31

4 years ago

0.1.32

4 years ago

0.1.33

4 years ago

0.1.29

4 years ago

0.1.25

4 years ago

0.1.26

4 years ago

0.1.27

4 years ago

0.1.28

4 years ago

0.1.23

4 years ago

0.1.24

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago