You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like collapse all nodes (or just some selected nodes if it's possible through a declaration in the json file for example) when the graph is loaded.
Unfortunatly, I have no idea how to do that...
The text was updated successfully, but these errors were encountered:
Hi @homlett, I'm not sure if you have already figured it out but to have the nodes initially collapsed when you first load the flower you would have to have a separate function that you would call AFTER you call the update function.
Within the CodeFlower.js you would have to add a new function to iterate through the nodes. In order to do that you would have to make the var nodes to be this.nodes so that you can access that information in the new function collapseNodes.
CodeFlower.prototype.collapseNode = function() {
for(var i = 0; i < this.nodes.length; i++) {
var d = this.nodes[i];
if(d.name !== "root") {
d._children = d.children;
d.children = null;
}
}
this.update();
return;
};
I would like collapse all nodes (or just some selected nodes if it's possible through a declaration in the json file for example) when the graph is loaded.
Unfortunatly, I have no idea how to do that...
The text was updated successfully, but these errors were encountered: