graph.isNeighbor(elementA, elementB [, opt])
Return true
if elementB
is a neighbor of elementA
. A neighbor of an element is another element connected to it via an inbound and/or outbound link.
Accepts several options, which may be provided inside an opt
object:
deep
- return true
also if elementB
is a neighbor of an element embedded in elementA
.outbound
- return true
only if elementB
is a succeeding neighbor of elementA
. For example, if elementB
is connected to a directed link behindthe connection of
elementA
.inbound
- return true
only if elementB
is a preceding neighbor elementA
. For example, if elementB
is connected to a directed link ahead ofthe connection of
elementA
.indirect
- in addition to standard rules (including deep
/outbound
/inbound
modifications), also return true
if elementB
can only be considered a neighbor of elementA
if we go against the flowof directed links at link-link connections.