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
Parameter | Type | Description |
---|---|---|
element | string | Vertex | Element | The element to center. Can be a DOM element, vertex id, or a Node/Group |
fillRatio | number | How 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. |
doNotAnimate | boolean | by default, this operation will be animated. |
Returns:
void