collapsePartialExpansion method

bool collapsePartialExpansion(
  1. String nodeId
)

Collapse a partially expanded node back to fully collapsed.

Clears partialChildIds and partialHyperedgeIds on the node, returning it to a fully collapsed state (all children hidden).

Returns true if the node was partially expanded and is now collapsed.

Implementation

bool collapsePartialExpansion(String nodeId) {
  final node = nodeMap[nodeId];
  if (node == null) {
    return false;
  }
  if (!node.isPartiallyExpanded) {
    return false;
  }

  node
    ..partialChildIds = null
    ..partialHyperedgeIds = null;
  return true;
}