要获取我正在使用的元素的后继者:
const successors = graph.getSuccessors(element);
但它返回没有链接的元素。是否有某种方法可以使用选项 joint.dia.Graph.ExploreOptions
指定此函数以返回链接?或者是通过其他方式将后继元素与链接结合在一起?
谢谢
拉法尔
最佳答案
您正在寻找 graph.getSubgraph(cells, [, opt])
方法 ( documentation )。
var elements = graph.getSuccessors(element).concat(element);
// find all the links between successors and the element
var subgraph = graph.getSubgraph(elements);
// remove the element itself
subgraph.splice(subgraph.indexOf(element), 1);
关于javascript - JointJS - 获取所有带有链接的后继者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48148989/