ViewportModule Class
Manage panning and zooming events on the canvas.
Emitted events:
- beforePageSizeRecalculation:
- afterPageSizeRecalculation: events fired before and after the environment graph is resized to allow other sized itemsto calculate what they need.
Item Index
Methods
Methods
getContainer
()
Object
Retrieve the DOM element that contains the UI. This exists primarily to make it easy for tests to substitute their own container.
Returns:
Object:
A DOM node.
resized
()
Undefined
Set the visualization size based on the viewport.
The beforePageSizeRecalculation and afterPageSizeRecalculation events allow other page components that may unintentionally affect the page size, such as the charm panel, to get out of the way before we compute sizes.
Returns:
Undefined:
Nothing, this function generates only side effects.
setAllTheDimensions
(
Undefined
static
-
dimensions -
canvas -
svg -
topo -
zoomPlane
Propagate new dimensions to all the places that need them.
Parameters:
-
dimensionsObjectThe new height and width.
-
canvasObjectThe canvas to which impute new dimensions.
-
svgObjectThe SVG container to which impute new dimensions.
-
topoObjectThe topology view to which impute new dimensions.
-
zoomPlaneObjectThe zoomPlane to which impute new dimensions.
Returns:
Undefined:
Nothing. This function generates only side effects.
