Skip to main content

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

Surface.getModelObjectFromElement() method

For a given element, retrieve the model object it represents.

Signature:

getModelObjectFromElement(el: Element, searchAncestors?: boolean): Vertex | Port | Node | Group | Edge | null;

Parameters

ParameterTypeDescription
elElement
searchAncestorsbooleanDefaults to false. If true, ancestors of the given element are searched, up to the underlying container element.

Returns:

Vertex | Port | Node | Group | Edge | null

a Port, Node, Edge, Group, or null.