minor fixes & mix node sample

This commit is contained in:
itten
2026-07-09 11:38:11 +03:00
parent 307bb0cd69
commit 0ea48bc9a2
5 changed files with 43 additions and 4 deletions
+2 -1
View File
@@ -25,8 +25,9 @@ function parseRes(res: string): { width: number; height: number } {
// Converts a Vue Flow handle id to the NODE_CONFIG port key used in graph JSON
function handleToPort(handle: string): string {
return handle.replace(/-(?:in|out)$/, '_flow_id')
return handle.replace(/-(?:in|out)(?:-\d+)?$/, '_flow_id')
// 'video-out' → 'video_flow_id', 'audio-in' → 'audio_flow_id'
// 'video-in-1' → 'video_flow_id', 'audio-in-2' → 'audio_flow_id'
}
export function buildGraph(vfNodes: Node[], vfEdges: Edge[]): GraphJson {