Skip to main content

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

Surface.centerOnHorizontally() method

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

Signature:

centerOnHorizontally(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