Foblex Flow
Introduction
Overview
Nodes
Custom Nodes
Drag Handle
Node Selection
Resize Handle
Rotate Handle
Grouping
Updated
Drag to Group
Updated
Stress Test
Stress Test with Connections
Connectors
Node as Connector
Connector Inside Node
Connector Outlet
Limiting Connections
Connectability Check
Connectable Side
Connections
Drag to Connect
Drag to Reassign
Updated
Create Node on Connection Drop
Remove Connection on Drop
Assign Node to Connection on Drop
Auto Snap
Connection Types
Custom Connection Type
Connection Behaviours
Connection Markers
Connection Text
Connection Center
Custom Connections
Extensions
Add Node from Palette
Selection Area
Help in Positioning
Grid System
Minimap
Zoom
Background
Advanced
Cut/Copy/Paste
New
Undo/Redo
Undo/Redo V2
New
Dagre Layout
ELKJS Layout
Drag Start/End Events
Custom Event Triggers
Pro Examples
Visual Programming
DB Management
UML Diagram
Tournament Bracket
Foblex Flow

Cut, Copy, and Paste Example

Description

Learn how to implement copy, cut, and paste functionality in Foblex Flow. This example shows how to duplicate nodes (with their connections), remove selected elements, and insert them back into the diagram — all while maintaining consistent IDs and connections.

Overview

Copy/Paste makes your editor much more user-friendly, enabling workflows similar to standard desktop applications. In this example you will learn:

  • How to copy selected nodes (and their internal connections) into a clipboard.
  • How to cut nodes: copy them to the clipboard and remove them (along with their connections) from the diagram.
  • How to paste: insert clipboard content back into the diagram with new IDs and a slight offset, so copies don’t overlap with the originals.
  • How to manage connections so they are only pasted if both source and target nodes are included in the clipboard.
  • How to update node positions and reassign connections correctly when pasting.

Clipboard content is stored in a local signal, and IDs are regenerated using generateGuid() to keep the graph consistent.

When to use

  • You want to provide users with familiar cut / copy / paste interactions.
  • Your editor needs to support quick duplication of nodes and their connections.
  • You want to allow structural edits (e.g., reorganizing flows by copy-pasting parts of a diagram).

Example

[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/advanced/copy-paste/copy-paste.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/advanced/copy-paste/copy-paste.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/advanced/copy-paste/copy-paste.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss