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