API Docs for:
Show:

ViewportModule Class

Module: topology.viewport
Parent Module: topology

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

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

(
  • dimensions
  • canvas
  • svg
  • topo
  • zoomPlane
)
Undefined static

Propagate new dimensions to all the places that need them.

Parameters:

  • dimensions Object

    The new height and width.

  • canvas Object

    The canvas to which impute new dimensions.

  • svg Object

    The SVG container to which impute new dimensions.

  • topo Object

    The topology view to which impute new dimensions.

  • zoomPlane Object

    The zoomPlane to which impute new dimensions.

Returns:

Undefined: Nothing. This function generates only side effects.