Programatically hide/show specific nodes (without remove/delete)
Is there any way to programmatically collapse/expand specific nodes? I don't want to delete them, I just need a way to hide them until I decide to show them.
https://rawgit.com/dabeng/OrgChart/master/demo/default-collapsed.html
Hi @CaptainCannabis, not exactly. I don't want to have something collapsed by default - and not per branch.
If I have a tree expanded, I want just be able to programmatically, hide a specific node.
The way i do it is by recursively iterating over the diagramm source - set collapse to true or false and then update the diagramm-div with the new source.
Collapse only works on a parent node, not on children.
Looking it further, this seems pretty doable as a PR. apply "hidden" to the node's parent-most
I'm having a tough time seeing how the lines are hidden and shown with their nodes. All I see is that all lines disappear and then one magically appears (but I don't see how that happens?). @dabeng Any help would be appreciated.
@dabeng Seconding this. It's really easy to hide children of a node, but not the node itself. If the node itself is the only child of course we can use hideChildren on the parent element, but if it has siblings the only option currently is to tediously remove lines. But as @takuy pointed out, it is very unclear on how lines are added/removed. A function hideBranch($node) to hide a node and all its children would be really nice to have!