Constructors

Properties

Methods

Constructors

Properties

ACTION_LINK_COLOR: string = "#86A"
CANVAS_GRID_SIZE: number = 10
CONNECTING_LINK_COLOR: string = "#AFA"
DEFAULT_GROUP_FONT_SIZE: number = 24
DEFAULT_POSITION: Vector2 = ...
DEFAULT_SHADOW_COLOR: string = "rgba(0,0,0,0.5)"
EVENT_LINK_COLOR: string = "#A86"
Globals: Record<any, any> = {}

used to store vars between graphs *

LINK_COLOR: string = "#9A9"
MAX_NUMBER_OF_NODES: number = 1000
NODE_BOX_OUTLINE_COLOR: string = "#FFF"
NODE_COLLAPSED_RADIUS: number = 10
NODE_COLLAPSED_WIDTH: number = 80
NODE_DEFAULT_BGCOLOR: string = "#353535"
NODE_DEFAULT_BOXCOLOR: string = "#666"
NODE_DEFAULT_COLOR: string = "#333"
NODE_DEFAULT_SHAPE: string = "box"
NODE_MIN_WIDTH: number = 50
NODE_OUTLINE_COLOR: string = "#666"
NODE_OUTLINE_WIDTH: number = 0
NODE_SELECTED_TITLE_COLOR: string = "#FFF"
NODE_SLOT_HEIGHT: number = 20
NODE_SUBTEXT_SIZE: number = 12
NODE_TEXT_COLOR: string = "#AAA"
NODE_TEXT_SIZE: number = 14
NODE_TITLE_COLOR: string = "#999"
NODE_TITLE_HEIGHT: number = 20
NODE_TITLE_TEXT_Y: number = 15
NODE_WIDGET_HEIGHT: number = 20
NODE_WIDTH: number = 140
Nodes: Record<string, LGraphNodeConstructor<LGraphNode>> = {}

node types by class name

VERSION: string = version
WIDGET_BGCOLOR: string = "#222"
WIDGET_OUTLINE_COLOR: string = "#666"
WIDGET_SECONDARY_TEXT_COLOR: string = "#999"
WIDGET_TEXT_COLOR: string = "#DDD"
allow_multi_output_for_events: boolean = true
allow_scripts: boolean = false

if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits

alt_drag_do_clone_nodes: boolean = false
auto_load_slot_types: boolean = false
auto_sort_node_types: boolean = false
catch_exceptions: boolean = true
click_do_break_link_to: boolean = false
debug: boolean = false
dialog_close_on_mouse_leave: boolean = true
dialog_close_on_mouse_leave_delay: number = 500
do_add_triggers_slots: boolean = false
graph_inputs_outputs_use_combo_widget: boolean = false
ignore_all_widget_events: boolean = false
middle_click_slot_add_default_node: boolean = false
node_box_coloured_by_mode: boolean = false
node_box_coloured_when_on: boolean = false
node_images_path: string = ""
node_types_by_file_extension: Record<string, LGraphNodeConstructor<LGraphNode>> = {}

used for dropping files in the canvas

pointerevents_method: PointerEventsMethod = "mouse"
proxy: any = null
registered_node_types: Record<string, LGraphNodeConstructor<LGraphNode>> = {}

node types by string

registered_slot_in_types: Record<string, {
    nodes: string[];
}> = {}

Type declaration

  • nodes: string[]
registered_slot_out_types: Record<string, {
    nodes: string[];
}> = {}

Type declaration

  • nodes: string[]
release_link_on_empty_shows_menu: boolean = false
search_box_refresh_interval_ms: number = 250
search_filter_enabled: boolean = false
search_hide_on_mouse_leave: boolean = true
search_show_all_on_open: boolean = true
searchbox_extras: Record<string, SearchboxExtra> = {}

used to add extra features to the search box

serialize_slot_data: boolean = false
shift_click_do_break_link_from: boolean = false
slot_types_default_in: Record<string, NodeTypeSpec[]> = {}
slot_types_default_out: Record<string, NodeTypeSpec[]> = {}
slot_types_in: string[] = []
slot_types_out: string[] = []
throw_errors: boolean = true
use_uuids: boolean = false

Methods

  • Returns a list with all the node type categories

    Parameters

    • filter: string

      only nodes with ctor.filter equal can be shown

    Returns string[]

    array with all the names of the categories

    Method

    getNodeTypesCategories

  • Parameters

    • x: number
    • y: number
    • left: number
    • top: number
    • width: number
    • height: number

    Returns boolean

  • Returns if the types of two slots are compatible (taking into account wildcards, etc)

    Parameters

    Returns boolean

    true if they can be connected

    Method

    isValidConnection

  • Parameters

    • oDOM: Node
    • sEvIn: string
    • fCall: EventListener
    • capture: boolean = false

    Returns void

  • Parameters

    • oDOM: any
    • sEvent: any
    • fCall: any
    • capture: boolean = false

    Returns any

  • debug purposes: reloads all the js scripts that matches a wildcard

    Parameters

    • folder_wildcard: string

    Returns void

  • Create a new node type by passing a function, it wraps it with a proper class and generates inputs according to the parameters of the function. Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.

    Parameters

    • type: string

      node name with namespace (p.e.: 'math/sum')

    • arg_names: string[]

      an array containing the names of the arguments

    • func: ((...args) => any)
        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional param_types: string[]

      an array containing the type of every parameter, otherwise parameters will accept any type

    • Optional return_type: string

      string with the return type, otherwise it will be generic

    • Optional properties: object

      properties to be configurable

    Returns void

  • Create a new node type by passing a function, it wraps it with a proper class and generates inputs according to the parameters of the function. Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.

    Parameters

    • type: string

      node name with namespace (p.e.: 'math/sum')

    • func: ((...args) => any)
        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional param_types: string[]

      an array containing the type of every parameter, otherwise parameters will accept any type

    • Optional return_type: string

      string with the return type, otherwise it will be generic

    • Optional properties: object

      properties to be configurable

    Returns void