expandNode method
Implementation
void expandNode(TreeNode<D> node) {
if (node.hasChildren) {
// Collapse rings up to the clicked expanded node.
if (node.children.any((e) => _nodeToExpand.contains(e))) {
node.visit((e) {
if (node != e) {
_nodeToExpand.remove(e);
}
});
} else {
// Expand clicked node by one level.
_nodeToExpand.add(node);
_nodeToExpand.addAll(node.children);
}
}
}