Skip to main content

Home > @jsplumbtoolkit/core > Path > contains

Path.contains() method

Returns true if the path contains the given object (a node, group, port or edge), false otherwise.

Signature:

contains(obj: Edge | Vertex, doNotFuzzyMatchNodes?: boolean): boolean;

Parameters

ParameterTypeDescription
objEdge | VertexNode/Port/Edge, or object id, of the element to test for.
doNotFuzzyMatchNodesbooleanBy default, if you pass a node/group in to this method and the path passes through a port on that node/group, this method returns true. But if you set doNotFuzzyMatchNodes to true, then this method will return true only if the node/group itself is on the path.

Returns:

boolean

True if Path contains the object, false otherwise.