Skip to content

Commit

Permalink
[sigma] Fixes #getCanvases so that it returns only canvases
Browse files Browse the repository at this point in the history
  • Loading branch information
jacomyal committed Nov 19, 2024
1 parent 8874e8e commit 7e0453a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/sigma/src/sigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2344,9 +2344,12 @@ export default class Sigma<
* - `hoverNodes`
* - `mouse`
*
* @return {PlainObject<HTMLElement>} - The collection of canvases.
* @return {PlainObject<HTMLCanvasElement>} - The collection of canvases.
*/
getCanvases(): PlainObject<HTMLElement> {
return { ...this.elements };
getCanvases(): PlainObject<HTMLCanvasElement> {
const res: Record<string, HTMLCanvasElement> = {};
for (const layer in this.elements)
if (this.elements[layer] instanceof HTMLCanvasElement) res[layer] = this.elements[layer] as HTMLCanvasElement;
return res;
}
}

0 comments on commit 7e0453a

Please sign in to comment.