我有一个非常基本的cytoscape.js图,其中有cytoscape-expand-collapse。
有两个节点,它们之间有一条边。在这些节点之一的顶部,是两个父复合节点。
当我同时折叠父母双方并尝试再次展开它们时,图将被卡住(可能在某处无限循环中)。
Here是显示该问题的代码笔。 和代码:
注意::如果尝试扩展节点,浏览器可能会卡住。
document.addEventListener('DOMContentLoaded', function(){
var cy = window.cy = cytoscape({
container: document.getElementById('cy'),
ready: function(){
var api = this.expandCollapse({
layoutBy: {
name: "cose-bilkent",
animate: true,
ranker: 'network-simplex',
fit: true,
// nodeDimensionsIncludeLabels: true,
},
fisheye: false,
undoable: false,
});
api.collapseAll();
},
elements: {
"nodes": [{
"data": {
"id": "tea-beverage",
"label": "Tea Beverage",
"parent": "NA-canary"
}
}, {
"data": {
"id": "frontend-hotdrinks",
"label": "FrontEnd Hot Drinks",
"parent": "frontend-canary"
}
}, {
"data": {
"id": "frontend",
"label": "frontend",
}
},{
"data": {
"id": "frontend-canary",
"label": "canary",
"parent": "frontend",
}
}],
"edges": [{
"data": {
"source": "frontend-hotdrinks",
"target": "tea-beverage",
}
}],
}
});
任何帮助将不胜感激。谢谢。