Skip to content

@gausszhou/litegraph-core / Subgraph

Class: Subgraph ​

Defined in: packages/core/src/nodes/Subgraph.ts:119

https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode

Extends ​

Constructors ​

Constructor ​

ts
new Subgraph(title?, graphFactory?): Subgraph;

Defined in: packages/core/src/nodes/Subgraph.ts:147

Parameters ​

title? ​

string

graphFactory? ​

() => LGraph

Returns ​

Subgraph

Overrides ​

LGraphNode.constructor

Properties ​

_collapsed_width? ​

ts
_collapsed_width?: number;

Defined in: packages/core/src/LGraphNode.ts:222

Inherited from ​

LGraphNode._collapsed_width


_level ​

ts
_level: number;

Defined in: packages/core/src/LGraphNode.ts:204

Inherited from ​

LGraphNode._level


_relative_id ​

ts
_relative_id: string | number | null = null;

Defined in: packages/core/src/LGraphNode.ts:203

Inherited from ​

LGraphNode._relative_id


action_call ​

ts
action_call: string | null = null;

Defined in: packages/core/src/LGraphNode.ts:224

Inherited from ​

LGraphNode.action_call


action_triggered ​

ts
action_triggered: number = 0;

Defined in: packages/core/src/LGraphNode.ts:228

the nFrames it will be used (-- each step), means "how old" is the event

Inherited from ​

LGraphNode.action_triggered


bgcolor ​

ts
bgcolor: string;

Defined in: packages/core/src/LGraphNode.ts:192

Inherited from ​

LGraphNode.bgcolor


block_delete ​

ts
block_delete: boolean = false;

Defined in: packages/core/src/LGraphNode.ts:198

Inherited from ​

LGraphNode.block_delete


boxcolor ​

ts
boxcolor: string;

Defined in: packages/core/src/LGraphNode.ts:193

Inherited from ​

LGraphNode.boxcolor


category ​

ts
category: string | null;

Defined in: packages/core/src/LGraphNode.ts:152

Inherited from ​

LGraphNode.category


class ​

ts
class: new () => LGraphNode;

Defined in: packages/core/src/LGraphNode.ts:169

Returns ​

LGraphNode

Inherited from ​

LGraphNode.class


clip_area ​

ts
clip_area: boolean;

Defined in: packages/core/src/LGraphNode.ts:214

if you render outside the node, it will be clipped

Inherited from ​

LGraphNode.clip_area


clonable ​

ts
clonable: boolean = true;

Defined in: packages/core/src/LGraphNode.ts:166

Inherited from ​

LGraphNode.clonable


collapsable ​

ts
collapsable: boolean = true;

Defined in: packages/core/src/LGraphNode.ts:167

Inherited from ​

LGraphNode.collapsable


color ​

ts
color: string;

Defined in: packages/core/src/LGraphNode.ts:191

Inherited from ​

LGraphNode.color


connections ​

ts
connections: INodeConnection[];

Defined in: packages/core/src/LGraphNode.ts:179

Inherited from ​

LGraphNode.connections


desc ​

ts
desc: string = "";

Defined in: packages/core/src/LGraphNode.ts:150

Inherited from ​

LGraphNode.desc


enabled ​

ts
enabled: boolean = true;

Defined in: packages/core/src/nodes/Subgraph.ts:144


exec_version ​

ts
exec_version: number = 0;

Defined in: packages/core/src/LGraphNode.ts:223

Inherited from ​

LGraphNode.exec_version


execute_triggered ​

ts
execute_triggered: number = 0;

Defined in: packages/core/src/LGraphNode.ts:226

the nFrames it will be used (-- each step), means "how old" is the event

Inherited from ​

LGraphNode.execute_triggered


flags ​

ts
flags: Partial<{
  collapsed: boolean;
  pinned: boolean;
  skip_repeated_outputs: boolean;
}>;

Defined in: packages/core/src/LGraphNode.ts:185

Inherited from ​

LGraphNode.flags


graph ​

ts
graph: LGraph | null;

Defined in: packages/core/src/LGraphNode.ts:155

Inherited from ​

LGraphNode.graph


graph_version ​

ts
graph_version: number;

Defined in: packages/core/src/LGraphNode.ts:156

Inherited from ​

LGraphNode.graph_version


has_errors? ​

ts
has_errors?: boolean;

Defined in: packages/core/src/LGraphNode.ts:220

if true, the node will show the bgcolor as 'red'

Inherited from ​

LGraphNode.has_errors


hide_in_node_lists ​

ts
hide_in_node_lists: boolean = false;

Defined in: packages/core/src/LGraphNode.ts:197

Inherited from ​

LGraphNode.hide_in_node_lists


horizontal ​

ts
horizontal: boolean;

Defined in: packages/core/src/LGraphNode.ts:218

slots are distributed horizontally

Inherited from ​

LGraphNode.horizontal


id ​

ts
id: NodeID;

Defined in: packages/core/src/LGraphNode.ts:171

Inherited from ​

LGraphNode.id


ignore_remove ​

ts
ignore_remove: boolean = false;

Defined in: packages/core/src/LGraphNode.ts:199

Inherited from ​

LGraphNode.ignore_remove


inputs ​

ts
inputs: INodeInputSlot[];

Defined in: packages/core/src/LGraphNode.ts:177

Inherited from ​

LGraphNode.inputs


is_selected ​

ts
is_selected: boolean;

Defined in: packages/core/src/LGraphNode.ts:159

Inherited from ​

LGraphNode.is_selected


last_serialization? ​

ts
last_serialization?: 
  | SerializedLGraphNode<LGraphNode>
  | null = null;

Defined in: packages/core/src/LGraphNode.ts:201

Inherited from ​

LGraphNode.last_serialization


mode? ​

ts
mode?: NodeMode;

Defined in: packages/core/src/LGraphNode.ts:207

Used in LGraphCanvas.onMenuNodeMode

Inherited from ​

LGraphNode.mode


mouseOver ​

ts
mouseOver: boolean;

Defined in: packages/core/src/LGraphNode.ts:160

Inherited from ​

LGraphNode.mouseOver


order ​

ts
order: number;

Defined in: packages/core/src/LGraphNode.ts:163

Inherited from ​

LGraphNode.order


outputs ​

ts
outputs: INodeOutputSlot[];

Defined in: packages/core/src/LGraphNode.ts:178

Inherited from ​

LGraphNode.outputs


pos ​

ts
pos: Vector2;

Defined in: packages/core/src/LGraphNode.ts:154

Inherited from ​

LGraphNode.pos


priority ​

ts
priority: number = 0;

Defined in: packages/core/src/LGraphNode.ts:162

computeExecutionOrder sorts by priority first, then order if priorities are the same

Inherited from ​

LGraphNode.priority


properties ​

ts
properties: SubgraphProperties;

Defined in: packages/core/src/nodes/Subgraph.ts:123

Overrides ​

LGraphNode.properties


properties_info ​

ts
properties_info: IProperty[];

Defined in: packages/core/src/LGraphNode.ts:183

Inherited from ​

LGraphNode.properties_info


redraw_on_mouse ​

ts
redraw_on_mouse: boolean;

Defined in: packages/core/src/LGraphNode.ts:164

Inherited from ​

LGraphNode.redraw_on_mouse


removable ​

ts
removable: boolean = true;

Defined in: packages/core/src/LGraphNode.ts:165

Inherited from ​

LGraphNode.removable


resizable ​

ts
resizable: boolean;

Defined in: packages/core/src/LGraphNode.ts:216

if set to false it wont be resizable with the mouse

Inherited from ​

LGraphNode.resizable


serialize_widgets ​

ts
serialize_widgets: boolean = false;

Defined in: packages/core/src/LGraphNode.ts:196

Inherited from ​

LGraphNode.serialize_widgets


shape ​

ts
shape: number;

Defined in: packages/core/src/LGraphNode.ts:194

Inherited from ​

LGraphNode.shape


size ​

ts
size: Vector2;

Defined in: packages/core/src/nodes/Subgraph.ts:142

Overrides ​

LGraphNode.size


skip_subgraph_button ​

ts
skip_subgraph_button: boolean = false;

Defined in: packages/core/src/LGraphNode.ts:158

Inherited from ​

LGraphNode.skip_subgraph_button


subgraph ​

ts
subgraph: LGraph;

Defined in: packages/core/src/nodes/Subgraph.ts:145

Overrides ​

LGraphNode.subgraph


title ​

ts
title: string;

Defined in: packages/core/src/LGraphNode.ts:149

Inherited from ​

LGraphNode.title


titleMode ​

ts
titleMode: TitleMode = TitleMode.NORMAL_TITLE;

Defined in: packages/core/src/LGraphNode.ts:168

Inherited from ​

LGraphNode.titleMode


type ​

ts
type: string | null;

Defined in: packages/core/src/LGraphNode.ts:151

Inherited from ​

LGraphNode.type


widgets ​

ts
widgets: 
  | IWidget<any, any>[]
  | null
  | undefined;

Defined in: packages/core/src/LGraphNode.ts:173

Inherited from ​

LGraphNode.widgets


widgets_start_y ​

ts
widgets_start_y: number;

Defined in: packages/core/src/LGraphNode.ts:212

widgets start at y distance from the top of the node

Inherited from ​

LGraphNode.widgets_start_y


widgets_up ​

ts
widgets_up: boolean;

Defined in: packages/core/src/LGraphNode.ts:210

If set to true widgets do not start after the slots

Inherited from ​

LGraphNode.widgets_up


widgets_values? ​

ts
widgets_values?: any[];

Defined in: packages/core/src/LGraphNode.ts:174

Inherited from ​

LGraphNode.widgets_values


default_lgraph_factory ​

ts
static default_lgraph_factory: () => LGraph;

Defined in: packages/core/src/nodes/Subgraph.ts:121

Returns ​

LGraph


MAX_CONSOLE ​

ts
static MAX_CONSOLE: number = 100;

Defined in: packages/core/src/LGraphNode.ts:2787

Inherited from ​

LGraphNode.MAX_CONSOLE


optionalSlots ​

ts
static optionalSlots: OptionalSlots;

Defined in: packages/core/src/nodes/Subgraph.ts:136


propertyLayout ​

ts
static propertyLayout: PropertyLayout;

Defined in: packages/core/src/nodes/Subgraph.ts:132


slotLayout ​

ts
static slotLayout: SlotLayout;

Defined in: packages/core/src/nodes/Subgraph.ts:127


title ​

ts
static title: string;

Defined in: packages/core/src/LGraphNode.ts:120

Inherited from ​

LGraphNode.title


title_color ​

ts
static title_color: string;

Defined in: packages/core/src/LGraphNode.ts:119

Inherited from ​

LGraphNode.title_color


type ​

ts
static type: string | null;

Defined in: packages/core/src/LGraphNode.ts:121

Inherited from ​

LGraphNode.type


widgets_up ​

ts
static widgets_up: boolean;

Defined in: packages/core/src/LGraphNode.ts:122

Inherited from ​

LGraphNode.widgets_up

Accessors ​

slotLayout ​

Get Signature ​

ts
get slotLayout(): SlotLayout | null;

Defined in: packages/core/src/LGraphNode.ts:112

Returns ​

SlotLayout | null

Inherited from ​

LGraphNode.slotLayout

Methods ​

actionDo() ​

ts
actionDo(
   action, 
   param, 
   options?
): void;

Defined in: packages/core/src/LGraphNode.ts:1145

Triggers an action, wrapped by logics to control execution flow

Parameters ​

action ​

any

name

param ​

any

options? ​

LActionOptions = {}

Returns ​

void

Method ​

actionDo

Inherited from ​

LGraphNode.actionDo


addConnection() ​

ts
addConnection(
   name, 
   type, 
   pos, 
   direction
): INodeConnection;

Defined in: packages/core/src/LGraphNode.ts:1555

add an special connection to this node (used for special kinds of graphs)

Parameters ​

name ​

string

type ​

string

string defining the input type ("vec3","number",...)

pos ​

Vector2

position of the connection inside the node

direction ​

string

if is input or output

Returns ​

INodeConnection

Inherited from ​

LGraphNode.addConnection


addCustomWidget() ​

ts
addCustomWidget<T>(customWidget): T;

Defined in: packages/core/src/LGraphNode.ts:1762

Type Parameters ​

T ​

T extends IWidget<any, any>

Parameters ​

customWidget ​

T

Returns ​

T

Inherited from ​

LGraphNode.addCustomWidget


addGraphInput() ​

ts
addGraphInput(
   name, 
   type, 
   pos?
): SubgraphInputPair | null;

Defined in: packages/core/src/nodes/Subgraph.ts:682

Parameters ​

name ​

string

type ​

SlotType

pos? ​

Vector2

Returns ​

SubgraphInputPair | null


addGraphOutput() ​

ts
addGraphOutput(
   name, 
   type, 
   pos?
): SubgraphOutputPair | null;

Defined in: packages/core/src/nodes/Subgraph.ts:717

Parameters ​

name ​

string

type ​

SlotType

pos? ​

Vector2

Returns ​

SubgraphOutputPair | null


addInput() ​

ts
addInput(
   name, 
   type?, 
   extra_info?
): INodeInputSlot;

Defined in: packages/core/src/LGraphNode.ts:1459

add a new input slot to use in this node

Parameters ​

name ​

string

type? ​

SlotType = BuiltInSlotType.DEFAULT

string defining the input type ("vec3","number",...), it its a generic one use 0

extra_info? ​

Partial<INodeInputSlot>

this can be used to have special properties of an input (label, color, position, etc)

Returns ​

INodeInputSlot

Inherited from ​

LGraphNode.addInput


addOnExecutedOutput() ​

ts
addOnExecutedOutput(): number;

Defined in: packages/core/src/LGraphNode.ts:1065

Returns ​

number

Inherited from ​

LGraphNode.addOnExecutedOutput


addOnTriggerInput() ​

ts
addOnTriggerInput(): number;

Defined in: packages/core/src/LGraphNode.ts:1056

Returns ​

number

Inherited from ​

LGraphNode.addOnTriggerInput


addOutput() ​

ts
addOutput(
   name, 
   type?, 
   extra_info?
): INodeOutputSlot;

Defined in: packages/core/src/LGraphNode.ts:1351

add a new output slot to use in this node

Parameters ​

name ​

string

type? ​

SlotType = BuiltInSlotType.DEFAULT

string defining the output type ("vec3","number",...)

extra_info? ​

Partial<INodeOutputSlot>

this can be used to have special properties of an output (label, special color, position, etc)

Returns ​

INodeOutputSlot

Inherited from ​

LGraphNode.addOutput


addProperty() ​

ts
addProperty(
   name, 
   default_value, 
   type?, 
   extra_info?
): IProperty;

Defined in: packages/core/src/LGraphNode.ts:1322

add a new property to this node

Parameters ​

name ​

string

default_value ​

any

type? ​

string

string defining the output type ("vec3","number",...)

extra_info? ​

Partial<IPropertyInfo>

this can be used to have special properties of the property (like values, etc)

Returns ​

IProperty

Inherited from ​

LGraphNode.addProperty


addWidget() ​

ts
addWidget<T>(
   type, 
   name, 
   value, 
   callback?, 
   options?
): T;

Defined in: packages/core/src/LGraphNode.ts:1707

https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#node-widgets

Type Parameters ​

T ​

T extends IWidget<any, any>

Parameters ​

type ​

T["type"]

name ​

string

value ​

T["value"]

callback? ​

string | WidgetCallback<T>

options? ​

T["options"]

Returns ​

T

created widget

Inherited from ​

LGraphNode.addWidget


alignToGrid() ​

ts
alignToGrid(): void;

Defined in: packages/core/src/LGraphNode.ts:2776

Force align to grid

Returns ​

void

Inherited from ​

LGraphNode.alignToGrid


buildFromNodes() ​

ts
buildFromNodes(nodes): void;

Defined in: packages/core/src/nodes/Subgraph.ts:507

Parameters ​

nodes ​

LGraphNode[]

Returns ​

void


captureInput() ​

ts
captureInput(v): void;

Defined in: packages/core/src/LGraphNode.ts:2824

Allows to get onMouseMove and onMouseUp events even if the mouse is out of focus

Parameters ​

v ​

any

Returns ​

void

Inherited from ​

LGraphNode.captureInput


changeMode() ​

ts
changeMode(modeTo): boolean;

Defined in: packages/core/src/LGraphNode.ts:1086

Parameters ​

modeTo ​

NodeMode

Returns ​

boolean

Inherited from ​

LGraphNode.changeMode


clearTriggeredSlot() ​

ts
clearTriggeredSlot(slot, link_id?): void;

Defined in: packages/core/src/LGraphNode.ts:1273

clears the trigger slot animation

Parameters ​

slot ​

number

the index of the output slot

LinkID

in case you want to trigger and specific output link in a slot

Returns ​

void

Inherited from ​

LGraphNode.clearTriggeredSlot


clone() ​

ts
clone(cloneData?): LGraphNode;

Defined in: packages/core/src/nodes/Subgraph.ts:476

Creates a clone of this node

Parameters ​

cloneData? ​

LGraphNodeCloneData = ...

Returns ​

LGraphNode

Overrides ​

LGraphNode.clone


collapse() ​

ts
collapse(force?): void;

Defined in: packages/core/src/LGraphNode.ts:2853

Collapse the node to make it smaller on the canvas

Parameters ​

force? ​

boolean = false

Returns ​

void

Inherited from ​

LGraphNode.collapse


computeSize() ​

ts
computeSize(): Vector2;

Defined in: packages/core/src/nodes/Subgraph.ts:317

computes the size of a node according to its inputs and output slots

Returns ​

Vector2

Overrides ​

LGraphNode.computeSize


configure() ​

ts
configure(info): void;

Defined in: packages/core/src/LGraphNode.ts:237

configure a node from an object containing the serialized info

Parameters ​

info ​

SerializedLGraphNode

Returns ​

void

Inherited from ​

LGraphNode.configure


connect() ​

ts
connect<T>(
   slot, 
   targetNode, 
   targetSlot
): T | null;

Defined in: packages/core/src/LGraphNode.ts:2196

connect this node output to the input of another node

Type Parameters ​

T ​

T = any

Parameters ​

slot ​

string | number

(could be the number of the slot or the string with the name of the slot)

targetNode ​

LGraphNode

the target node

targetSlot ​

string | number

the input slot of the target node (could be the number of the slot or the string with the name of the slot, or -1 to connect a trigger)

Returns ​

T | null

the linkInfo is created, otherwise null

Inherited from ​

LGraphNode.connect


connectByTypeInput() ​

ts
connectByTypeInput(
   slot, 
   targetNode, 
   targetSlotType, 
   optsIn?
): any;

Defined in: packages/core/src/LGraphNode.ts:2061

connect this node output to the input of another node BY TYPE

Parameters ​

slot ​

SlotNameOrIndex

(could be the number of the slot or the string with the name of the slot)

targetNode ​

LGraphNode

targetSlotType ​

SlotType

optsIn? ​
createEventInCase? ​

boolean

firstFreeIfOutputGeneralInCase? ​

boolean

generalTypeInCase? ​

boolean

Returns ​

any

the link_info is created, otherwise null

Method ​

connectByType

Inherited from ​

LGraphNode.connectByTypeInput


connectByTypeOutput() ​

ts
connectByTypeOutput(
   slot, 
   sourceNode, 
   sourceSlotType, 
   optsIn?
): any;

Defined in: packages/core/src/LGraphNode.ts:2131

connect this node input to the output of another node BY TYPE

Parameters ​

slot ​

SlotNameOrIndex

(could be the number of the slot or the string with the name of the slot)

sourceNode ​

LGraphNode

sourceSlotType ​

SlotType

optsIn? ​
createEventInCase? ​

boolean

firstFreeIfOutputGeneralInCase? ​

boolean

generalTypeInCase? ​

boolean

Returns ​

any

the link_info is created, otherwise null

Method ​

connectByType

Inherited from ​

LGraphNode.connectByTypeOutput


convertNodesToSubgraphInputs() ​

ts
convertNodesToSubgraphInputs(nodes): void;

Defined in: packages/core/src/nodes/Subgraph.ts:921

Parameters ​

nodes ​

LGraphNode[]

Returns ​

void


convertNodesToSubgraphOutputs() ​

ts
convertNodesToSubgraphOutputs(nodes): void;

Defined in: packages/core/src/nodes/Subgraph.ts:993

Parameters ​

nodes ​

LGraphNode[]

Returns ​

void


disconnectInput() ​

ts
disconnectInput(slot, options?): boolean;

Defined in: packages/core/src/LGraphNode.ts:2597

disconnect one input

Parameters ​

slot ​

SlotNameOrIndex

(could be the number of the slot or the string with the name of the slot)

options? ​
doProcessChange? ​

boolean

Returns ​

boolean

if it was disconnected successfully

Inherited from ​

LGraphNode.disconnectInput


disconnectOutput() ​

ts
disconnectOutput(
   slot, 
   targetNode?, 
   options?
): boolean;

Defined in: packages/core/src/LGraphNode.ts:2430

disconnect one output to an specific node

Parameters ​

slot ​

SlotNameOrIndex

(could be the number of the slot or the string with the name of the slot)

targetNode? ​

LGraphNode

the target node to which this slot is connected [Optional, if not targetNode is specified all nodes will be disconnected]

options? ​

object

Returns ​

boolean

if it was disconnected successfully

Inherited from ​

LGraphNode.disconnectOutput


doExecute() ​

ts
doExecute(param?, options?): void;

Defined in: packages/core/src/LGraphNode.ts:1113

Parameters ​

param? ​

any

options? ​

LActionOptions = {}

Returns ​

void

Inherited from ​

LGraphNode.doExecute


findInputSlotByName() ​

ts
findInputSlotByName(
   name?, 
   onlyFree?, 
   typesNotAccepted?
): INodeInputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:1906

Parameters ​

name? ​

string

onlyFree? ​

boolean = false

typesNotAccepted? ​

SlotType[]

Returns ​

INodeInputSlot | null

Inherited from ​

LGraphNode.findInputSlotByName


findInputSlotByType() ​

ts
findInputSlotByType(
   type, 
   preferFreeSlot?, 
   doNotUseOccupied?
): INodeInputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:1982

findSlotByType for INPUTS

Parameters ​

type ​

SlotType

preferFreeSlot? ​

boolean = false

doNotUseOccupied? ​

boolean = false

Returns ​

INodeInputSlot | null

Inherited from ​

LGraphNode.findInputSlotByType


findInputSlotIndexByName() ​

ts
findInputSlotIndexByName(
   name?, 
   onlyFree?, 
   typesNotAccepted?
): number;

Defined in: packages/core/src/LGraphNode.ts:1888

returns the input slot with a given name (used for dynamic slots), -1 if not found

Parameters ​

name? ​

string

the name of the slot

onlyFree? ​

boolean = false

typesNotAccepted? ​

SlotType[]

Returns ​

number

the slot (-1 if not found)

Inherited from ​

LGraphNode.findInputSlotIndexByName


findInputSlotIndexByType() ​

ts
findInputSlotIndexByType(
   type, 
   preferFreeSlot?, 
   doNotUseOccupied?
): number;

Defined in: packages/core/src/LGraphNode.ts:1968

findSlotByType for INPUTS

Parameters ​

type ​

SlotType

preferFreeSlot? ​

boolean = false

doNotUseOccupied? ​

boolean = false

Returns ​

number

Inherited from ​

LGraphNode.findInputSlotIndexByType


findOutputSlotByName() ​

ts
findOutputSlotByName(
   name?, 
   onlyFree?, 
   typesNotAccepted?
): INodeOutputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:1947

Parameters ​

name? ​

string

onlyFree? ​

boolean = false

typesNotAccepted? ​

SlotType[]

Returns ​

INodeOutputSlot | null

Inherited from ​

LGraphNode.findOutputSlotByName


findOutputSlotByType() ​

ts
findOutputSlotByType(
   type, 
   preferFreeSlot?, 
   doNotUseOccupied?
): INodeOutputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:1989

findSlotByType for OUTPUTS

Parameters ​

type ​

SlotType

preferFreeSlot? ​

boolean = false

doNotUseOccupied? ​

boolean = false

Returns ​

INodeOutputSlot | null

Inherited from ​

LGraphNode.findOutputSlotByType


findOutputSlotIndexByName() ​

ts
findOutputSlotIndexByName(
   name?, 
   onlyFree?, 
   typesNotAccepted?
): number;

Defined in: packages/core/src/LGraphNode.ts:1929

returns the output slot with a given name (used for dynamic slots), -1 if not found

Parameters ​

name? ​

string

the name of the slot

onlyFree? ​

boolean = false

typesNotAccepted? ​

SlotType[]

Returns ​

number

the slot (-1 if not found)

Inherited from ​

LGraphNode.findOutputSlotIndexByName


findOutputSlotIndexByType() ​

ts
findOutputSlotIndexByType(
   type, 
   preferFreeSlot?, 
   doNotUseOccupied?
): number;

Defined in: packages/core/src/LGraphNode.ts:1975

findSlotByType for OUTPUTS

Parameters ​

type ​

SlotType

preferFreeSlot? ​

boolean = false

doNotUseOccupied? ​

boolean = false

Returns ​

number

Inherited from ​

LGraphNode.findOutputSlotIndexByType


getBounding() ​

ts
getBounding(out?): Float32Array;

Defined in: packages/core/src/LGraphNode.ts:1780

returns the bounding of the object, used for rendering purposes

Parameters ​

out? ​

Float32Array<ArrayBufferLike>

Returns ​

Float32Array

[x, y, width, height]

Inherited from ​

LGraphNode.getBounding


getConnectionPos() ​

ts
getConnectionPos(
   is_input, 
   slotNumber, 
   out?, 
   ignore_collapsed?
): Vector2;

Defined in: packages/core/src/LGraphNode.ts:2693

returns the center of a connection point in canvas coords

Parameters ​

is_input ​

boolean

true if if a input slot, false if it is an output

slotNumber ​

number

out? ​

Vector2 = ...

a place to store the output, to free garbage

ignore_collapsed? ​

boolean = false

Returns ​

Vector2

the position

Inherited from ​

LGraphNode.getConnectionPos


getExtraLinkOptions()? ​

ts
getExtraLinkOptions?(
   graphCanvas, 
   link, 
   linkType, 
   options
): ContextMenuItem[];

Defined in: packages/core/src/LGraphNode.ts:3126

Parameters ​

graphCanvas ​

LGraphCanvas

LLink

linkType ​

LConnectionKind

options ​

ContextMenuItem[]

Returns ​

ContextMenuItem[]

Inherited from ​

LGraphNode.getExtraLinkOptions


getExtraMenuOptions() ​

ts
getExtraMenuOptions(graphCanvas, options): ContextMenuItem[];

Defined in: packages/core/src/nodes/Subgraph.ts:434

Parameters ​

graphCanvas ​

LGraphCanvas

options ​

ContextMenuItem[]

Returns ​

ContextMenuItem[]

Overrides ​

LGraphNode.getExtraMenuOptions


getInnerGraphInput() ​

ts
getInnerGraphInput(outerInputName): GraphInput | null;

Defined in: packages/core/src/nodes/Subgraph.ts:835

Parameters ​

outerInputName ​

string

Returns ​

GraphInput | null


getInnerGraphInputByIndex() ​

ts
getInnerGraphInputByIndex(outerInputIndex): GraphInput | null;

Defined in: packages/core/src/nodes/Subgraph.ts:851

Parameters ​

outerInputIndex ​

number

Returns ​

GraphInput | null


getInnerGraphOutput() ​

ts
getInnerGraphOutput(outerOutputName): GraphOutput | null;

Defined in: packages/core/src/nodes/Subgraph.ts:826

Parameters ​

outerOutputName ​

string

Returns ​

GraphOutput | null


getInnerGraphOutputByIndex() ​

ts
getInnerGraphOutputByIndex(outerOutputIndex): GraphOutput | null;

Defined in: packages/core/src/nodes/Subgraph.ts:844

Parameters ​

outerOutputIndex ​

number

Returns ​

GraphOutput | null


getInputData() ​

ts
getInputData<T>(slot, force_update?): T;

Defined in: packages/core/src/LGraphNode.ts:688

Retrieves the input data (data traveling through the connection) from one slot

Type Parameters ​

T ​

T = any

Parameters ​

slot ​

number

force_update? ​

boolean

if set to true it will force the connected node of this slot to output data into this link

Returns ​

T

data or if it is not connected returns undefined

Inherited from ​

LGraphNode.getInputData


getInputDataByName() ​

ts
getInputDataByName<T>(slot_name, force_update?): T;

Defined in: packages/core/src/LGraphNode.ts:763

Retrieves the input data from one slot using its name instead of slot number

Type Parameters ​

T ​

T = any

Parameters ​

slot_name ​

string

force_update? ​

boolean

if set to true it will force the connected node of this slot to output data into this link

Returns ​

T

data or if it is not connected returns null

Inherited from ​

LGraphNode.getInputDataByName


getInputDataType() ​

ts
getInputDataType(slot): SlotType | null;

Defined in: packages/core/src/LGraphNode.ts:730

Retrieves the input data type (in case this supports multiple input types)

Parameters ​

slot ​

number

Returns ​

SlotType | null

datatype in string format

Inherited from ​

LGraphNode.getInputDataType


getInputInfo() ​

ts
getInputInfo(slot): INodeInputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:780

tells you info about an input connection (which node, type, etc)

Parameters ​

slot ​

number

Returns ​

INodeInputSlot | null

Inherited from ​

LGraphNode.getInputInfo


ts
getInputLink(slot): LLink | null;

Defined in: packages/core/src/LGraphNode.ts:795

Returns the link info in the connection of an input slot

Parameters ​

slot ​

number

Returns ​

LLink | null

object or null

Inherited from ​

LGraphNode.getInputLink


getInputNode() ​

ts
getInputNode(slot): LGraphNode | null;

Defined in: packages/core/src/LGraphNode.ts:810

returns the node connected in the input slot

Parameters ​

slot ​

number

Returns ​

LGraphNode | null

Inherited from ​

LGraphNode.getInputNode


getInputOrProperty() ​

ts
getInputOrProperty<T>(name): T;

Defined in: packages/core/src/LGraphNode.ts:835

returns the value of an input with this name, otherwise checks if there is a property with that name

Type Parameters ​

T ​

T = any

Parameters ​

name ​

string

Returns ​

T

Inherited from ​

LGraphNode.getInputOrProperty


getInputSlotProperty() ​

ts
getInputSlotProperty(slot, name): any;

Defined in: packages/core/src/LGraphNode.ts:503

Parameters ​

slot ​

number

name ​

string

Returns ​

any

Inherited from ​

LGraphNode.getInputSlotProperty


getInputSlotsConnectedTo() ​

ts
getInputSlotsConnectedTo(slot): INodeInputSlot[];

Defined in: packages/core/src/LGraphNode.ts:948

Returns the input slots in other nodes that an output in this node is connected to.

Parameters ​

slot ​

number

Returns ​

INodeInputSlot[]

object or null

Inherited from ​

LGraphNode.getInputSlotsConnectedTo


getMenuOptions()? ​

ts
getMenuOptions?(graphCanvas): ContextMenuItem[];

Defined in: packages/core/src/LGraphNode.ts:3124

Called by LGraphCanvas.processContextMenu

Parameters ​

graphCanvas ​

LGraphCanvas

Returns ​

ContextMenuItem[]

Inherited from ​

LGraphNode.getMenuOptions


getOptionalSlots() ​

ts
getOptionalSlots(): OptionalSlots | null;

Defined in: packages/core/src/LGraphNode.ts:3115

Returns ​

OptionalSlots | null

Inherited from ​

LGraphNode.getOptionalSlots


getOutputData() ​

ts
getOutputData<T>(slot): T | null;

Defined in: packages/core/src/LGraphNode.ts:910

tells you the last output data that went in that slot

Type Parameters ​

T ​

T = any

Parameters ​

slot ​

number

Returns ​

T | null

Inherited from ​

LGraphNode.getOutputData


getOutputInfo() ​

ts
getOutputInfo(slot): INodeOutputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:970

tells you info about an output connection (which node, type, etc)

Parameters ​

slot ​

number

Returns ​

INodeOutputSlot | null

Inherited from ​

LGraphNode.getOutputInfo


ts
getOutputLinks(slot): LLink[];

Defined in: packages/core/src/LGraphNode.ts:927

Returns the link info in the connection of an output slot

Parameters ​

slot ​

number

Returns ​

LLink[]

object or null

Inherited from ​

LGraphNode.getOutputLinks


getOutputNodes() ​

ts
getOutputNodes(slot): LGraphNode[];

Defined in: packages/core/src/LGraphNode.ts:1006

retrieves all the nodes connected to this output slot

Parameters ​

slot ​

number

Returns ​

LGraphNode[]

Inherited from ​

LGraphNode.getOutputNodes


getOutputSlotConnectedTo() ​

ts
getOutputSlotConnectedTo(slot): INodeOutputSlot | null;

Defined in: packages/core/src/LGraphNode.ts:886

Returns the output slot in another node that an input in this node is connected to.

Parameters ​

slot ​

number

Returns ​

INodeOutputSlot | null

object or null

Inherited from ​

LGraphNode.getOutputSlotConnectedTo


getOutputSlotProperty() ​

ts
getOutputSlotProperty(slot, name): any;

Defined in: packages/core/src/LGraphNode.ts:521

Parameters ​

slot ​

number

name ​

string

Returns ​

any

Inherited from ​

LGraphNode.getOutputSlotProperty


getPropertyInfo() ​

ts
getPropertyInfo(property): IPropertyInfo;

Defined in: packages/core/src/LGraphNode.ts:1668

returns all the info available about a property of this node.

Parameters ​

property ​

string

name of the property

Returns ​

IPropertyInfo

the object with all the available info

Method ​

getPropertyInfo

Inherited from ​

LGraphNode.getPropertyInfo


getRootGraph() ​

ts
getRootGraph(): LGraph | null;

Defined in: packages/core/src/LGraphNode.ts:455

Returns ​

LGraph | null

Inherited from ​

LGraphNode.getRootGraph


getSlotInPosition() ​

ts
getSlotInPosition(x, y): SlotInPosition | null;

Defined in: packages/core/src/LGraphNode.ts:1831

checks if a point is inside a node slot, and returns info about which slot

Parameters ​

x ​

number

y ​

number

Returns ​

SlotInPosition | null

Inherited from ​

LGraphNode.getSlotInPosition


getSlotMenuOptions()? ​

ts
getSlotMenuOptions?(slot): ContextMenuItem[];

Defined in: packages/core/src/LGraphNode.ts:3127

Parameters ​

slot ​

SlotInPosition

Returns ​

ContextMenuItem[]

Inherited from ​

LGraphNode.getSlotMenuOptions


getTitle() ​

ts
getTitle(): string;

Defined in: packages/core/src/LGraphNode.ts:451

get the title string

Returns ​

string

Inherited from ​

LGraphNode.getTitle


getValidGraphInputName() ​

ts
getValidGraphInputName(baseName): string;

Defined in: packages/core/src/nodes/Subgraph.ts:802

Parameters ​

baseName ​

string

Returns ​

string


getValidGraphOutputName() ​

ts
getValidGraphOutputName(baseName): string;

Defined in: packages/core/src/nodes/Subgraph.ts:814

Parameters ​

baseName ​

string

Returns ​

string


is() ​

ts
is<T>(ctor): this is T;

Defined in: packages/core/src/LGraphNode.ts:1878

Type Parameters ​

T ​

T extends LGraphNode

Parameters ​

ctor ​

new () => T

Returns ​

this is T

Inherited from ​

LGraphNode.is


isAnyOutputConnected() ​

ts
isAnyOutputConnected(): boolean;

Defined in: packages/core/src/LGraphNode.ts:993

tells you if there is any connection in the output slots

Returns ​

boolean

Inherited from ​

LGraphNode.isAnyOutputConnected


isInputConnected() ​

ts
isInputConnected(slot): boolean;

Defined in: packages/core/src/LGraphNode.ts:772

tells you if there is a connection in one input slot

Parameters ​

slot ​

number

Returns ​

boolean

Inherited from ​

LGraphNode.isInputConnected


isOutputConnected() ​

ts
isOutputConnected(slot): boolean;

Defined in: packages/core/src/LGraphNode.ts:981

tells you if there is a connection in one output slot

Parameters ​

slot ​

number

Returns ​

boolean

Inherited from ​

LGraphNode.isOutputConnected


isPointInside() ​

ts
isPointInside(
   x, 
   y, 
   margin?, 
   skipTitle?
): boolean;

Defined in: packages/core/src/LGraphNode.ts:1794

checks if a point is inside the shape of a node

Parameters ​

x ​

number

y ​

number

margin? ​

number = 0

skipTitle? ​

boolean = false

Returns ​

boolean

Inherited from ​

LGraphNode.isPointInside


isShowingTitle() ​

ts
isShowingTitle(mouseOver): boolean;

Defined in: packages/core/src/LGraphNode.ts:2843

Parameters ​

mouseOver ​

boolean

Returns ​

boolean

Inherited from ​

LGraphNode.isShowingTitle


ts
iterateAllLinks(): Iterable<LLink>;

Defined in: packages/core/src/LGraphNode.ts:1034

Returns ​

Iterable<LLink>

Inherited from ​

LGraphNode.iterateAllLinks


iterateInputInfo() ​

ts
iterateInputInfo(): Iterable<INodeInputSlot>;

Defined in: packages/core/src/LGraphNode.ts:677

Returns ​

Iterable<INodeInputSlot>

Inherited from ​

LGraphNode.iterateInputInfo


iterateOutputInfo() ​

ts
iterateOutputInfo(): Iterable<INodeOutputSlot>;

Defined in: packages/core/src/LGraphNode.ts:904

Returns ​

Iterable<INodeOutputSlot>

Inherited from ​

LGraphNode.iterateOutputInfo


iterateParentGraphs() ​

ts
iterateParentGraphs(): Iterable<LGraph>;

Defined in: packages/core/src/nodes/Subgraph.ts:188

Returns ​

Iterable<LGraph>


iterateParentSubgraphNodes() ​

ts
iterateParentSubgraphNodes(): Iterable<Subgraph>;

Defined in: packages/core/src/LGraphNode.ts:467

Returns ​

Iterable<Subgraph>

Inherited from ​

LGraphNode.iterateParentSubgraphNodes


loadImage() ​

ts
loadImage(url): HTMLImageElement;

Defined in: packages/core/src/LGraphNode.ts:2812

Parameters ​

url ​

string

Returns ​

HTMLImageElement

Inherited from ​

LGraphNode.loadImage


localToScreen() ​

ts
localToScreen(
   x, 
   y, 
   graphCanvas
): Vector2;

Defined in: packages/core/src/LGraphNode.ts:2876

Parameters ​

x ​

number

y ​

number

graphCanvas ​

LGraphCanvas

Returns ​

Vector2

Inherited from ​

LGraphNode.localToScreen


moveInput() ​

ts
moveInput(slot, newSlot): void;

Defined in: packages/core/src/LGraphNode.ts:1520

Parameters ​

slot ​

number

newSlot ​

number

Returns ​

void

Inherited from ​

LGraphNode.moveInput


moveNodesToParentGraph() ​

ts
moveNodesToParentGraph(nodes): Record<NodeID, LGraphNode>;

Defined in: packages/core/src/nodes/Subgraph.ts:858

Parameters ​

nodes ​

LGraphNode[]

Returns ​

Record<NodeID, LGraphNode>


moveOutput() ​

ts
moveOutput(slot, newSlot): void;

Defined in: packages/core/src/LGraphNode.ts:1421

Parameters ​

slot ​

number

newSlot ​

number

Returns ​

void

Inherited from ​

LGraphNode.moveOutput


onAction() ​

ts
onAction(
   action, 
   param, 
   options
): void;

Defined in: packages/core/src/nodes/Subgraph.ts:203

Parameters ​

action ​

any

param ​

any

options ​

LActionOptions

Returns ​

void

Overrides ​

LGraphNode.onAction


onAdded()? ​

ts
onAdded?(graph): void;

Defined in: packages/core/src/LGraphNode.ts:3003

when added to graph (warning: this is called BEFORE the node is configured when loading) Called by LGraph.add

Parameters ​

graph ​

LGraph

Returns ​

void

Inherited from ​

LGraphNode.onAdded


onAddPropertyToPanel()? ​

ts
onAddPropertyToPanel?(name, panel): boolean;

Defined in: packages/core/src/LGraphNode.ts:3084

Parameters ​

name ​

string

panel ​

INodePanel

Returns ​

boolean

Inherited from ​

LGraphNode.onAddPropertyToPanel


onAfterExecuteNode() ​

ts
onAfterExecuteNode(param, options?): void;

Defined in: packages/core/src/LGraphNode.ts:1074

Parameters ​

param ​

any

options? ​

object

Returns ​

void

Inherited from ​

LGraphNode.onAfterExecuteNode


onBeforeConnectInput()? ​

ts
onBeforeConnectInput?(inputIndex): number;

Defined in: packages/core/src/LGraphNode.ts:3053

Called just before connection (or disconnect - if input is linked). A convenient place to switch to another input, or create new one. This allow for ability to automatically add slots if needed

Parameters ​

inputIndex ​

number

Returns ​

number

selected input slot index, can differ from parameter value

Inherited from ​

LGraphNode.onBeforeConnectInput


onBounding()? ​

ts
onBounding?(area): boolean;

Defined in: packages/core/src/LGraphNode.ts:2935

Parameters ​

area ​

Float32Array

Returns ​

boolean

Inherited from ​

LGraphNode.onBounding


onConfigure() ​

ts
onConfigure(o): void;

Defined in: packages/core/src/nodes/Subgraph.ts:457

Called by LGraph.configure

Parameters ​

o ​

SerializedLGraphNode

Returns ​

void

Overrides ​

LGraphNode.onConfigure


onConnectInput()? ​

ts
onConnectInput?(
   inputIndex, 
   outputType, 
   outputSlot, 
   outputNode, 
   outputIndex
): boolean;

Defined in: packages/core/src/LGraphNode.ts:3020

if returns false the incoming connection will be canceled Called by LGraph.connect

Parameters ​

inputIndex ​

number

target input slot number

outputType ​

SlotType

type of output slot

outputSlot ​

INodeOutputSlot

output slot object

outputNode ​

LGraphNode

node containing the output

outputIndex ​

number

index of output slot

Returns ​

boolean

Inherited from ​

LGraphNode.onConnectInput


onConnectionsChange()? ​

ts
onConnectionsChange?(
   type, 
   slotIndex, 
   isConnected, 
   link, 
   ioSlot
): void;

Defined in: packages/core/src/LGraphNode.ts:3059

a connection changed (new one or removed) (LiteGraph.INPUT or LiteGraph.OUTPUT, slot, true if connected, linkInfo, input_info or output_info )

Parameters ​

type ​

LConnectionKind

slotIndex ​

number

isConnected ​

boolean

LLink

ioSlot ​

| INodeInputSlot | INodeOutputSlot

Returns ​

void

Inherited from ​

LGraphNode.onConnectionsChange


onConnectOutput()? ​

ts
onConnectOutput?(
   outputIndex, 
   inputType, 
   inputSlot, 
   inputNode, 
   inputIndex
): boolean;

Defined in: packages/core/src/LGraphNode.ts:3037

if returns false the incoming connection will be canceled Called by LGraph.connect

Parameters ​

outputIndex ​

number

target output slot number

inputType ​

SlotType

type of input slot

inputSlot ​

INodeInputSlot

input slot object

inputNode ​

LGraphNode

node containing the input

inputIndex ​

number

index of input slot

Returns ​

boolean

Inherited from ​

LGraphNode.onConnectOutput


onDblClick() ​

ts
onDblClick(
   e, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/nodes/Subgraph.ts:196

Parameters ​

e ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Overrides ​

LGraphNode.onDblClick


onDeselected()? ​

ts
onDeselected?(): void;

Defined in: packages/core/src/LGraphNode.ts:2986

Called by LGraphCanvas.deselectNode

Returns ​

void

Inherited from ​

LGraphNode.onDeselected


onDrawBackground() ​

ts
onDrawBackground(
   ctx, 
   graphcanvas, 
   canvas, 
   pos
): void;

Defined in: packages/core/src/nodes/Subgraph.ts:255

Parameters ​

ctx ​

CanvasRenderingContext2D

graphcanvas ​

LGraphCanvas

canvas ​

HTMLCanvasElement

pos ​

Vector2

Returns ​

void

Overrides ​

LGraphNode.onDrawBackground


onDrawCollapsed()? ​

ts
onDrawCollapsed?(ctx, graphCanvas): boolean;

Defined in: packages/core/src/LGraphNode.ts:2898

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

Returns ​

boolean

Inherited from ​

LGraphNode.onDrawCollapsed


onDrawForeground()? ​

ts
onDrawForeground?(
   ctx, 
   graphCanvas, 
   canvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2892

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

canvas ​

HTMLCanvasElement

Returns ​

void

Inherited from ​

LGraphNode.onDrawForeground


onDrawTitle()? ​

ts
onDrawTitle?(ctx, graphCanvas): boolean;

Defined in: packages/core/src/LGraphNode.ts:2930

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

Returns ​

boolean

Inherited from ​

LGraphNode.onDrawTitle


onDrawTitleBar()? ​

ts
onDrawTitleBar?(
   ctx, 
   graphCanvas, 
   title_height, 
   size, 
   scale, 
   fgColor
): boolean;

Defined in: packages/core/src/LGraphNode.ts:2903

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

title_height ​

number

size ​

Vector2

scale ​

number

fgColor ​

string

Returns ​

boolean

Inherited from ​

LGraphNode.onDrawTitleBar


onDrawTitleBox()? ​

ts
onDrawTitleBox?(
   ctx, 
   graphCanvas, 
   title_height, 
   size, 
   scale
): boolean;

Defined in: packages/core/src/LGraphNode.ts:2912

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

title_height ​

number

size ​

Vector2

scale ​

number

Returns ​

boolean

Inherited from ​

LGraphNode.onDrawTitleBox


onDrawTitleText()? ​

ts
onDrawTitleText?(
   ctx, 
   graphCanvas, 
   title_height, 
   size, 
   scale, 
   font, 
   selected
): boolean;

Defined in: packages/core/src/LGraphNode.ts:2920

Parameters ​

ctx ​

CanvasRenderingContext2D

graphCanvas ​

LGraphCanvas

title_height ​

number

size ​

Vector2

scale ​

number

font ​

string

selected ​

boolean

Returns ​

boolean

Inherited from ​

LGraphNode.onDrawTitleText


onDropData()? ​

ts
onDropData?(
   data, 
   filename, 
   file
): void;

Defined in: packages/core/src/LGraphNode.ts:233

Parameters ​

data ​

string | ArrayBuffer

filename ​

string

file ​

File

Returns ​

void

Inherited from ​

LGraphNode.onDropData


onDropFile()? ​

ts
onDropFile?(file): void;

Defined in: packages/core/src/LGraphNode.ts:232

Parameters ​

file ​

File

Returns ​

void

Inherited from ​

LGraphNode.onDropFile


onDropItem()? ​

ts
onDropItem?(e): boolean | void;

Defined in: packages/core/src/LGraphNode.ts:234

Parameters ​

e ​

DragEvent

Returns ​

boolean | void

Inherited from ​

LGraphNode.onDropItem


onExecute() ​

ts
onExecute(): void;

Defined in: packages/core/src/nodes/Subgraph.ts:221

Called by LGraph.runStep LGraphNode.getInputData

Returns ​

void

Overrides ​

LGraphNode.onExecute


onGetPropertyInfo()? ​

ts
onGetPropertyInfo?(property): IPropertyInfo;

Defined in: packages/core/src/LGraphNode.ts:3082

Parameters ​

property ​

string

Returns ​

IPropertyInfo

Inherited from ​

LGraphNode.onGetPropertyInfo


onInputAdded()? ​

ts
onInputAdded?(input): void;

Defined in: packages/core/src/LGraphNode.ts:3093

Parameters ​

input ​

INodeInputSlot

Returns ​

void

Inherited from ​

LGraphNode.onInputAdded


onInputClick()? ​

ts
onInputClick?(slot, event): void;

Defined in: packages/core/src/LGraphNode.ts:3097

Parameters ​

slot ​

number

event ​

MouseEventExt

Returns ​

void

Inherited from ​

LGraphNode.onInputClick


onInputDblClick()? ​

ts
onInputDblClick?(slot, event): void;

Defined in: packages/core/src/LGraphNode.ts:3099

Parameters ​

slot ​

number

event ​

MouseEventExt

Returns ​

void

Inherited from ​

LGraphNode.onInputDblClick


onInputRemoved()? ​

ts
onInputRemoved?(slot, input): void;

Defined in: packages/core/src/LGraphNode.ts:3095

Parameters ​

slot ​

number

input ​

INodeInputSlot

Returns ​

void

Inherited from ​

LGraphNode.onInputRemoved


onJSPropertyChanged()? ​

ts
onJSPropertyChanged?(
   property, 
   value, 
   prevValue?
): boolean | void;

Defined in: packages/core/src/LGraphNode.ts:3080

Called when the node's title or other JS property changes

Parameters ​

property ​

string

value ​

any

prevValue? ​

any

Returns ​

boolean | void

Inherited from ​

LGraphNode.onJSPropertyChanged


onKey()? ​

ts
onKey?(
   event, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2975

Parameters ​

event ​

KeyboardEvent

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Inherited from ​

LGraphNode.onKey


onKeyDown()? ​

ts
onKeyDown?(event): void;

Defined in: packages/core/src/LGraphNode.ts:2976

Parameters ​

event ​

KeyboardEvent

Returns ​

void

Inherited from ​

LGraphNode.onKeyDown


onKeyUp()? ​

ts
onKeyUp?(event): void;

Defined in: packages/core/src/LGraphNode.ts:2977

Parameters ​

event ​

KeyboardEvent

Returns ​

void

Inherited from ​

LGraphNode.onKeyUp


onMenuNodeInputs()? ​

ts
onMenuNodeInputs?(item): ContextMenuItem[];

Defined in: packages/core/src/LGraphNode.ts:3089

Parameters ​

item ​

ContextMenuItem[]

Returns ​

ContextMenuItem[]

Inherited from ​

LGraphNode.onMenuNodeInputs


onMenuNodeOutputs()? ​

ts
onMenuNodeOutputs?(item): ContextMenuItem[];

Defined in: packages/core/src/LGraphNode.ts:3101

Parameters ​

item ​

ContextMenuItem[]

Returns ​

ContextMenuItem[]

Inherited from ​

LGraphNode.onMenuNodeOutputs


onMouseDown()? ​

ts
onMouseDown?(
   event, 
   pos, 
   graphCanvas
): boolean | void;

Defined in: packages/core/src/LGraphNode.ts:2939

Parameters ​

event ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

boolean | void

Inherited from ​

LGraphNode.onMouseDown


onMouseEnter()? ​

ts
onMouseEnter?(
   event, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2957

Parameters ​

event ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Inherited from ​

LGraphNode.onMouseEnter


onMouseLeave()? ​

ts
onMouseLeave?(
   event, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2963

Parameters ​

event ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Inherited from ​

LGraphNode.onMouseLeave


onMouseMove()? ​

ts
onMouseMove?(
   event, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2945

Parameters ​

event ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Inherited from ​

LGraphNode.onMouseMove


onMouseUp()? ​

ts
onMouseUp?(
   event, 
   pos, 
   graphCanvas
): void;

Defined in: packages/core/src/LGraphNode.ts:2951

Parameters ​

event ​

MouseEventExt

pos ​

Vector2

graphCanvas ​

LGraphCanvas

Returns ​

void

Inherited from ​

LGraphNode.onMouseUp


onNodeCreated()? ​

ts
onNodeCreated?(): void;

Defined in: packages/core/src/LGraphNode.ts:230

Returns ​

void

Inherited from ​

LGraphNode.onNodeCreated


onNodeOptionalInputAdd()? ​

ts
onNodeOptionalInputAdd?(value): void;

Defined in: packages/core/src/LGraphNode.ts:3091

Parameters ​

value ​

any

Returns ​

void

Inherited from ​

LGraphNode.onNodeOptionalInputAdd


onNodeOptionalOutputAdd()? ​

ts
onNodeOptionalOutputAdd?(value): void;

Defined in: packages/core/src/LGraphNode.ts:3103

Parameters ​

value ​

any

Returns ​

void

Inherited from ​

LGraphNode.onNodeOptionalOutputAdd


onOutputAdded()? ​

ts
onOutputAdded?(output): void;

Defined in: packages/core/src/LGraphNode.ts:3107

Parameters ​

output ​

INodeOutputSlot

Returns ​

void

Inherited from ​

LGraphNode.onOutputAdded


onOutputClick()? ​

ts
onOutputClick?(slot, event): void;

Defined in: packages/core/src/LGraphNode.ts:3111

Parameters ​

slot ​

number

event ​

MouseEventExt

Returns ​

void

Inherited from ​

LGraphNode.onOutputClick


onOutputDblClick()? ​

ts
onOutputDblClick?(slot, event): void;

Defined in: packages/core/src/LGraphNode.ts:3113

Parameters ​

slot ​

number

event ​

MouseEventExt

Returns ​

void

Inherited from ​

LGraphNode.onOutputDblClick


onOutputRemoved()? ​

ts
onOutputRemoved?(slot, output): void;

Defined in: packages/core/src/LGraphNode.ts:3109

Parameters ​

slot ​

number

output ​

INodeOutputSlot

Returns ​

void

Inherited from ​

LGraphNode.onOutputRemoved


onPropertyChanged()? ​

ts
onPropertyChanged?(
   property, 
   value, 
   prevValue?
): boolean | void;

Defined in: packages/core/src/LGraphNode.ts:3075

if returns false, will abort the LGraphNode.setProperty Called when a property is changed

Parameters ​

property ​

string

value ​

any

prevValue? ​

any

Returns ​

boolean | void

Inherited from ​

LGraphNode.onPropertyChanged


onReassignID() ​

ts
onReassignID(): void;

Defined in: packages/core/src/nodes/Subgraph.ts:469

Returns ​

void

Overrides ​

LGraphNode.onReassignID


onRemoved()? ​

ts
onRemoved?(options?): void;

Defined in: packages/core/src/LGraphNode.ts:3009

when removed from graph Called by LGraph.remove LGraph.clear

Parameters ​

options? ​

LGraphRemoveNodeOptions

Returns ​

void

Inherited from ​

LGraphNode.onRemoved


onResize() ​

ts
onResize(size): void;

Defined in: packages/core/src/nodes/Subgraph.ts:446

Parameters ​

size ​

Vector2

Returns ​

void

Overrides ​

LGraphNode.onResize


onSelected()? ​

ts
onSelected?(): void;

Defined in: packages/core/src/LGraphNode.ts:2983

Called by LGraphCanvas.selectNodes

Returns ​

void

Inherited from ​

LGraphNode.onSelected


onSerialize()? ​

ts
onSerialize?(o): void;

Defined in: packages/core/src/LGraphNode.ts:2994

Called by LGraph.serialize

Parameters ​

o ​

SerializedLGraphNode

Returns ​

void

Inherited from ​

LGraphNode.onSerialize


onShowCustomPanelInfo()? ​

ts
onShowCustomPanelInfo?(panel): void;

Defined in: packages/core/src/LGraphNode.ts:3085

Parameters ​

panel ​

INodePanel

Returns ​

void

Inherited from ​

LGraphNode.onShowCustomPanelInfo


onSlotPropertyChanged()? ​

ts
onSlotPropertyChanged?(
   kind, 
   slot, 
   slotInfo, 
   name, 
   value, 
   prev_value?
): boolean;

Defined in: packages/core/src/LGraphNode.ts:3119

Parameters ​

kind ​

LConnectionKind

slot ​

number

slotInfo ​

| INodeInputSlot | INodeOutputSlot

name ​

string

value ​

any

prev_value? ​

any

Returns ​

boolean

Inherited from ​

LGraphNode.onSlotPropertyChanged


onWidgetChanged()? ​

ts
onWidgetChanged?(widget, oldValue?): void;

Defined in: packages/core/src/LGraphNode.ts:3087

Parameters ​

widget ​

IWidget

oldValue? ​

any

Returns ​

void

Inherited from ​

LGraphNode.onWidgetChanged


pin() ​

ts
pin(v?): void;

Defined in: packages/core/src/LGraphNode.ts:2867

Forces the node to do not move or realign on Z

Parameters ​

v? ​

boolean

Returns ​

void

Inherited from ​

LGraphNode.pin


removeGraphInput() ​

ts
removeGraphInput(inputName): void;

Defined in: packages/core/src/nodes/Subgraph.ts:752

Parameters ​

inputName ​

string

Returns ​

void


removeGraphOutput() ​

ts
removeGraphOutput(outputName): void;

Defined in: packages/core/src/nodes/Subgraph.ts:777

Parameters ​

outputName ​

string

Returns ​

void


removeInput() ​

ts
removeInput(slot): void;

Defined in: packages/core/src/LGraphNode.ts:1498

remove an existing input slot

Parameters ​

slot ​

number

Returns ​

void

Inherited from ​

LGraphNode.removeInput


removeOutput() ​

ts
removeOutput(slot): void;

Defined in: packages/core/src/LGraphNode.ts:1393

remove an existing output slot

Parameters ​

slot ​

number

Returns ​

void

Inherited from ​

LGraphNode.removeOutput


sendEventToAllNodes() ​

ts
sendEventToAllNodes(
   eventname, 
   param, 
   mode
): void;

Defined in: packages/core/src/nodes/Subgraph.ts:249

Parameters ​

eventname ​

string

param ​

any

mode ​

NodeMode

Returns ​

void


serialize() ​

ts
serialize<T>(): T;

Defined in: packages/core/src/nodes/Subgraph.ts:450

serialize the content

Type Parameters ​

T ​

T extends SerializedLGraphNode

Returns ​

T

Overrides ​

LGraphNode.serialize


setDirtyCanvas() ​

ts
setDirtyCanvas(fg, bg?): void;

Defined in: packages/core/src/LGraphNode.ts:2805

Forces to redraw or the main canvas (LGraphNode) or the bg canvas (links)

Parameters ​

fg ​

boolean

bg? ​

boolean = false

Returns ​

void

Inherited from ​

LGraphNode.setDirtyCanvas


setInputDataType() ​

ts
setInputDataType(slot, type): void;

Defined in: packages/core/src/LGraphNode.ts:853

sets the input data type

Parameters ​

slot ​

number

type ​

SlotType

Returns ​

void

Inherited from ​

LGraphNode.setInputDataType


setInputSlotProperty() ​

ts
setInputSlotProperty(
   slot, 
   name, 
   value
): void;

Defined in: packages/core/src/LGraphNode.ts:539

Parameters ​

slot ​

number

name ​

string

value ​

any

Returns ​

void

Inherited from ​

LGraphNode.setInputSlotProperty


setOutputData() ​

ts
setOutputData(slot, data): void;

Defined in: packages/core/src/LGraphNode.ts:602

sets the output data

Parameters ​

slot ​

number

data ​

any

Returns ​

void

Inherited from ​

LGraphNode.setOutputData


setOutputDataType() ​

ts
setOutputDataType(slot, type): void;

Defined in: packages/core/src/LGraphNode.ts:640

sets the output data

Parameters ​

slot ​

number

type ​

SlotType

Returns ​

void

Inherited from ​

LGraphNode.setOutputDataType


setOutputSlotProperty() ​

ts
setOutputSlotProperty(
   slot, 
   name, 
   value
): void;

Defined in: packages/core/src/LGraphNode.ts:570

Parameters ​

slot ​

number

name ​

string

value ​

any

Returns ​

void

Inherited from ​

LGraphNode.setOutputSlotProperty


setProperty() ​

ts
setProperty(name, value): void;

Defined in: packages/core/src/LGraphNode.ts:476

sets the value of a property

Parameters ​

name ​

string

value ​

any

Returns ​

void

Inherited from ​

LGraphNode.setProperty


setSize() ​

ts
setSize(size): void;

Defined in: packages/core/src/LGraphNode.ts:1309

changes node size and triggers callback

Parameters ​

size ​

Vector2

Returns ​

void

Method ​

setSize

Inherited from ​

LGraphNode.setSize


setWidgetHidden() ​

ts
setWidgetHidden(widget, hidden): void;

Defined in: packages/core/src/LGraphNode.ts:1771

Parameters ​

widget ​

IWidget

hidden ​

boolean

Returns ​

void

Inherited from ​

LGraphNode.setWidgetHidden


toString() ​

ts
toString(): string;

Defined in: packages/core/src/LGraphNode.ts:446

serialize and stringify

Returns ​

string

Inherited from ​

LGraphNode.toString


trace() ​

ts
trace(msg): void;

Defined in: packages/core/src/LGraphNode.ts:2790

Console output

Parameters ​

msg ​

string

Returns ​

void

Inherited from ​

LGraphNode.trace


trigger() ​

ts
trigger(
   action, 
   param?, 
   options?
): void;

Defined in: packages/core/src/LGraphNode.ts:1171

Triggers an event in this node, this will trigger any output with the same name

Parameters ​

action ​

string

param? ​

any

options? ​

LActionOptions

Returns ​

void

Inherited from ​

LGraphNode.trigger


triggerSlot() ​

ts
triggerSlot(
   slot, 
   param?, 
   link_id?, 
   options?
): void;

Defined in: packages/core/src/LGraphNode.ts:1193

Triggers an slot event in this node

Parameters ​

slot ​

number

the index of the output slot

param? ​

any

LinkID

in case you want to trigger and specific output link in a slot

options? ​

LActionOptions = {}

Returns ​

void

Inherited from ​

LGraphNode.triggerSlot


updateOutputData()? ​

ts
updateOutputData?(slot): void;

Defined in: packages/core/src/LGraphNode.ts:3105

Parameters ​

slot ​

number

Returns ​

void

Inherited from ​

LGraphNode.updateOutputData

Released under the MIT License.