Check if a node is currently expanded.
bool isExpanded(String nodeId) => nodeMap[nodeId]?.isExpanded ?? false;