Is there a 'zoom' event to track?


We embed the Viewer in our processing webapp. We added a fullscreen functionality which scales the Viewer’s enclosing div. On entering the fullscreen mode the Viewer’s height is updated which works fine.

Now we want to zoom the diagram shown to fit the new size but only in case of zoom was not changed by the user yet.

Therefore I’d like to listen for zoom-events. Is there such an event? Or does anyone has another suggestion how to figure out whether zoom was used or not?


Checkout Canvas#zoom which should give you the information you need:

var zoomLevel = viewer.get('canvas').zoom();

if (zoomLevel !== 1) {
  // we zoomed