chore(examples): cleanup
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
|
||||
const { getIntersectingNodes } = useSvelteFlow();
|
||||
|
||||
function onNodeDrag({ detail: { node } }) {
|
||||
const intersections = getIntersectingNodes(node).map((n) => n.id);
|
||||
function onNodeDrag({ detail: { targetNode } }) {
|
||||
const intersections = getIntersectingNodes(targetNode).map((n) => n.id);
|
||||
|
||||
$nodes.forEach((n) => {
|
||||
n.class = intersections.includes(n.id) ? 'highlight' : '';
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { writable } from 'svelte/store';
|
||||
import {
|
||||
SvelteFlow,
|
||||
Controls,
|
||||
Background,
|
||||
MiniMap,
|
||||
type Node,
|
||||
type Edge,
|
||||
type NodeTypes
|
||||
} from '@xyflow/svelte';
|
||||
import { SvelteFlow, Controls, Background, MiniMap, type Node, type Edge } from '@xyflow/svelte';
|
||||
|
||||
import '@xyflow/svelte/dist/style.css';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user