#

API Docs for:
Show: Inherited Protected Private Deprecated

# LGraphCanvas Class

Defined in: `../src/litegraph.js:2819`

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

## Constructor

### `LGraphCanvas`

(

- `canvas`
- `graph`
- `options`

)

Defined in `../src/litegraph.js:2819`

#### Parameters:

- `canvas` HTMLCanvas

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

- `graph` LGraph

  [optional]

- `options` Object

  [optional] { skip_rendering, autoresize }

- Index
- Methods

## Item Index

### Methods

- clear
- closeSubgraph
- getCanvasWindow
- openSubgraph
- setCanvas
- setGraph
- startRendering
- stopRendering

## Methods

### `clear`

()

Defined in `../src/litegraph.js:2481`

clears all the data inside

### `closeSubgraph`

(

- `assigns`

)

Defined in `../src/litegraph.js:2574`

closes a subgraph contained inside a node

#### Parameters:

- `assigns` LGraph

  a graph

### `getCanvasWindow`

() Window

Defined in `../src/litegraph.js:2835`

Used to attach the canvas in a popup

#### Returns:

Window:

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

### `openSubgraph`

(

- `graph`

)

Defined in `../src/litegraph.js:2547`

opens a graph contained inside a node in the current graph

#### Parameters:

- `graph` LGraph

### `setCanvas`

(

- `assigns`

)

Defined in `../src/litegraph.js:2589`

assigns a canvas

#### Parameters:

- `assigns` Canvas

  a canvas

### `setGraph`

(

- `graph`

)

Defined in `../src/litegraph.js:2516`

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

#### Parameters:

- `graph` LGraph

### `startRendering`

()

Defined in `../src/litegraph.js:2849`

starts rendering the content of the canvas when needed

### `stopRendering`

()

Defined in `../src/litegraph.js:2872`

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