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 -