File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/lib/node-editor/utils Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,19 @@ interface DuplicateOptions {
1010 targetPosition ?: { x : number ; y : number } ;
1111}
1212
13- // this accepts a list of nodes and duplicates them
14- // loops and groups will be handled automatically, just include them and their children
13+ /**
14+ * Duplicates the given nodes and their associated edges, handling groups and loops automatically.
15+ * This function creates new nodes and edges based on the provided nodes,
16+ * ensuring that the new nodes are positioned relative to the original nodes.
17+ * If a target position is provided, the new nodes will be positioned relative to that.
18+ * If no target position is provided, the new nodes will be offset by a default value.
19+ * @param nodes - The list of nodes to duplicate.
20+ * @param getEdges - A function to retrieve the current edges.
21+ * @param getNodes - A function to retrieve the current nodes.
22+ * @param setEdges - A function to set the new edges.
23+ * @param setNodes - A function to set the new nodes.
24+ * @param options - Optional parameters for duplication, such as target position.
25+ */
1526export function duplicateNodes (
1627 nodes : Node [ ] ,
1728 getEdges : ( ) => Edge [ ] ,
You can’t perform that action at this time.
0 commit comments