├── .browserslistrc
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── babel.config.js
├── build
└── rollup.config.js
├── dist
├── vue-panzoom.esm.js
├── vue-panzoom.min.js
└── vue-panzoom.umd.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── src
├── components
│ └── pan-zoom
│ │ ├── component.vue
│ │ ├── script.js
│ │ └── template.html
└── main.js
└── vue.config.js
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not ie <= 8
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | public
4 | dist/*.gz
5 | dist/*.map
6 | coverage
7 | docs/.vuepress/dist
8 |
9 | # local env files
10 | .env.local
11 | .env.*.local
12 |
13 | # related test files
14 | /tests/e2e/reports
15 | /tests/e2e/videos
16 | /tests/e2e/screenshots
17 |
18 | # editor directories and files
19 | .idea
20 | .vscode
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw*
26 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | // TODO: release log here ...
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 Isa Frimpong <mistabiggx@gmail.com>
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-panzoom
2 |
3 | This is a [Vue.js](https://vuejs.org/) port of [panzoom](https://github.com/anvaka/panzoom), an extensible, mobile friendly pan and zoom framework (supports DOM and SVG).
4 |
5 | # Demo
6 |
7 | * [Regular DOM object](https://anvaka.github.io/panzoom/demo/dom.html)
8 | * [Standalone page](https://anvaka.github.io/panzoom/demo/index.html) - this repository
9 | * [YASIV](http://www.yasiv.com/#/Search?q=algorithms&category=Books&lang=US) - my hobby project
10 | * [SVG Tiger](https://jsfiddle.net/uwxcmbyg/609/) - js fiddle
11 |
12 | # Installation
13 |
14 | Using npm
15 |
16 | ```
17 | npm install vue-panzoom --save
18 | ```
19 |
20 | Using yarn
21 |
22 | ```
23 | yarn add vue-panzoom
24 | ```
25 |
26 | # Usage
27 |
28 | *main.js*
29 | ``` js
30 | // import Vuejs
31 | import Vue from 'vue'
32 | import App from './App.vue'
33 |
34 | // import vue-panzoom
35 | import panZoom from 'vue-panzoom'
36 |
37 | // install plugin
38 | Vue.use(panZoom);
39 |
40 | new Vue({
41 | render: h => h(App),
42 | }).$mount('#app')
43 | ```
44 |
45 | *App.vue*
46 | ``` html
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
You can zoom me
57 |
58 |
59 |
60 |
61 |
66 |
67 |
68 |
69 | ```
70 |
71 | ## Changing the component's name
72 |
73 | If you wish to change the name of the vue component from the default panZoom, you pass an option to the plugin like so:
74 | ``` js
75 | Vue.use(panZoom, {componentName: 'yourPanZoom'});
76 | ```
77 |
78 | and then use in your vue template like so:
79 | ``` html
80 |
81 | ```
82 |
83 | # Attributes
84 | ### selector
85 | Use this to specify an element within the scope of vue-panzoom component instance, to apply panZoom to. Default is the first root element of the vue-panzoom component. It accepts standard css selector specification.
86 | ``` html
87 |
88 |