You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
1.6 KiB

import type { NodeType } from "@/types";
export type NodeDimensions = { width: number; height: number };
export const defaultNodeDimensions: Record<NodeType, NodeDimensions> = {
group: { width: 420, height: 300 },
imageInput: { width: 300, height: 280 },
smartImage: { width: 300, height: 280 },
audioInput: { width: 320, height: 180 },
smartAudio: { width: 360, height: 180 },
videoInput: { width: 300, height: 280 },
annotation: { width: 520, height: 360 },
smartVideo: { width: 300, height: 280 },
prompt: { width: 320, height: 180 },
smartText: { width: 360, height: 220 },
array: { width: 320, height: 220 },
promptConstructor: { width: 420, height: 280 },
nanoBanana: { width: 300, height: 280 },
generateVideo: { width: 300, height: 280 },
generate3d: { width: 360, height: 300 },
generateAudio: { width: 360, height: 180 },
llmGenerate: { width: 360, height: 240 },
output: { width: 360, height: 260 },
outputGallery: { width: 420, height: 320 },
imageCompare: { width: 520, height: 360 },
videoStitch: { width: 420, height: 280 },
easeCurve: { width: 340, height: 260 },
videoTrim: { width: 420, height: 280 },
videoFrameGrab: { width: 360, height: 240 },
router: { width: 280, height: 180 },
switch: { width: 280, height: 180 },
conditionalSwitch: { width: 340, height: 240 },
glbViewer: { width: 420, height: 360 },
};
export const DEFAULT_NODE_DIMENSIONS: NodeDimensions = { width: 300, height: 280 };
export function getDefaultNodeDimensions(type: NodeType): NodeDimensions {
return defaultNodeDimensions[type] ?? DEFAULT_NODE_DIMENSIONS;
}