@gausszhou/litegraph-core / LGraphCanvas_Rendering
Class: LGraphCanvas_Rendering
Defined in: packages/core/src/LGraphCanvas_Rendering.ts:11
Extended by
Constructors
Constructor
new LGraphCanvas_Rendering(): LGraphCanvas_Rendering;Returns
LGraphCanvas_Rendering
Methods
bringToFront()
bringToFront(this, node): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:25
brings a node to front (above all other nodes)
Parameters
this
node
Returns
void
computeConnectionPoint()
computeConnectionPoint(
this,
a,
b,
t,
startDir?,
endDir?
): Vector2;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:1957
Parameters
this
a
b
t
number
startDir?
Dir = Dir.RIGHT
endDir?
Dir = Dir.LEFT
Returns
computeVisibleNodes()
computeVisibleNodes(
this,
nodes,
out?
): LGraphNode[];Defined in: packages/core/src/LGraphCanvas_Rendering.ts:49
checks which nodes are visible (inside the camera area)
Parameters
this
nodes
out?
LGraphNode[] = []
Returns
draw()
draw(
this,
forceFG?,
forceBG?
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:71
renders the whole canvas content, by rendering in two separated canvas, one containing the background grid and the connections, and one containing the nodes)
Parameters
this
forceFG?
boolean = false
forceBG?
boolean = false
Returns
void
drawBackCanvas()
drawBackCanvas(this): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:581
draws the back canvas (the one containing the background and the connections)
Parameters
this
Returns
void
drawButton()
drawButton(
this,
x,
y,
w,
h,
text?,
bgcolor?,
hovercolor?,
textcolor?,
ignore_readonly?
): boolean;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:477
Parameters
this
x
number
y
number
w
number
h
number
text?
string
bgcolor?
string = LiteGraph.NODE_DEFAULT_COLOR
hovercolor?
string = "#555"
textcolor?
string = LiteGraph.NODE_TEXT_COLOR
ignore_readonly?
boolean = false
Returns
boolean
drawConnections()
drawConnections(this, ctx): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:1547
draws every connection visible in the canvas
Parameters
this
ctx
CanvasRenderingContext2D
Returns
void
drawExecutionOrder()
drawExecutionOrder(this, ctx): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:2011
Parameters
this
ctx
CanvasRenderingContext2D
Returns
void
drawFrontCanvas()
drawFrontCanvas(this): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:105
draws the front canvas (the one containing all the nodes)
Parameters
this
Returns
void
drawGroups()
drawGroups(
this,
canvas,
ctx
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:515
draws every group area in the background
Parameters
this
canvas
HTMLCanvasElement
ctx
CanvasRenderingContext2D
Returns
void
drawLinkTooltip()
drawLinkTooltip(
this,
ctx,
link
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:1166
used by this.over_link_center
Parameters
this
ctx
CanvasRenderingContext2D
link
Returns
void
drawNode()
drawNode(
this,
node,
ctx
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:749
draws the given node inside the canvas
Parameters
this
node
ctx
CanvasRenderingContext2D
Returns
void
drawNodeShape()
drawNodeShape(
this,
node,
ctx,
size,
fgColor,
bgColor,
selected,
mouseOver
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:1227
draws the shape of the given node in the canvas
Parameters
this
node
ctx
CanvasRenderingContext2D
size
fgColor
string
bgColor
string
selected
boolean
mouseOver
boolean
Returns
void
drawNodeWidgets()
drawNodeWidgets(
this,
node,
posY,
ctx,
activeWidget
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:2048
draws the widgets stored inside a node
Parameters
this
node
posY
number
ctx
CanvasRenderingContext2D
activeWidget
object
Returns
void
drawSubgraphPanel()
drawSubgraphPanel(this, ctx): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:368
draws the panel in the corner that shows subgraph properties
Parameters
this
ctx
CanvasRenderingContext2D
Returns
void
Method
drawSubgraphPanel
drawSubgraphPanelLeft()
drawSubgraphPanelLeft(
this,
subgraph,
subnode,
ctx
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:379
Parameters
this
subgraph
subnode
ctx
CanvasRenderingContext2D
Returns
void
drawSubgraphPanelRight()
drawSubgraphPanelRight(
this,
subgraph,
subnode,
ctx
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:427
Parameters
this
subgraph
subnode
ctx
CanvasRenderingContext2D
Returns
void
onRender()?
onRender?(canvas, ctx): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:12
Parameters
canvas
HTMLCanvasElement
ctx
CanvasRenderingContext2D
Returns
void
renderInfo()
renderInfo(
this,
ctx,
x?,
y?
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:559
draws some useful stats in the corner of the canvas
Parameters
this
ctx
CanvasRenderingContext2D
x?
number = 10
y?
number
Returns
void
renderLink()
renderLink(
this,
ctx,
a,
b,
link,
skipBorder,
flow,
color?,
startDir?,
endDir?,
numSublines?
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:1683
draws a link between two points
Parameters
this
ctx
CanvasRenderingContext2D
a
start pos
b
end pos
link
the link object with all the link info
skipBorder
boolean
ignore the shadow of the link
flow
boolean
show flow animation (for events)
color?
string
the color for the link
startDir?
the direction enum
endDir?
the direction enum
numSublines?
number
number of sublines (useful to represent vec3 or rgb)
Returns
void
sendToBack()
sendToBack(this, node): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:36
sends a node to the back (below all other nodes)
Parameters
this
node
Returns
void
setZoom()
setZoom(
this,
value,
center
): void;Defined in: packages/core/src/LGraphCanvas_Rendering.ts:15
changes the zoom level of the graph (default is 1), you can pass also a place used to pivot the zoom
Parameters
this
value
number
center
Returns
void