joint
joint copied to clipboard
docs: improve graph.getSuccessors() documentation
Discussed in https://github.com/clientIO/joint/discussions/1746
Originally posted by alexandernst July 21, 2022
I made a small demo [0] that is using getSuccessors()
to find all the elements that are connected to an element.
If I understand the docs correctly, getSuccessors()
might consider visiting embedded elements if the deep
opt is set to true
.
Note that, however, in this demo getSuccessors()
is returning 3 children (blue, orange and red in the console). The red element is embedded inside the orange element and it's connected to the "in" port of the orange element.
I'm guessing that getSuccessors()
doesn't really care if the port are "in" or "out" and just follows any links it can find.
If this is the expected behavior, is there a way I can prevent getSuccessors()
from following links which's source is an "in" port?
[0] - https://codesandbox.io/s/jointjs-dom-graph-forked-fptgmd