Skip to content
sigma.js sigma.js
v4.0.6 Docs Examples GitHub 12.2K

AttachmentManager

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:24

new AttachmentManager(gl, renderers, scheduleRender): AttachmentManager

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:37

WebGL2RenderingContext

Record<string, LabelAttachmentRenderer>

() => void

AttachmentManager

bindTexture(textureUnit): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:146

Binds the atlas texture to the given WebGL texture unit.

number

void


clear(): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:187

Clears all cached data and textures.

void


getEntry(node, attachmentName): AtlasEntry | null

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:156

Returns atlas entry for a cached attachment, or null if not packed yet.

string

string

AtlasEntry | null


invalidateNode(node): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:164

Invalidates cached and in-flight attachments for a node (e.g., on state change).

string

void


kill(): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:198

Full cleanup — releases GL resources and drops references for GC.

void


regenerateAtlas(): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:91

Packs all cached attachments into atlas textures and uploads to GL. Uploads the canvas directly (preserving premultiplied alpha). No-op when nothing has changed since the last call.

void


renderAttachment(node, attachmentName, context): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:57

Invokes the renderer for a node attachment if not already cached or pending. Sync content starts an async canvas conversion; async content (Promise) is awaited. In both cases the result is stored when ready and a re-render is scheduled via the callback provided at construction.

string

string

LabelAttachmentContext

void


restore(): void

Defined in: packages/sigma/src/rendering/nodes/attachments/attachment-manager.ts:179

Drops the dead GL texture after a context loss, for the next atlas pass to repack.

void