Optional
backgroundOptional background. Can also be set via setBackground(..)
The element to apply pan/zoom to.
Optional
clampWhether to clamp when panning such that there is always content visible. Defaults to true.
Optional
clampWhether or not to clamp to the background image. This flag means the widget will always ensure at least some
of the background is visible. See clampToBackgroundExtents
for a variant of this. Defaults to false.
Optional
clampClamps movement so that when zoomed out, the background image always fills the viewport. Defaults to false.
Optional
clampWhether to clamp when zooming such that there is always content visible. Defaults to true.
Optional
consumeUseful for development: set this to false if you don't want the widget to consume context menu clicks.
Optional
enableEnable animations for panning. Defaults to true.
Optional
enableWhether or not pan is enabled. Defaults to true.
Optional
enabledWhether or not the widget is enabled, ie. responding to mouse input. Defaults to true.
Optional
eventsOptional map of event handlers
Optional
maybeOptional interceptor for zoom. Returning false prevents zoom from occurring.
Optional
mousedown?: FunctionOptional function callback for mousedown event.
Optional
mousemove?: FunctionOptional function callback for mousemove event.
Optional
mouseup?: FunctionOptional function callback for mouseup event.
Optional
pan?: FunctionOptional function callback for when pan changes.
Optional
transformOptional function callback for transform origin change. This is given the [x,y] (in percent) of the new origin, and the [left, top] (in absolute values) of the canvas.
Optional
zoom?: FunctionOptional function callback for when zoom changes.
Optional
filterOptional filter that will be called on down event, with the event target and the event. Returning true from this function means the widget should respond to the event.
A function that can return the x,y location of the given element, relative to the origin of the canvas the pan zoom is controlling.
A function that can return the x,y location of the given element, relative to the document origin
Gets the size of some element
Function the widget can use to derive an ID for the given element.
Optional
panHow far, in pixels, to pan on pan nudge. Defaults to 50 pixels.
Optional
panOptional function which is called at the start of panning and can return false to reject pan starting.
Optional
panDefaults to false. When true, user must hold down meta key (ctrl on windows) to pan.
Optional
smartNOT IMPLEMENTED. This is a placeholder for possible future functionality, which will mean that the lower zoom bound refers to a multiple of the content bounds, not the viewport.
The element that will act as the viewport for the canvas.
Options for the wheel.
Optional
zoomInitial zoom for the widget. Defaults to 1.
Optional
zoomZoom range for the widget. Defaults to [0.05, 3].
Options for the PanZoom widget. This widget is used internally by the Toolkit and is not something users of the library will need to interact with.