File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -396,6 +396,10 @@ export class NodeFlowGraph {
396396 this . #mainNodeSubsystem. addNode ( node ) ;
397397 }
398398
399+ removeNode ( node : FlowNode ) : void {
400+ this . #mainNodeSubsystem. removeNode ( node ) ;
401+ }
402+
399403 addNote ( note : FlowNote ) : void {
400404 this . #mainNoteSubsystem. addNote ( note ) ;
401405 }
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ export class NodeSubsystem {
139139 public addOnNodeCreatedListener ( callback : NodeCreatedCallback ) : void {
140140 this . #nodeFactory. addOnNodeCreatedListener ( callback ) ;
141141 }
142-
142+
143143 public nodeFactory ( ) : NodeFactory {
144144 return this . #nodeFactory;
145145 }
@@ -477,6 +477,14 @@ export class NodeSubsystem {
477477 return this . #widgetCurrentlyClicking !== null ;
478478 }
479479
480+ removeNode ( node : FlowNode ) : void {
481+ for ( let i = 0 ; i < this . #nodes. length ; i ++ ) {
482+ if ( this . #nodes[ i ] === node ) {
483+ this . #removeNodeByIndex( i ) ;
484+ }
485+ }
486+ }
487+
480488 #removeNodeByIndex( nodeIndex : number ) : void {
481489 this . #removeNodeConnections( nodeIndex ) ;
482490 const node = this . #nodes[ nodeIndex ] ;
You can’t perform that action at this time.
0 commit comments