API Docs for:
Show:

LiteGraph Class

Defined in: ../src/litegraph.js:6

The Global Scope. It contains all the registered node classes.

Constructor

LiteGraph

()

Methods

addNodeMethod

(
  • func
)

Adds this method to all nodetypes, existing and to be created (You can add it to LGraphNode.prototype but then existing node types wont have it)

Parameters:

  • func Function

createNode

(
  • type
  • name
  • options
)

Create a node of a given type with a name. The node is not attached to any graph yet.

Parameters:

  • type String

    full name of the node class. p.e. "math/sin"

  • name String

    a name to distinguish from other nodes

  • options Object

    to set options

getNodeType

(
  • type
)
Class

Returns a registered node type with a given name

Parameters:

  • type String

    full name of the node class. p.e. "math/sin"

Returns:

Class:

the node class

getNodeType

(
  • category
)
Array

Returns a list of node types matching one category

Parameters:

  • category String

    category name

Returns:

Array:

array with all the node classes

getNodeTypesCategories

() Array

Returns a list with all the node type categories

Returns:

Array:

array with all the names of the categories

registerNodeType

(
  • type
  • base_class
)

Register a node class so it can be listed when the user wants to create a new one

Parameters:

  • type String

    name of the node and path

  • base_class Class

    class containing the structure of a node