Skip to Content
You are viewing the v1 docs of Svelte Flow. You can find the latest version here.
ExamplesNodes

Intersections

The useSvelteFlow hook exports helpers to check intersections of nodes and areas. In this example you can drag a node and get a visual feedback when it intersects with another node.

import type { Node, Edge } from '@xyflow/svelte'; export const initialNodes: Node[] = [ { id: '1', data: { label: 'Node 1' }, position: { x: 0, y: 0 }, style: 'width: 200px; height: 100px;', }, { id: '2', data: { label: 'Node 2' }, position: { x: 0, y: 150 }, }, { id: '3', data: { label: 'Node 3' }, position: { x: 250, y: 0 }, }, { id: '4', data: { label: 'Node' }, position: { x: 350, y: 150 }, style: 'width: 50px; height: 50px;', }, ]; export const initialEdges: Edge[] = [];
Last updated on