Skip to main content

Home > @jsplumbtoolkit/browser-ui > Surface > centerOnAndZoom

Surface.centerOnAndZoom() method

Center on the current object and zoom in on it.

Signature:

centerOnAndZoom(element: string | Vertex | Element, fillRatio?: number, doNotAnimate?: boolean): void;

Parameters

ParameterTypeDescription
elementstring | Vertex | ElementThe element to center. Can be a DOM element, vertex id, or a Node/Group
fillRationumberHow much of the viewport to fill with the object we zoom in on. This will be limited by the current zoom range. Defaults to 0.6.
doNotAnimatebooleanby default, this operation will be animated.

Returns:

void