Optional graph: LGraphOptional autoresize?: booleanOptional skip_Optional skip_Optional viewport?: Vector4Private _events_Optional _key_Optional _mousedown_Optional _mousemove_Optional _mouseup_Optional _mousewheel_Optional _ondrop_allow to control widgets, buttons, collapse, etc
allows to change a connection with having to redo it again
No effect
Optional autoresizeOptional dirty_Optional dirty_used for transition
allows to filter to only accept some type of nodes in a graph
mouse in graph coordinates, where 0,0 is the top-left corner of the blue rectangle
Possible duplicated with last_mouse
https://github.com/jagenjo/litegraph.js/issues/70
Timestamp of last mouse click, defaults to 0
mouse in canvas coordinates, where 0,0 is the top-left corner of the blue rectangle
allow selecting multi nodes without pressing extra keys
mouse in offset coordinates, where 0,0 is the top-left corner of the canvas DOM element
if set to true users cannot modify the graph
too much cpu
forces to redraw the canvas if the mouse does anything
set to true to render title bar with gradients
Static DEFAULT_Static DEFAULT_Static DEFAULT_Static DEFAULT_Static DEFAULT_Static active_Static active_Static aligna list of nodes
Direction to align the nodes
Optional align_to: LGraphNodeNode to align to (if null, align to the furthest node in the given direction)
Static boundaryDetermines the furthest nodes in each direction for the currently selected nodes
Determines the furthest nodes in each direction for the currently selected nodes
Static getalign nodes action
Static gradientsStatic node_Static onCreate menu for Add Group
Static onStatic onCreate menu for Add Node
Create menu for Add Node
Optional callback: ((node) => void)Static onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic onStatic search_Static showStatic showPrivate _doPrivate _doadds some useful properties to a mouse event, like the position in graph coordinates
adjustMouseEvent
a list of nodes
Direction to align the nodes
Optional align_to: LGraphNodeNode to align to (if null, align to the furthest node in the given direction)
Determines the furthest nodes in each direction for the currently selected nodes
brings a node to front (above all other nodes)
centers the camera on a given node
checks which nodes are visible (inside the camera area)
converts event coordinates from canvas2D to graph coordinates
Optional options: GraphDialogOptionsOptional closable?: booleanOptional height?: numberOptional onOptional onOptional width?: numberOptional window?: Windowremoves a node from the current selection
Optional text: stringdraws tht given node invisible the canvas
used by this.over_link_center
draws the given node inside the canvas
draws the shape of the given node in the canvas
draws the widgets stored inside a node
Determines the furthest nodes in each direction
{LGraphNode[]} the nodes to from which boundary nodes will be extracted
Optional getOptional getCalled by getCanvasMenuOptions, append to default options
Optional getCalled by getCanvasMenuOptions, replace default options
Optional hold_click: booleanreturns true if a position (in graph space) is on top of a node little corner box
returns slot index if a position (in graph space) is on top of a node input slot
Optional slotPos: Vector2returns the INDEX if a position (in graph space) is on top of a node output slot
Optional slot_pos: Vector2isOverNodeOuput
Optional onOptional onOptional onOptional oncalled when rendering a tooltip
Optional onOptional onOptional onOptional onCalled by LGraphCanvas.processMouseDown
Optional onOptional onCalled by LGraphCanvas.processNodeDblClicked
Optional onCalled by LGraphCanvas.deselectNode
Optional oncalled after moving a node
Optional onCalled by LGraphCanvas.processNodeSelected
Optional onOptional onOptional onCalled by LGraphCanvas.showSearchBox
Optional onOptional oncalled if the selection changes
Optional onCalled by LGraphCanvas.processNodeDblClicked
opens a graph contained inside a node in the current graph
Called when mouse right click
process an event on widgets
Optional activeWidget: objectdraws a link between two points
start pos
end pos
the link object with all the link info
ignore the shadow of the link
Optional color: stringshow flow animation (for events)
Optional startDir: Dirthe color for the link
Optional endDir: Dirthe direction enum
Optional numSublines: numberthe direction enum
selects a given node (or adds it to the current selection)
selects several nodes (or adds them to the current selection)
Optional nodes: LGraphNode[]sends a node to the back (below all other nodes)
assigns a graph, you can reassign graphs to the same canvas
changes the zoom level of the graph (default is 1), you can pass also a place used to pivot the zoom
Optional e?: MouseEventExtOptional nodeOptional nodeOptional slotOptional slotOptional do_Optional hide_Optional node_Optional node_Optional show_Optional show_Optional show_Optional show_Optional slotOptional type_Optional type_Static decodeHTMLStatic getStatic get
This class is in charge of rendering one graph inside a canvas. And provides all the interaction required. Valid callbacks are: onNodeSelected, onNodeDeselected, onShowNodePanel, onNodeDblClicked
Param: canvas
the canvas where you want to render (it accepts a selector in string format or the canvas element itself)
Param: graph
Param: options
{ skip_rendering, autoresize }