Svelte Flow

LearnReferenceExamplesShowcase
GitHubDiscordSupport Us
  • API Reference
  • <SvelteFlow />
  • <SvelteFlowProvider />
  • Components
    • <Background />
    • <BaseEdge />
    • <ControlButton />
    • <Controls />
    • <EdgeLabelRenderer />
    • <EdgeLabel />
    • <Handle />
    • <MiniMap />
    • <NodeResizer />
    • <NodeResizeControl />
    • <NodeToolbar />
    • <Panel />
  • Hooks
    • useConnection()
    • useEdges()
    • useHandleConnections()
    • useNodeConnections()
    • useInternalNode()
    • useNodes()
    • useNodesData()
    • useNodesInitialized()
    • useSvelteFlow()
    • useStore()
    • useUpdateNodeInternals()
  • Types
    • BackgroundVariant
    • ColorMode
    • Connection
    • ConnectionLineType
    • CoordinateExtent
    • DefaultEdgeOptions
    • Edge
    • EdgeMarker
    • EdgeProps
    • FitViewOptions
    • InternalNode
    • KeyDefinition
    • MarkerType
    • Node
    • NodeProps
    • NodeOrigin
    • NodeConnection
    • PanelPosition
    • Position
    • SvelteFlowStore
    • Viewport
    • XYPosition
    • addEdge()
    • getBezierPath()
    • getConnectedEdges()
    • getIncomers()
    • getNodesBounds()
    • getOutgoers()
    • getSimpleBezierPath()
    • getSmoothStepPath()
    • getStraightPath()
    • getViewportForBounds()
    • isEdge()
    • isNode()

On This Page

  • Signature
Question? Give us feedback →Edit this pageWhat's new here?
Referenceutils
getConnectedEdges()

getConnectedEdges()

Source on GitHub

Given an array of nodes that may be connected to one another and an array of all your edges, this util gives you an array of edges that connect any of the given nodes together.

import { getConnectedEdges } from '@xyflow/svelte';
 
const nodes = [];
const edges = [];
 
const connectedEdges = getConnectedEdges(nodes, edges);

Signature

NameType
#Params
#nodes
Node[]
#edges
Edge[]
#Returns
#
Edge[]
Types

A project by the xyflow team

We are building and maintaining open source software for node-based UIs since 2019.

Docs

Quickstart GuideAPI ReferenceExamplesShowcaseSupport Us

Social

DiscordGithubX / TwitterBluesky

xyflow

BlogOpen SourceAboutContact
Careers hiring

Legal

MIT LicenseCode of Conduct

info@xyflow.com — Copyright © 2025 webkid GmbH. All rights reserved — website design by Facu Montanaro