Plugin to Pan and Zoom elements, including SVG

Version 1.2


Based on:

https://timmywil.com/panzoom/


Sample App:
https://visualneo.com/tutorials/neopanzoom

 

neoPanZoomInit

Purpose:

Initializes neoPanZoom plugin

Category:

neoPanZoom

Syntax:

neoPanZoomInit "elementName" startX startY theScale

 

elementName

Container or SVG element name

startX

Start X position (ie: 0)

startY

Start Y position (ie: 0)

theScale

Start scale factor (ie: 1)

 

neoPanZoomSetOptions

Purpose:

Set neoPanZoom plugin options

Category:

neoPanZoom

Syntax:

neoPanZoomSetOptions "elementName" theMinScale theMaxScale theZoomWithWheel animationDuration theEasing theContain thePanOnlyWhenZoomed

 

elementName

Container or SVG element name

theMinScale

Min scale (ie: 1)

theMaxScale

Max scale (ie: 5)

theZoomWithWheel

Allow mouse wheel zooming?

animationDuration

Duration of the transition (ms)

theEasing

Animation easing

theContain

Contain the panzoom element either inside or outside the parent.

thePanOnlyWhenZoomed

Disable panning while the scale is equal to the starting value

 

neoPanZoomSetPan

Purpose:

Pan the Panzoom element to the given x and y coordinates

Category:

neoPanZoom

Syntax:

neoPanZoomSetPan "elementName" posx posy

 

elementName

Container or SVG element name

posx

X pan

posy

Y pan

 

neoPanZoomSetPanRelative

Purpose:

Pan the Panzoom element to the given x and y relative to current position coordinates

Category:

neoPanZoom

Syntax:

neoPanZoomSetPanRelative "elementName" posx posy

 

elementName

Container or SVG element name

posx

X pan

posy

Y pan

 

neoPanZoomSetZoom

Purpose:

Zoom the Panzoom element to the given scale

Category:

neoPanZoom

Syntax:

neoPanZoomSetZoom "elementName" theZoom

 

elementName

Container or SVG element name

theZoom

Zoom factor

 

neoPanZoomSetPanAndZoom

Purpose:

Pan and Zoom the Panzoom element to the given x and y coordinates and zoom factor

Category:

neoPanZoom

Syntax:

neoPanZoomSetPanAndZoom "elementName" posx posy theZoom

 

elementName

Container or SVG element name

posx

X pan

posy

Y pan

theZoom

theZoom

 

neoPanZoomGetPanX

Purpose:

Get pan x displacement

Category:

neoPanZoom

Syntax:

neoPanZoomGetPanX "elementName" [panx]

 

elementName

Container or SVG element name

panx

Variable to store X pan

 

neoPanZoomGetPanY

Purpose:

Get pan y displacement

Category:

neoPanZoom

Syntax:

neoPanZoomGetPanY "elementName" [pany]

 

elementName

Container or SVG element name

pany

Variable to store Y pan

 

neoPanZoomGetZoom

Purpose:

Get the zoom factor

Category:

neoPanZoom

Syntax:

neoPanZoomGetZoom "elementName" [theZoom]

 

elementName

Container or SVG element name

theZoom

Variable to store zoom factor

 

neoPanZoomLockMouse

Purpose:

Locks mouse events.

Category:

neoPanZoom

Syntax:

neoPanZoomLockMouse "elementName"

 

elementName

Container or SVG element name

 

neoPanZoomLockX

Purpose:

Locks horizontal panning.

Category:

neoPanZoom

Syntax:

neoPanZoomLockX "elementName"

 

elementName

Container or SVG element name

 

neoPanZoomLockY

Purpose:

Locks vertical panning.

Category:

neoPanZoom

Syntax:

neoPanZoomLockY "elementName"

 

elementName

Container or SVG element name