API Docs for:
Show:

LGraphCanvas Class

marks as dirty the canvas, this way it will be rendered again

Constructor

LGraphCanvas

(
  • canvas
  • graph
  • options
)

Parameters:

  • canvas HTMLCanvas

    the canvas where you want to render (it accepts a selector in string format or the canvas element itself)

  • graph LGraph

    [optional]

  • options Object

    [optional] { skip_rendering, autoresize }

Methods

clear

()

clears all the data inside

closeSubgraph

(
  • assigns
)

closes a subgraph contained inside a node

Parameters:

getCanvasWindow

() Window

Used to attach the canvas in a popup

Returns:

Window:

returns the window where the canvas is attached (the DOM root node)

openSubgraph

(
  • graph
)

opens a graph contained inside a node in the current graph

Parameters:

setCanvas

(
  • assigns
)

assigns a canvas

Parameters:

  • assigns Canvas

    a canvas (also accepts the ID of the element (not a selector)

setGraph

(
  • graph
)

assigns a graph, you can reasign graphs to the same canvas

Parameters:

startRendering

()

starts rendering the content of the canvas when needed

stopRendering

()

stops rendering the content of the canvas (to save resources)