Skip to content

Commit d1a5b2d

Browse files
committed
Remove unused toFlowNode converter
1 parent 6669fc6 commit d1a5b2d

1 file changed

Lines changed: 1 addition & 37 deletions

File tree

src/lib/components/canvas/flowConverters.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,9 @@
33
*/
44

55
import type { Node, Edge } from '@xyflow/svelte';
6-
import type { NodeInstance, Connection, Annotation } from '$lib/nodes/types';
6+
import type { Connection, Annotation } from '$lib/nodes/types';
77
import type { EventInstance } from '$lib/events/types';
88
import { HANDLE_ID } from '$lib/constants/handles';
9-
import { calculateNodeDimensions } from '$lib/constants/dimensions';
10-
import { nodeRegistry } from '$lib/nodes';
11-
12-
/**
13-
* Convert a NodeInstance to a SvelteFlow Node
14-
*/
15-
export function toFlowNode(node: NodeInstance, options: { deletable?: boolean } = {}): Node<NodeInstance> {
16-
// Calculate valid pinned params count
17-
const typeDef = nodeRegistry.get(node.type);
18-
const pinnedParamCount = typeDef && node.pinnedParams
19-
? node.pinnedParams.filter(name => typeDef.params.some(p => p.name === name)).length
20-
: 0;
21-
22-
const rotation = (node.params?.['_rotation'] as number) || 0;
23-
const { width, height } = calculateNodeDimensions(
24-
node.name,
25-
node.inputs.length,
26-
node.outputs.length,
27-
pinnedParamCount,
28-
rotation
29-
);
30-
31-
return {
32-
id: node.id,
33-
type: 'pathview',
34-
position: { ...node.position },
35-
data: node,
36-
width,
37-
height,
38-
// Explicit center origin for correct bounds calculation
39-
origin: [0.5, 0.5] as [number, number],
40-
selectable: true,
41-
draggable: true,
42-
deletable: options.deletable ?? true
43-
};
44-
}
459

4610
/**
4711
* Convert an EventInstance to a SvelteFlow Node

0 commit comments

Comments
 (0)