Skip to content
Latestv1.0.63

Data Flow Edge ​

DataFlowEdge is a high-level visualization edge built into yh-flow, designed for AI workflow orchestration and real-time data pipelines. Set flowStatus and flowEffect inside edge.data to get particles, glow, pulse, or wave animations that intuitively convey data flow status.

Quick Start ​

Two steps: register the component → set status inside edge.data

typescript
// Step 1: Register as a custom edge type
import { markRaw } from 'vue'
import { DataFlowEdge } from '@yh-ui/flow'

const edgeTypes = { dataflow: markRaw(DataFlowEdge) }

// Step 2: Set flowStatus / flowEffect inside edge.data
const edges = ref([
  {
    id: 'e1',
    source: 'node-a',
    target: 'node-b',
    type: 'dataflow', // matches the registered key
    label: 'processing',
    data: {
      flowStatus: 'processing', // idle | processing | success | error | warning
      flowEffect: 'particles' // particles | glow | pulse | wave | none
    }
  }
])

IMPORTANT

flowStatus, flowEffect, and other config options must be placed inside edge.data, NOT as top-level edge fields. The component automatically reads them from edge.data.

5 Status Preview ​

processing / success / error / warning / idle

Dynamic Status & Effect Switching ​

Switch status and effect at runtime

Status Reference ​

flowStatusColorAnimationTypical Use Case
idleGrayNoneStatic connection, standby
processingPurpleBreathingData transferring, API in progress
successGreenSteady glowTransfer complete, node succeeded
errorRedFast flashTransfer failed, node error
warningOrangeSlow pulseTimeout alert, data anomaly

Effect Reference ​

flowEffectDescriptionBest Status Pairing
particlesGlowing particles travel along the curveprocessing
glowContinuous glowing halosuccess
pulseBrightness heartbeat flickererror / warning
waveFlowing dashed-line animationprocessing / general
noneNo animation (color still changes with status)All

API ​

edge.data Config Fields ​

These fields must be placed inside edge.data

FieldTypeDefaultDescription
flowStatusDataFlowStatus'idle'Status, controls color and CSS animation
flowEffectDataFlowEffect'particles'Visual effect type
glowIntensitynumber8Glow blur intensity (0–20)
particleCountnumber3Number of particles (1–10)
animationDurationnumber2Particle / pulse animation cycle in seconds

Standard Edge Fields ​

FieldTypeDescription
typestringSet to the registered key, e.g. 'dataflow'
labelstringCenter label text on the edge
animatedbooleantrue shows dashed-flow animation in idle status
selectedbooleanHighlighted selected style

Type Definitions ​

typescript
type DataFlowStatus = 'idle' | 'processing' | 'success' | 'error' | 'warning'
type DataFlowEffect = 'particles' | 'glow' | 'pulse' | 'wave' | 'none'

Register the Edge Type ​

typescript
import { markRaw } from 'vue'
import { DataFlowEdge } from '@yh-ui/flow'

const edgeTypes = {
  dataflow: markRaw(DataFlowEdge)
}

TIP

Define edges as a computed that maps runtime state (e.g., from a Pinia store) into edge.data, to achieve real-time AI workflow status visualization.

Released under the MIT License.