Page tree

Have questions? Stuck? Please check our FAQ for some common questions and answers.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

ZoomService

ZoomService is an Angular Factory in the SVG module with the name zoom.js. It creates an API (based on user settings) that allows the SVG Topology View layer (managed by d3) to zoom in and out. To use this API, see the documentation on injecting Angular services.

NameSummary
createZoomerCreates the ability to zoom on the given SVG layer and returns an API to control the zoom.

Function Descriptions

createZoomer

Creates the ability to zoom on the given SVG layer and returns an API to control the zoom.

Example UsageArgumentsReturn Value
var zoomer = zs.createZoomer(opts);

opts - an object containing:

svg: <d3 selection of svg element>

zoomLayer: <d3 selection of g element, child of svg element>

zoomEnabled: (optional) function reference that returns truthy values when zoom should be enabled and falsy values otherwise

zoomCallback: (optional) function reference to be called when the layer is zoomed

an object containing an API, see below
Returned API Example UsageArgumentsReturn Value
zoomer.panZoom(translate, scale);

translate -

scale -

 







  • No labels