diff --git a/packages/sigma/src/sigma.ts b/packages/sigma/src/sigma.ts index ff6adbc3a..bd0fce6e1 100644 --- a/packages/sigma/src/sigma.ts +++ b/packages/sigma/src/sigma.ts @@ -2344,9 +2344,12 @@ export default class Sigma< * - `hoverNodes` * - `mouse` * - * @return {PlainObject} - The collection of canvases. + * @return {PlainObject} - The collection of canvases. */ - getCanvases(): PlainObject { - return { ...this.elements }; + getCanvases(): PlainObject { + const res: Record = {}; + for (const layer in this.elements) + if (this.elements[layer] instanceof HTMLCanvasElement) res[layer] = this.elements[layer] as HTMLCanvasElement; + return res; } }