setNodeVisibility method
Sets the visibility of a specific node.
When a node is hidden:
- It is not rendered on the canvas
- Its ports cannot participate in new connections
- Existing connections to/from this node are not rendered
- The node is excluded from hit testing
Implementation
void setNodeVisibility(String nodeId, bool visible) {
final node = _nodes[nodeId];
if (node == null) return;
final wasVisible = node.isVisible;
runInAction(() {
node.isVisible = visible;
});
// Emit extension event
_emitEvent(NodeVisibilityChanged<T>(node, wasVisible));
}