mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
@@ -15,31 +15,20 @@ export class LGraphGroup {
|
|||||||
color: string
|
color: string
|
||||||
title: string
|
title: string
|
||||||
font?: string
|
font?: string
|
||||||
font_size: number
|
font_size: number = LiteGraph.DEFAULT_GROUP_FONT || 24
|
||||||
_bounding: Float32Array
|
_bounding: Float32Array = new Float32Array([10, 10, 140, 80])
|
||||||
_pos: Point
|
_pos: Point = this._bounding.subarray(0, 2)
|
||||||
_size: Size
|
_size: Size = this._bounding.subarray(2, 4)
|
||||||
_nodes: LGraphNode[]
|
_nodes: LGraphNode[] = []
|
||||||
graph?: LGraph
|
graph: LGraph | null = null
|
||||||
flags: IGraphGroupFlags
|
flags: IGraphGroupFlags = {}
|
||||||
selected?: boolean
|
selected?: boolean
|
||||||
|
|
||||||
constructor(title?: string) {
|
constructor(title?: string) {
|
||||||
this._ctor(title)
|
|
||||||
}
|
|
||||||
|
|
||||||
_ctor(title?: string): void {
|
|
||||||
this.title = title || "Group"
|
this.title = title || "Group"
|
||||||
this.font_size = LiteGraph.DEFAULT_GROUP_FONT || 24
|
|
||||||
this.color = LGraphCanvas.node_colors.pale_blue
|
this.color = LGraphCanvas.node_colors.pale_blue
|
||||||
? LGraphCanvas.node_colors.pale_blue.groupcolor
|
? LGraphCanvas.node_colors.pale_blue.groupcolor
|
||||||
: "#AAA"
|
: "#AAA"
|
||||||
this._bounding = new Float32Array([10, 10, 140, 80])
|
|
||||||
this._pos = this._bounding.subarray(0, 2)
|
|
||||||
this._size = this._bounding.subarray(2, 4)
|
|
||||||
this._nodes = []
|
|
||||||
this.graph = null
|
|
||||||
this.flags = {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Position of the group, as x,y co-ordinates in graph space */
|
/** Position of the group, as x,y co-ordinates in graph space */
|
||||||
|
|||||||
@@ -121,17 +121,17 @@ export class LGraphNode {
|
|||||||
static filter?: string
|
static filter?: string
|
||||||
static skip_list?: boolean
|
static skip_list?: boolean
|
||||||
|
|
||||||
title?: string
|
title: string
|
||||||
graph: LGraph
|
graph: LGraph | null = null
|
||||||
id?: NodeId
|
id?: NodeId
|
||||||
type?: string
|
type: string | null = null
|
||||||
inputs: INodeInputSlot[]
|
inputs: INodeInputSlot[] = []
|
||||||
outputs: INodeOutputSlot[]
|
outputs: INodeOutputSlot[] = []
|
||||||
// Not used
|
// Not used
|
||||||
connections: unknown[]
|
connections: unknown[] = []
|
||||||
properties: INodeProperties
|
properties: INodeProperties = {}
|
||||||
properties_info: INodePropertyInfo[]
|
properties_info: INodePropertyInfo[] = []
|
||||||
flags: INodeFlags
|
flags: INodeFlags = {}
|
||||||
widgets?: IWidget[]
|
widgets?: IWidget[]
|
||||||
|
|
||||||
size: Size
|
size: Size
|
||||||
@@ -153,8 +153,8 @@ export class LGraphNode {
|
|||||||
widgets_start_y?: number
|
widgets_start_y?: number
|
||||||
lostFocusAt?: number
|
lostFocusAt?: number
|
||||||
gotFocusAt?: number
|
gotFocusAt?: number
|
||||||
badges: (LGraphBadge | (() => LGraphBadge))[]
|
badges: (LGraphBadge | (() => LGraphBadge))[] = []
|
||||||
badgePosition: BadgePosition
|
badgePosition: BadgePosition = BadgePosition.TopLeft
|
||||||
onOutputRemoved?(this: LGraphNode, slot: number): void
|
onOutputRemoved?(this: LGraphNode, slot: number): void
|
||||||
onInputRemoved?(this: LGraphNode, slot: number, input: INodeInputSlot): void
|
onInputRemoved?(this: LGraphNode, slot: number, input: INodeInputSlot): void
|
||||||
_collapsed_width: number
|
_collapsed_width: number
|
||||||
@@ -182,7 +182,7 @@ export class LGraphNode {
|
|||||||
block_delete?: boolean
|
block_delete?: boolean
|
||||||
showAdvanced?: boolean
|
showAdvanced?: boolean
|
||||||
|
|
||||||
_pos: Point
|
_pos: Point = new Float32Array([10, 10])
|
||||||
public get pos() {
|
public get pos() {
|
||||||
return this._pos
|
return this._pos
|
||||||
}
|
}
|
||||||
@@ -288,31 +288,9 @@ export class LGraphNode {
|
|||||||
isValidWidgetLink?(slot_index: number, node: LGraphNode, overWidget: IWidget): boolean | undefined
|
isValidWidgetLink?(slot_index: number, node: LGraphNode, overWidget: IWidget): boolean | undefined
|
||||||
|
|
||||||
constructor(title: string) {
|
constructor(title: string) {
|
||||||
this._ctor(title)
|
this.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : -1
|
||||||
}
|
|
||||||
|
|
||||||
_ctor(title: string): void {
|
|
||||||
this.title = title || "Unnamed"
|
this.title = title || "Unnamed"
|
||||||
this.size = [LiteGraph.NODE_WIDTH, 60]
|
this.size = [LiteGraph.NODE_WIDTH, 60]
|
||||||
this.graph = null
|
|
||||||
// Initialize _pos with a Float32Array of length 2, default value [10, 10]
|
|
||||||
this._pos = new Float32Array([10, 10])
|
|
||||||
|
|
||||||
this.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : -1
|
|
||||||
this.type = null
|
|
||||||
|
|
||||||
//inputs available: array of inputs
|
|
||||||
this.inputs = []
|
|
||||||
this.outputs = []
|
|
||||||
this.connections = []
|
|
||||||
this.badges = []
|
|
||||||
this.badgePosition = BadgePosition.TopLeft
|
|
||||||
|
|
||||||
//local data
|
|
||||||
this.properties = {} //for the values
|
|
||||||
this.properties_info = [] //for the info
|
|
||||||
|
|
||||||
this.flags = {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user