removeSubtree static method
Removes the subtree rooted at id (node + descendants).
Returns doc unchanged if id not found.
Implementation
static CanvasSceneDocument removeSubtree(CanvasSceneDocument doc, NodeId id) {
final pr = findParentOf(doc, id);
if (pr == null) return doc;
return _removeAtParentRef(doc, pr);
}