Skip to main content

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

Surface.centerOn() method

Takes a node/group as argument and positions the surface canvas such that the given node is at the center in both axes.

Signature:

centerOn(element: string | Vertex | Element): void;

Parameters

ParameterTypeDescription
elementstring | Vertex | ElementThe element to center. Can be a DOM element, vertex id, or a Node/Group.

Returns:

void