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
Parameter | Type | Description |
---|---|---|
el | Element | |
searchAncestors | boolean | Defaults 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.