Adds the element with the given id, with the given values for x, y, width, height and rotation. Any of these may be null.
Bind an event listener. This method can be used with a type parameter by call sites; although it's not necessary it can be helpful to use this to ensure you've thought about what the payload to your event handler is going to be.
Gets the height of the content managed by the viewport, taking any rotated elements into account.
Gets the width of the content managed by the viewport, taking any rotated elements into account.
Gets all listeners for the given named event.
Gets the position of the element. This returns both the original position, and also the translated position of the element. Certain internal methods, such as the anchor calculation code, use the unrotated position and then subsequently apply the element's rotation to any calculated positions. Other parts of the codebase - the Toolkit's magnetizer or pan/zoom widget, for instance - are interested in the rotated position.
Gets the leftmost point of the content managed by the viewport, taking any rotated elements into account.
Gets the topmost of the content managed by the viewport, taking any rotated elements into account.
Returns whether or not the viewport is empty.
Returns whether not event firing is currently suspended
Update the size/offset of the element with the given id, and adjust viewport bounds.
OptionaldoNotRecalculateBounds: booleanIf true, the viewport's bounds won't be recalculated after the element's size and position has been refreshed.
Creates an empty entry for an element with the given ID.
OptionaldoNotRecalculateBounds: booleanIf true, the viewport's bounds won't be recalculated after the element has been registered.
Remove the element with the given ID from the viewport.
Clears the internal state of the viewport, removing all elements.
Rotates the element with the given id, recalculating bounds afterwards.
Sets the [x,y] position of the element with the given ID, recalculating bounds.
Sets the size of the element with the given ID, recalculating bounds.
Sets whether not event firing is currently suspended
OptionaloriginalEvent: EventUnbind the given event listener, or all listeners. If you call this method with no arguments then all event listeners are unbound.
Updates the element with the given id. Any of the provided values may be null, in which case they are ignored (we never overwrite an existing value with null).
OptionaldoNotRecalculateBounds: booleanDefaults to false. For internal use. If true, does not update viewport bounds after updating the element.
Models the positions of the elements a given jsPlumb instance is tracking. Users of the API should not need to interact directly with a Viewport.